removed non-working code for z-unodable and z-volatile images.
our priority is to implement support for std disk image formats (VMDK, VDI) instead.
This commit is contained in:
parent
0e4eecafba
commit
cb261c45d3
@ -2426,10 +2426,6 @@ static int parse_line_formatted(const char *context, int num_params, char *param
|
||||
if (type < 0) {
|
||||
PARSE_ERR(("%s: ataX-master/slave: unknown type '%s'", context, ¶ms[i][5]));
|
||||
}
|
||||
} else if (!strcmp(params[i], "mode=z-undoable")) {
|
||||
PARSE_ERR(("%s: ataX-master/slave mode 'z-undoable' not implemented yet", context));
|
||||
} else if (!strcmp(params[i], "mode=z-volatile")) {
|
||||
PARSE_ERR(("%s: ataX-master/slave mode 'z-volatile' not implemented yet", context));
|
||||
} else if (!strncmp(params[i], "mode=", 5)) {
|
||||
mode = SIM->get_param_enum("mode", base)->find_by_name(¶ms[i][5]);
|
||||
if (mode < 0) {
|
||||
|
@ -225,14 +225,6 @@
|
||||
// amount host memory, without causing a panic when host memory is exhausted.
|
||||
#define BX_LARGE_RAMFILE 0
|
||||
|
||||
// This option enables compressed (zlib) hd support
|
||||
#define BX_COMPRESSED_HD_SUPPORT 0
|
||||
#define BX_HAVE_ZLIB 0
|
||||
|
||||
#if BX_COMPRESSED_HD_SUPPORT && !BX_HAVE_ZLIB
|
||||
#error You must have zlib to enable compressed hd support
|
||||
#endif
|
||||
|
||||
// This option defines the number of supported ATA channels.
|
||||
// There are up to two drives per ATA channel.
|
||||
#define BX_MAX_ATA_CHANNEL 4
|
||||
|
136
bochs/configure
vendored
136
bochs/configure
vendored
@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# From configure.in Id: configure.in 10631 2011-08-27 14:29:11Z sshwarts .
|
||||
# From configure.in Id: configure.in 10648 2011-09-01 13:59:35Z sshwarts .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.68.
|
||||
#
|
||||
@ -846,7 +846,6 @@ LSMOD
|
||||
KERNELDIR
|
||||
PCI_OBJ
|
||||
NE2K_OBJS
|
||||
BX_COMPRESSED_HD_SUPPORT
|
||||
BX_LARGE_RAMFILE
|
||||
OBJS64
|
||||
NONPLUGIN_GUI_LINK_OPTS
|
||||
@ -953,7 +952,6 @@ enable_smp
|
||||
enable_cpu_level
|
||||
enable_long_phy_address
|
||||
enable_large_ramfile
|
||||
enable_compressed_hd
|
||||
enable_ne2000
|
||||
enable_pci
|
||||
enable_pcidev
|
||||
@ -1670,7 +1668,6 @@ Optional Features:
|
||||
--enable-cpu-level select cpu level (3,4,5,6)
|
||||
--enable-long-phy-address compile in support for physical address larger than 32 bit
|
||||
--enable-large-ramfile enable large ramfile support
|
||||
--enable-compressed-hd allows compressed (zlib) hard disk image (not implemented yet)
|
||||
--enable-ne2000 enable NE2000 support
|
||||
--enable-pci enable i440FX PCI support
|
||||
--enable-pcidev enable PCI host device mapping support (linux host only)
|
||||
@ -5108,7 +5105,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 5111 "configure"' > conftest.$ac_ext
|
||||
echo '#line 5108 "configure"' > conftest.$ac_ext
|
||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -6796,11 +6793,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:6799: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:6796: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:6803: \$? = $ac_status" >&5
|
||||
echo "$as_me:6800: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -7029,11 +7026,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7032: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7029: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:7036: \$? = $ac_status" >&5
|
||||
echo "$as_me:7033: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -7096,11 +7093,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7099: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7096: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:7103: \$? = $ac_status" >&5
|
||||
echo "$as_me:7100: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -8886,7 +8883,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8889 "configure"
|
||||
#line 8886 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -8984,7 +8981,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 8987 "configure"
|
||||
#line 8984 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11099,11 +11096,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:11102: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:11099: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:11106: \$? = $ac_status" >&5
|
||||
echo "$as_me:11103: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -11166,11 +11163,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:11169: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:11166: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:11173: \$? = $ac_status" >&5
|
||||
echo "$as_me:11170: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -12191,7 +12188,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 12194 "configure"
|
||||
#line 12191 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12289,7 +12286,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 12292 "configure"
|
||||
#line 12289 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13112,11 +13109,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13115: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13112: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:13119: \$? = $ac_status" >&5
|
||||
echo "$as_me:13116: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -13179,11 +13176,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13182: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13179: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:13186: \$? = $ac_status" >&5
|
||||
echo "$as_me:13183: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -15144,11 +15141,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15147: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15144: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15151: \$? = $ac_status" >&5
|
||||
echo "$as_me:15148: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -15377,11 +15374,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15380: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15377: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15384: \$? = $ac_status" >&5
|
||||
echo "$as_me:15381: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -15444,11 +15441,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15447: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15444: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:15451: \$? = $ac_status" >&5
|
||||
echo "$as_me:15448: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -17234,7 +17231,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17237 "configure"
|
||||
#line 17234 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -17332,7 +17329,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 17335 "configure"
|
||||
#line 17332 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -19018,7 +19015,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 19021 "configure"
|
||||
#line 19018 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -21896,81 +21893,6 @@ fi
|
||||
|
||||
|
||||
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_zlib_h" = xyes; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
|
||||
$as_echo_n "checking for gzopen in -lz... " >&6; }
|
||||
if ${ac_cv_lib_z_gzopen+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lz $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char gzopen ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return gzopen ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_z_gzopen=yes
|
||||
else
|
||||
ac_cv_lib_z_gzopen=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
|
||||
$as_echo "$ac_cv_lib_z_gzopen" >&6; }
|
||||
if test "x$ac_cv_lib_z_gzopen" = xyes; then :
|
||||
$as_echo "#define BX_HAVE_ZLIB 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressed hard disk image support" >&5
|
||||
$as_echo_n "checking for compressed hard disk image support... " >&6; }
|
||||
# Check whether --enable-compressed-hd was given.
|
||||
if test "${enable_compressed_hd+set}" = set; then :
|
||||
enableval=$enable_compressed_hd; if test "$enableval" = yes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
$as_echo "#define BX_COMPRESSED_HD_SUPPORT 1" >>confdefs.h
|
||||
|
||||
LIBS="$LIBS -lz"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
$as_echo "#define BX_COMPRESSED_HD_SUPPORT 0" >>confdefs.h
|
||||
|
||||
fi
|
||||
else
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
$as_echo "#define BX_COMPRESSED_HD_SUPPORT 0" >>confdefs.h
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NE2000 support" >&5
|
||||
$as_echo_n "checking for NE2000 support... " >&6; }
|
||||
# Check whether --enable-ne2000 was given.
|
||||
|
@ -622,26 +622,6 @@ AC_ARG_ENABLE(large-ramfile,
|
||||
)
|
||||
AC_SUBST(BX_LARGE_RAMFILE)
|
||||
|
||||
AC_CHECK_HEADER(zlib.h, [AC_CHECK_LIB(z, gzopen, AC_DEFINE(BX_HAVE_ZLIB,1))] )
|
||||
|
||||
AC_MSG_CHECKING(for compressed hard disk image support)
|
||||
AC_ARG_ENABLE(compressed-hd,
|
||||
[ --enable-compressed-hd allows compressed (zlib) hard disk image (not implemented yet)],
|
||||
[if test "$enableval" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 1)
|
||||
LIBS="$LIBS -lz"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 0)
|
||||
fi],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_COMPRESSED_HD_SUPPORT, 0)
|
||||
]
|
||||
)
|
||||
AC_SUBST(BX_COMPRESSED_HD_SUPPORT)
|
||||
|
||||
AC_MSG_CHECKING(for NE2000 support)
|
||||
AC_ARG_ENABLE(ne2000,
|
||||
[ --enable-ne2000 enable NE2000 support],
|
||||
|
@ -7367,15 +7367,6 @@ If unspecified, the default "mode" is flat.
|
||||
</table>
|
||||
</para>
|
||||
|
||||
<!--
|
||||
<note>
|
||||
<para>
|
||||
z-undoable and z-volatile modes are only available if the "- -enable-compressed-hd" parameter
|
||||
was set at compile time.
|
||||
</para>
|
||||
</note>
|
||||
-->
|
||||
|
||||
<section id="harddisk-mode-flat"><title>flat</title>
|
||||
<para>
|
||||
</para>
|
||||
@ -8034,65 +8025,6 @@ The flat disk images must be created with the bximage utility
|
||||
</section>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<section><title>z-undoable</title>
|
||||
<para>
|
||||
</para>
|
||||
<section><title>description</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>image creation</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>path</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>external tools</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>typical use</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>limitations</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section><title>z-volatile</title>
|
||||
<para>
|
||||
</para>
|
||||
<section><title>description</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>image creation</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>path</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>external tools</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>typical use</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section><title>limitations</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
-->
|
||||
|
||||
</section>
|
||||
|
||||
@ -8134,10 +8066,6 @@ This tool can commit redologs into flat images.
|
||||
</para>
|
||||
<para>
|
||||
For now, only "undoable" redologs to flat image commits are supported.
|
||||
<!--
|
||||
"z-undoable" redologs can also be used, but you have to manually
|
||||
decompress the gzipped flat file before using bxcommit.
|
||||
-->
|
||||
Sparse disk image commits may be added in the future.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -491,17 +491,13 @@ const char *hdimage_mode_names[] = {
|
||||
"undoable",
|
||||
"growing",
|
||||
"volatile",
|
||||
"z-undoable",
|
||||
"z-volatile",
|
||||
"vvfat",
|
||||
NULL
|
||||
};
|
||||
|
||||
int bx_real_sim_c::hdimage_get_mode(const char *mode)
|
||||
{
|
||||
Bit8u i;
|
||||
|
||||
for (i = 0; i <= BX_HDIMAGE_MODE_LAST; i++) {
|
||||
for (int i = 0; i <= BX_HDIMAGE_MODE_LAST; i++) {
|
||||
if (!strcmp(mode, hdimage_mode_names[i])) return i;
|
||||
}
|
||||
return -1;
|
||||
|
@ -519,8 +519,6 @@ enum {
|
||||
BX_HDIMAGE_MODE_UNDOABLE,
|
||||
BX_HDIMAGE_MODE_GROWING,
|
||||
BX_HDIMAGE_MODE_VOLATILE,
|
||||
BX_HDIMAGE_MODE_Z_UNDOABLE,
|
||||
BX_HDIMAGE_MODE_Z_VOLATILE,
|
||||
BX_HDIMAGE_MODE_VVFAT
|
||||
};
|
||||
#define BX_HDIMAGE_MODE_LAST BX_HDIMAGE_MODE_VVFAT
|
||||
@ -569,7 +567,7 @@ enum ci_command_t { CI_START, CI_RUNTIME_CONFIG, CI_SHUTDOWN };
|
||||
enum ci_return_t {
|
||||
CI_OK, // normal return value
|
||||
CI_ERR_NO_TEXT_CONSOLE // err: can't work because there's no text console
|
||||
};
|
||||
};
|
||||
typedef int (*config_interface_callback_t)(void *userdata, ci_command_t command);
|
||||
typedef BxEvent* (*bxevent_handler)(void *theclass, BxEvent *event);
|
||||
typedef void (*rt_conf_handler_t)(void *this_ptr);
|
||||
|
@ -107,22 +107,6 @@ device_image_t* bx_hdimage_ctl_c::init_image(Bit8u image_mode, Bit64u disk_size,
|
||||
hdimage = new volatile_image_t(journal);
|
||||
break;
|
||||
|
||||
#if BX_COMPRESSED_HD_SUPPORT
|
||||
case BX_HDIMAGE_MODE_Z_UNDOABLE:
|
||||
BX_PANIC(("z-undoable disk support not implemented"));
|
||||
#if 0
|
||||
hdimage = new z_undoable_image_t(disk_size, journal);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BX_HDIMAGE_MODE_Z_VOLATILE:
|
||||
BX_PANIC(("z-volatile disk support not implemented"));
|
||||
#if 0
|
||||
hdimage = new z_volatile_image_t(disk_size, "journal");
|
||||
#endif
|
||||
break;
|
||||
#endif //BX_COMPRESSED_HD_SUPPORT
|
||||
|
||||
case BX_HDIMAGE_MODE_VVFAT:
|
||||
hdimage = new vvfat_image_t(disk_size, journal);
|
||||
break;
|
||||
@ -451,7 +435,7 @@ void sparse_image_t::read_header()
|
||||
|
||||
#ifdef _POSIX_MAPPED_FILES
|
||||
// Try to memory map from the beginning of the file (0 is trivially a page multiple)
|
||||
void * mmap_header = mmap(NULL, preamble_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
void *mmap_header = mmap(NULL, preamble_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
if (mmap_header == MAP_FAILED)
|
||||
{
|
||||
BX_INFO(("failed to mmap sparse disk file - using conventional file access"));
|
||||
@ -1645,262 +1629,3 @@ ssize_t volatile_image_t::write(const void* buf, size_t count)
|
||||
}
|
||||
return (ret < 0) ? ret : count;
|
||||
}
|
||||
|
||||
#if BX_COMPRESSED_HD_SUPPORT
|
||||
|
||||
/*** z_ro_image_t function definitions ***/
|
||||
|
||||
z_ro_image_t::z_ro_image_t()
|
||||
{
|
||||
offset = (Bit64s)0;
|
||||
}
|
||||
|
||||
int z_ro_image_t::open(const char* pathname)
|
||||
{
|
||||
fd = ::open(pathname, O_RDONLY
|
||||
#ifdef O_BINARY
|
||||
| O_BINARY
|
||||
#endif
|
||||
);
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
BX_PANIC(("Could not open '%s' file", pathname));
|
||||
return fd;
|
||||
}
|
||||
|
||||
gzfile = gzdopen(fd, "rb");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void z_ro_image_t::close()
|
||||
{
|
||||
if (fd > -1) {
|
||||
gzclose(gzfile);
|
||||
// ::close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
Bit64s z_ro_image_t::lseek(Bit64s _offset, int whence)
|
||||
{
|
||||
// Only SEEK_SET supported
|
||||
if (whence != SEEK_SET)
|
||||
{
|
||||
BX_PANIC(("lseek on compressed images : only SEEK_SET supported"));
|
||||
}
|
||||
|
||||
// Seeking is expensive on compressed files, so we do it
|
||||
// only when necessary, at the latest moment
|
||||
offset = _offset;
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
ssize_t z_ro_image_t::read(void* buf, size_t count)
|
||||
{
|
||||
gzseek(gzfile, offset, SEEK_SET);
|
||||
return gzread(gzfile, buf, count);
|
||||
}
|
||||
|
||||
ssize_t z_ro_image_t::write(const void* buf, size_t count)
|
||||
{
|
||||
BX_PANIC(("z_ro_image: write not supported"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*** z_undoable_image_t function definitions ***/
|
||||
|
||||
z_undoable_image_t::z_undoable_image_t(Bit64u _size, const char* _redolog_name)
|
||||
{
|
||||
redolog = new redolog_t();
|
||||
ro_disk = new z_ro_image_t();
|
||||
size = _size;
|
||||
|
||||
redolog_name = NULL;
|
||||
if (_redolog_name != NULL) {
|
||||
if (strcmp(_redolog_name,"") != 0) {
|
||||
redolog_name = strdup(_redolog_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
z_undoable_image_t::~z_undoable_image_t()
|
||||
{
|
||||
delete redolog;
|
||||
delete ro_disk;
|
||||
}
|
||||
|
||||
int z_undoable_image_t::open(const char* pathname)
|
||||
{
|
||||
char *logname=NULL;
|
||||
|
||||
if (ro_disk->open(pathname)<0)
|
||||
return -1;
|
||||
|
||||
// If redolog name was set
|
||||
if (redolog_name != NULL) {
|
||||
if (strcmp(redolog_name, "") != 0) {
|
||||
logname = (char*)malloc(strlen(redolog_name) + 1);
|
||||
strcpy (logname, redolog_name);
|
||||
}
|
||||
}
|
||||
|
||||
// Otherwise we make up the redolog filename from the pathname
|
||||
if (logname == NULL) {
|
||||
logname = (char*)malloc(strlen(pathname) + UNDOABLE_REDOLOG_EXTENSION_LENGTH + 1);
|
||||
sprintf (logname, "%s%s", pathname, UNDOABLE_REDOLOG_EXTENSION);
|
||||
}
|
||||
|
||||
if (redolog->open(logname, REDOLOG_SUBTYPE_UNDOABLE) < 0)
|
||||
{
|
||||
if (redolog->create(logname, REDOLOG_SUBTYPE_UNDOABLE, size) < 0)
|
||||
{
|
||||
BX_PANIC(("Can't open or create redolog '%s'",logname));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
BX_INFO(("'z-undoable' disk opened, z-ro-file is '%s', redolog is '%s'", pathname, logname));
|
||||
free(logname);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void z_undoable_image_t::close()
|
||||
{
|
||||
redolog->close();
|
||||
ro_disk->close();
|
||||
|
||||
if (redolog_name!=NULL)
|
||||
free(redolog_name);
|
||||
}
|
||||
|
||||
Bit64s z_undoable_image_t::lseek(Bit64s offset, int whence)
|
||||
{
|
||||
redolog->lseek(offset, whence);
|
||||
return ro_disk->lseek(offset, whence);
|
||||
}
|
||||
|
||||
ssize_t z_undoable_image_t::read(void* buf, size_t count)
|
||||
{
|
||||
// This should be fixed if count != 512
|
||||
if (redolog->read((char*) buf, count) != count)
|
||||
return ro_disk->read((char*) buf, count);
|
||||
else
|
||||
return count;
|
||||
}
|
||||
|
||||
ssize_t z_undoable_image_t::write(const void* buf, size_t count)
|
||||
{
|
||||
return redolog->write((char*) buf, count);
|
||||
}
|
||||
|
||||
|
||||
/*** z_volatile_image_t function definitions ***/
|
||||
|
||||
z_volatile_image_t::z_volatile_image_t(Bit64u _size, const char* _redolog_name)
|
||||
{
|
||||
redolog = new redolog_t();
|
||||
ro_disk = new z_ro_image_t();
|
||||
size = _size;
|
||||
|
||||
redolog_temp = NULL;
|
||||
redolog_name = NULL;
|
||||
if (_redolog_name != NULL) {
|
||||
if (strcmp(_redolog_name,"") != 0) {
|
||||
redolog_name = strdup(_redolog_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
z_volatile_image_t::~z_volatile_image_t()
|
||||
{
|
||||
delete redolog;
|
||||
delete ro_disk;
|
||||
}
|
||||
|
||||
int z_volatile_image_t::open(const char* pathname)
|
||||
{
|
||||
int filedes;
|
||||
const char *logname=NULL;
|
||||
|
||||
if (ro_disk->open(pathname)<0)
|
||||
return -1;
|
||||
|
||||
// if redolog name was set
|
||||
if (redolog_name != NULL) {
|
||||
if (strcmp(redolog_name, "") != 0) {
|
||||
logname = redolog_name;
|
||||
}
|
||||
}
|
||||
|
||||
// otherwise use pathname as template
|
||||
if (logname == NULL) {
|
||||
logname = pathname;
|
||||
}
|
||||
|
||||
redolog_temp = (char*)malloc(strlen(logname) + VOLATILE_REDOLOG_EXTENSION_LENGTH + 1);
|
||||
sprintf (redolog_temp, "%s%s", logname, VOLATILE_REDOLOG_EXTENSION);
|
||||
|
||||
filedes = mkstemp (redolog_temp);
|
||||
|
||||
if (filedes < 0)
|
||||
{
|
||||
BX_PANIC(("Can't create volatile redolog '%s'", redolog_temp));
|
||||
return -1;
|
||||
}
|
||||
if (redolog->create(filedes, REDOLOG_SUBTYPE_VOLATILE, size) < 0)
|
||||
{
|
||||
BX_PANIC(("Can't create volatile redolog '%s'", redolog_temp));
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if (!defined(WIN32)) && !BX_WITH_MACOS
|
||||
// on unix it is legal to delete an open file
|
||||
unlink(redolog_temp);
|
||||
#endif
|
||||
|
||||
BX_INFO(("'z-volatile' disk opened: z-ro-file is '%s', redolog is '%s'", pathname, redolog_temp));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void z_volatile_image_t::close ()
|
||||
{
|
||||
redolog->close();
|
||||
ro_disk->close();
|
||||
|
||||
#if defined(WIN32) || BX_WITH_MACOS
|
||||
// on non-unix we have to wait till the file is closed to delete it
|
||||
unlink(redolog_temp);
|
||||
#endif
|
||||
|
||||
if (redolog_temp!=NULL)
|
||||
free(redolog_temp);
|
||||
|
||||
if (redolog_name!=NULL)
|
||||
free(redolog_name);
|
||||
}
|
||||
|
||||
Bit64s z_volatile_image_t::lseek(Bit64s offset, int whence)
|
||||
{
|
||||
redolog->lseek(offset, whence);
|
||||
return ro_disk->lseek(offset, whence);
|
||||
}
|
||||
|
||||
ssize_t z_volatile_image_t::read (void* buf, size_t count)
|
||||
{
|
||||
// This should be fixed if count != 512
|
||||
if (redolog->read((char*) buf, count) != count)
|
||||
return ro_disk->read((char*) buf, count);
|
||||
else
|
||||
return count;
|
||||
}
|
||||
|
||||
ssize_t z_volatile_image_t::write (const void* buf, size_t count)
|
||||
{
|
||||
return redolog->write((char*) buf, count);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -64,8 +64,6 @@
|
||||
#define REDOLOG_SUBTYPE_UNDOABLE "Undoable"
|
||||
#define REDOLOG_SUBTYPE_VOLATILE "Volatile"
|
||||
#define REDOLOG_SUBTYPE_GROWING "Growing"
|
||||
// #define REDOLOG_SUBTYPE_Z_UNDOABLE "z-Undoable"
|
||||
// #define REDOLOG_SUBTYPE_Z_VOLATILE "z-Volatile"
|
||||
|
||||
#define REDOLOG_PAGE_NOT_ALLOCATED (0xffffffff)
|
||||
|
||||
@ -186,7 +184,6 @@ class default_image_t : public device_image_t
|
||||
|
||||
private:
|
||||
int fd;
|
||||
|
||||
};
|
||||
|
||||
// CONCAT MODE
|
||||
@ -274,7 +271,7 @@ class sparse_image_t : public device_image_t
|
||||
size_t mmap_length;
|
||||
size_t system_pagesize_mask;
|
||||
#endif
|
||||
Bit32u * pagetable;
|
||||
Bit32u *pagetable;
|
||||
|
||||
// Header is written to disk in little-endian (x86) format
|
||||
// Thus needs to be converted on big-endian systems before read
|
||||
@ -282,14 +279,14 @@ class sparse_image_t : public device_image_t
|
||||
|
||||
sparse_header_t header;
|
||||
|
||||
Bit32u pagesize;
|
||||
int pagesize_shift;
|
||||
Bit32u pagesize_mask;
|
||||
Bit32u pagesize;
|
||||
int pagesize_shift;
|
||||
Bit32u pagesize_mask;
|
||||
|
||||
Bit64s data_start;
|
||||
Bit64s underlying_filesize;
|
||||
Bit64s data_start;
|
||||
Bit64s underlying_filesize;
|
||||
|
||||
char * pathname;
|
||||
char *pathname;
|
||||
|
||||
Bit64s position;
|
||||
|
||||
@ -307,7 +304,7 @@ class sparse_image_t : public device_image_t
|
||||
void read_header();
|
||||
ssize_t read_page_fragment(Bit32u read_virtual_page, Bit32u read_page_offset, size_t read_size, void * buf);
|
||||
|
||||
sparse_image_t * parent_image;
|
||||
sparse_image_t *parent_image;
|
||||
};
|
||||
|
||||
#if EXTERNAL_DISK_SIMULATOR
|
||||
@ -338,7 +335,6 @@ class dll_image_t : public device_image_t
|
||||
|
||||
private:
|
||||
int vunit,vblk;
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -471,112 +467,6 @@ class volatile_image_t : public device_image_t
|
||||
};
|
||||
|
||||
|
||||
#if BX_COMPRESSED_HD_SUPPORT
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
|
||||
// Default compressed READ-ONLY image class
|
||||
class z_ro_image_t : public device_image_t
|
||||
{
|
||||
public:
|
||||
// Contructor
|
||||
z_ro_image_t();
|
||||
|
||||
// Open a image. Returns non-negative if successful.
|
||||
int open(const char* pathname);
|
||||
|
||||
// Close the image.
|
||||
void close();
|
||||
|
||||
// Position ourselves. Return the resulting offset from the
|
||||
// beginning of the file.
|
||||
Bit64s lseek(Bit64s offset, int whence);
|
||||
|
||||
// Read count bytes to the buffer buf. Return the number of
|
||||
// bytes read (count).
|
||||
ssize_t read(void* buf, size_t count);
|
||||
|
||||
// Write count bytes from buf. Return the number of bytes
|
||||
// written (count).
|
||||
ssize_t write(const void* buf, size_t count);
|
||||
|
||||
private:
|
||||
Bit64s offset;
|
||||
int fd;
|
||||
gzFile gzfile;
|
||||
|
||||
};
|
||||
|
||||
// Z-UNDOABLE MODE
|
||||
class z_undoable_image_t : public device_image_t
|
||||
{
|
||||
public:
|
||||
// Contructor
|
||||
z_undoable_image_t(Bit64u size, const char* redolog_name);
|
||||
virtual ~z_undoable_image_t();
|
||||
|
||||
// Open a image. Returns non-negative if successful.
|
||||
int open(const char* pathname);
|
||||
|
||||
// Close the image.
|
||||
void close();
|
||||
|
||||
// Position ourselves. Return the resulting offset from the
|
||||
// beginning of the file.
|
||||
Bit64s lseek(Bit64s offset, int whence);
|
||||
|
||||
// Read count bytes to the buffer buf. Return the number of
|
||||
// bytes read (count).
|
||||
ssize_t read(void* buf, size_t count);
|
||||
|
||||
// Write count bytes from buf. Return the number of bytes
|
||||
// written (count).
|
||||
ssize_t write(const void* buf, size_t count);
|
||||
|
||||
private:
|
||||
redolog_t *redolog; // Redolog instance
|
||||
z_ro_image_t *ro_disk; // Read-only compressed flat disk instance
|
||||
Bit64u size;
|
||||
char *redolog_name; // Redolog name
|
||||
};
|
||||
|
||||
// Z-VOLATILE MODE
|
||||
class z_volatile_image_t : public device_image_t
|
||||
{
|
||||
public:
|
||||
// Contructor
|
||||
z_volatile_image_t(Bit64u size, const char* redolog_name);
|
||||
virtual ~z_volatile_image_t();
|
||||
|
||||
// Open a image. Returns non-negative if successful.
|
||||
int open(const char* pathname);
|
||||
|
||||
// Close the image.
|
||||
void close();
|
||||
|
||||
// Position ourselves. Return the resulting offset from the
|
||||
// beginning of the file.
|
||||
Bit64s lseek(Bit64s offset, int whence);
|
||||
|
||||
// Read count bytes to the buffer buf. Return the number of
|
||||
// bytes read (count).
|
||||
ssize_t read(void* buf, size_t count);
|
||||
|
||||
// Write count bytes from buf. Return the number of bytes
|
||||
// written (count).
|
||||
ssize_t write(const void* buf, size_t count);
|
||||
|
||||
private:
|
||||
redolog_t *redolog; // Redolog instance
|
||||
z_ro_image_t *ro_disk; // Read-only compressed flat disk instance
|
||||
Bit64u size;
|
||||
char *redolog_name; // Redolog name
|
||||
char *redolog_temp; // Redolog temporary file name
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
class bx_hdimage_ctl_c : public bx_hdimage_ctl_stub_c {
|
||||
public:
|
||||
bx_hdimage_ctl_c();
|
||||
@ -587,7 +477,6 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
#endif // HDIMAGE_HEADERS_ONLY
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user