From 898517b0bc065a283249f035e7f2de251372cbdb Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sun, 31 Jul 2011 15:38:11 -0500 Subject: Update version to 0.15.0-rc2 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 106c0a4ca..dc82dfd47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.51 +0.14.92 -- cgit v1.2.3 From 88ca9f047bf8df20ae0a6305d99cbad1e893777f Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 26 Jul 2011 11:39:24 -0500 Subject: Makefile: add missing deps on $(GENERATED_HEADERS) This fixes a build issue with make -j6+ due to qapi-generated files being built before $(GENERATED_HEADERS) have been created. Tested-by: Stefan Berger Signed-off-by: Michael Roth Signed-off-by: Stefan Hajnoczi --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index daa3aa09b..0a31633f0 100644 --- a/Makefile +++ b/Makefile @@ -192,8 +192,10 @@ test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types test-qmp-commands: test-qmp-commands.o qfloat.o qint.o qdict.o qstring.o qlist.o qbool.o $(qapi-obj-y) error.o osdep.o qemu-malloc.o $(oslib-obj-y) qjson.o json-streamer.o json-lexer.o json-parser.o qerror.o qemu-error.o qemu-tool.o $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o QGALIB=qga/guest-agent-command-state.o qga/guest-agent-commands.o +QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c) -qemu-ga.o: $(addprefix $(qapi-dir)/, qga-qapi-types.c qga-qapi-types.h qga-qapi-visit.c qga-qmp-marshal.c) $(qapi-obj-y) +$(QGALIB_GEN): $(GENERATED_HEADERS) +$(QGALIB) qemu-ga.o: $(QGALIB_GEN) $(qapi-obj-y) qemu-ga$(EXESUF): qemu-ga.o $(QGALIB) qemu-tool.o qemu-error.o error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) $(qapi-obj-y) qemu-timer-common.o qemu-sockets.o module.o qapi/qmp-dispatch.o qapi/qmp-registry.o $(qapi-dir)/qga-qapi-visit.o $(qapi-dir)/qga-qapi-types.o $(qapi-dir)/qga-qmp-marshal.o QEMULIBS=libhw32 libhw64 libuser libdis libdis-user -- cgit v1.2.3 From ae2dd33693b46e472db70cd174b17b4f52d7eb17 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 21 Jul 2011 20:52:24 +0200 Subject: lm32: softusb: claim to support full speed The QEMU keyboard and mouse reports themselves as full speed devices, though they are actually low speed devices. Until this is fixed, claim that we are supporting full speed devices. Acked-by: Gerd Hoffmann Signed-off-by: Michael Walle Signed-off-by: Edgar E. Iglesias --- hw/milkymist-softusb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/milkymist-softusb.c b/hw/milkymist-softusb.c index ce2bfc60f..abf7b59ac 100644 --- a/hw/milkymist-softusb.c +++ b/hw/milkymist-softusb.c @@ -310,10 +310,12 @@ static int milkymist_softusb_init(SysBusDevice *dev) usb_bus_new(&s->usbbus, &softusb_bus_ops, NULL); /* our two ports */ + /* FIXME: claim to support full speed devices. qemu mouse and keyboard + * report themselves as full speed devices. */ usb_register_port(&s->usbbus, &s->usbport[0], NULL, 0, &softusb_ops, - USB_SPEED_MASK_LOW); + USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); usb_register_port(&s->usbbus, &s->usbport[1], NULL, 1, &softusb_ops, - USB_SPEED_MASK_LOW); + USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); /* and finally create an usb keyboard */ s->usbdev = usb_create_simple(&s->usbbus, "usb-kbd"); -- cgit v1.2.3 From 01825a8ddf2f269407905d67993d73abab6e2177 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 30 Jul 2011 13:18:35 +0100 Subject: user: Restore debug usage message for '-d ?' in user mode emulation The code which prints the debug usage message on '-d ?' for *-user has to come before the check for "not enough arguments", so that "qemu-foo -d ?" prints the list of possible debug log items rather than the generic usage message. (This was inadvertently broken in commit c235d73.) Signed-off-by: Peter Maydell --- bsd-user/main.c | 8 +++++--- darwin-user/main.c | 8 +++++--- linux-user/main.c | 11 ++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 6018a419e..a63b8777f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -856,9 +856,6 @@ int main(int argc, char **argv) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; /* init debug */ cpu_set_log_filename(log_file); @@ -877,6 +874,11 @@ int main(int argc, char **argv) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); diff --git a/darwin-user/main.c b/darwin-user/main.c index 35196a12c..72307adeb 100644 --- a/darwin-user/main.c +++ b/darwin-user/main.c @@ -809,9 +809,6 @@ int main(int argc, char **argv) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; /* init debug */ cpu_set_log_filename(log_file); @@ -830,6 +827,11 @@ int main(int argc, char **argv) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); diff --git a/linux-user/main.c b/linux-user/main.c index 2135b9c71..6a8f4bdc1 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; - exec_path = argv[optind]; - /* init debug */ cpu_set_log_filename(log_file); if (log_mask) { @@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + exec_path = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); -- cgit v1.2.3 From 09afeef1abb4cb5086da2933c4f5606acace4ca1 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Mon, 1 Aug 2011 14:52:57 -0500 Subject: guest agent: add --enable-guest-agent config option QAPI will require glib/python, but for now the guest agent is the only user. For now, make these dependencies an explicit guest agent one, and give users the option to disable it if need be. Once QAPI is adopted in core QEMU code, we would basically revert this patch. Signed-off-by: Michael Roth Signed-off-by: Anthony Liguori --- configure | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 38e3724f3..a691e7447 100755 --- a/configure +++ b/configure @@ -179,6 +179,7 @@ smartcard="" smartcard_nss="" usb_redir="" opengl="" +guest_agent="yes" # parse CC options first for opt do @@ -751,6 +752,10 @@ for opt do ;; --enable-usb-redir) usb_redir="yes" ;; + --enable-guest-agent) guest_agent="yes" + ;; + --disable-guest-agent) guest_agent="no" + ;; *) echo "ERROR: unknown option $opt"; show_help="yes" ;; esac @@ -1029,6 +1034,8 @@ echo " --disable-smartcard-nss disable smartcard nss support" echo " --enable-smartcard-nss enable smartcard nss support" echo " --disable-usb-redir disable usb network redirection support" echo " --enable-usb-redir enable usb network redirection support" +echo " --disable-guest-agent disable building of the QEMU Guest Agent" +echo " --enable-guest-agent enable building of the QEMU Guest Agent" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 @@ -1088,11 +1095,13 @@ if test "$solaris" = "yes" ; then fi fi -if has $python; then - : -else - echo "Python not found. Use --python=/path/to/python" - exit 1 +if test "$guest_agent" != "no" ; then + if has $python; then + : + else + echo "Python not found. Use --python=/path/to/python" + exit 1 + fi fi if test -z "$target_list" ; then @@ -1822,14 +1831,16 @@ fi ########################################## # glib support probe -if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then - glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null` - glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null` - libs_softmmu="$glib_libs $libs_softmmu" - libs_tools="$glib_libs $libs_tools" -else - echo "glib-2.0 required to compile QEMU" - exit 1 +if test "$guest_agent" != "no" ; then + if $pkg_config --modversion glib-2.0 > /dev/null 2>&1 ; then + glib_cflags=`$pkg_config --cflags glib-2.0 2>/dev/null` + glib_libs=`$pkg_config --libs glib-2.0 2>/dev/null` + libs_softmmu="$glib_libs $libs_softmmu" + libs_tools="$glib_libs $libs_tools" + else + echo "glib-2.0 required to compile QEMU" + exit 1 + fi fi ########################################## @@ -2566,7 +2577,9 @@ if test "$softmmu" = yes ; then tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools" if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then tools="qemu-nbd\$(EXESUF) $tools" + if [ "$guest_agent" = "yes" ]; then tools="qemu-ga\$(EXESUF) $tools" + fi if [ "$check_utests" = "yes" ]; then tools="check-qint check-qstring check-qdict check-qlist $tools" tools="check-qfloat check-qjson $tools" @@ -2667,6 +2680,7 @@ echo "xfsctl support $xfs" echo "nss used $smartcard_nss" echo "usb net redir $usb_redir" echo "OpenGL support $opengl" +echo "build guest agent $guest_agent" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" -- cgit v1.2.3 From 9096de69fff3cf34a848e8db3ffddc55cc64adb8 Mon Sep 17 00:00:00 2001 From: Wolfgang Mauerer Date: Mon, 11 Jul 2011 14:57:43 +0200 Subject: vhost build fix for i386 vhost.c uses __sync_fetch_and_and(), which is only available for -march=i486 and above (see https://bugzilla.redhat.com/show_bug.cgi?id=624279). Signed-off-by: Wolfgang Mauerer Signed-off-by: Stefan Hajnoczi (cherry picked from commit 023367e6cd41199521613674b44e9c703c8be1a1) --- configure | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/configure b/configure index a691e7447..a5b01739d 100755 --- a/configure +++ b/configure @@ -2520,6 +2520,29 @@ if test "$trace_backend" = "dtrace"; then fi fi +########################################## +# __sync_fetch_and_and requires at least -march=i486. Many toolchains +# use i686 as default anyway, but for those that don't, an explicit +# specification is necessary +if test $vhost_net = "yes" && test $cpu = "i386"; then + cat > $TMPC << EOF +int sfaa(unsigned *ptr) +{ + return __sync_fetch_and_and(ptr, 0); +} + +int main(int argc, char **argv) +{ + int val = 42; + sfaa(&val); + return val; +} +EOF + if ! compile_prog "" "" ; then + CFLAGS+="-march=i486" + fi +fi + ########################################## # End of CC checks # After here, no more $cc or $ld runs -- cgit v1.2.3 From 51dd7a94c717af17b75891eea358f548e52acb07 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 31 Jul 2011 16:47:20 -0700 Subject: alpha-softmmu: Disable for the 0.15 release branch. The system emulation code was not merged before the branch. Let's leave that work for the next release. Signed-off-by: Richard Henderson Signed-off-by: Anthony Liguori --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index a5b01739d..3d39d1b19 100755 --- a/configure +++ b/configure @@ -845,7 +845,6 @@ if [ "$softmmu" = "yes" ] ; then default_target_list="\ i386-softmmu \ x86_64-softmmu \ -alpha-softmmu \ arm-softmmu \ cris-softmmu \ lm32-softmmu \ -- cgit v1.2.3 From e2f775205a3523751ac479ec3194eb054376419d Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Thu, 4 Aug 2011 15:28:01 -0500 Subject: Revert "floppy: save and restore DIR register" This reverts commit 7d905f716bea633f2836e1d661387983aacdc6d6. The use of subsections by this commit are broken because of a fundamental limitations of subsections in the current protocol. Signed-off-by: Anthony Liguori --- hw/fdc.c | 51 +-------------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index edf0360d1..9fdbc750b 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -36,7 +36,6 @@ #include "qdev-addr.h" #include "blockdev.h" #include "sysemu.h" -#include "block_int.h" /********************************************************/ /* debug Floppy devices */ @@ -83,7 +82,6 @@ typedef struct FDrive { uint8_t max_track; /* Nb of tracks */ uint16_t bps; /* Bytes per sector */ uint8_t ro; /* Is read-only */ - uint8_t media_changed; /* Is media changed */ } FDrive; static void fd_init(FDrive *drv) @@ -535,63 +533,16 @@ static CPUWriteMemoryFunc * const fdctrl_mem_write_strict[3] = { NULL, }; -static void fdrive_media_changed_pre_save(void *opaque) -{ - FDrive *drive = opaque; - - drive->media_changed = drive->bs->media_changed; -} - -static int fdrive_media_changed_post_load(void *opaque, int version_id) -{ - FDrive *drive = opaque; - - if (drive->bs != NULL) { - drive->bs->media_changed = drive->media_changed; - } - - /* User ejected the floppy when drive->bs == NULL */ - return 0; -} - -static bool fdrive_media_changed_needed(void *opaque) -{ - FDrive *drive = opaque; - - return (drive->bs != NULL && drive->bs->media_changed != 1); -} - -static const VMStateDescription vmstate_fdrive_media_changed = { - .name = "fdrive/media_changed", - .version_id = 1, - .minimum_version_id = 1, - .minimum_version_id_old = 1, - .pre_save = fdrive_media_changed_pre_save, - .post_load = fdrive_media_changed_post_load, - .fields = (VMStateField[]) { - VMSTATE_UINT8(media_changed, FDrive), - VMSTATE_END_OF_LIST() - } -}; - static const VMStateDescription vmstate_fdrive = { .name = "fdrive", .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField []) { VMSTATE_UINT8(head, FDrive), VMSTATE_UINT8(track, FDrive), VMSTATE_UINT8(sect, FDrive), VMSTATE_END_OF_LIST() - }, - .subsections = (VMStateSubsection[]) { - { - .vmsd = &vmstate_fdrive_media_changed, - .needed = &fdrive_media_changed_needed, - } , { - /* empty */ - } } }; -- cgit v1.2.3 From 4fbe5233fdaae22b96f9cd5a70351429fa91cce1 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 5 Aug 2011 12:06:11 +0200 Subject: qcow2: Fix L1 table size after bdrv_snapshot_goto When loading an internal snapshot whose L1 table is smaller than the current L1 table, the size of the current L1 would be shrunk to the snapshot's L1 size in memory, but not on disk. This lead to incorrect refcount updates and eventuelly to image corruption. Instead of writing the new L1 size to disk, this simply retains the bigger L1 size that is currently in use and makes sure that the unused part is zeroed. Signed-off-by: Kevin Wolf Tested-by: Philipp Hahn Signed-off-by: Anthony Liguori (cherry picked from commit 35d7ace74bd07e3d6983c1fd7cbfab4e11175689) --- block/qcow2-snapshot.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 74823a5eb..e32bcf084 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -317,7 +317,8 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id) { BDRVQcowState *s = bs->opaque; QCowSnapshot *sn; - int i, snapshot_index, l1_size2; + int i, snapshot_index; + int cur_l1_bytes, sn_l1_bytes; snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id); if (snapshot_index < 0) @@ -330,14 +331,19 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id) if (qcow2_grow_l1_table(bs, sn->l1_size, true) < 0) goto fail; - s->l1_size = sn->l1_size; - l1_size2 = s->l1_size * sizeof(uint64_t); + cur_l1_bytes = s->l1_size * sizeof(uint64_t); + sn_l1_bytes = sn->l1_size * sizeof(uint64_t); + + if (cur_l1_bytes > sn_l1_bytes) { + memset(s->l1_table + sn->l1_size, 0, cur_l1_bytes - sn_l1_bytes); + } + /* copy the snapshot l1 table to the current l1 table */ if (bdrv_pread(bs->file, sn->l1_table_offset, - s->l1_table, l1_size2) != l1_size2) + s->l1_table, sn_l1_bytes) < 0) goto fail; if (bdrv_pwrite_sync(bs->file, s->l1_table_offset, - s->l1_table, l1_size2) < 0) + s->l1_table, cur_l1_bytes) < 0) goto fail; for(i = 0;i < s->l1_size; i++) { be64_to_cpus(&s->l1_table[i]); -- cgit v1.2.3 From 76e4e1d23711750f777333654f13cf6baf8d01f1 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Mon, 8 Aug 2011 13:27:32 -0500 Subject: Update version to 0.15.0 Signed-off-by: Anthony Liguori --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dc82dfd47..a55105169 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.14.92 +0.15.0 -- cgit v1.2.3