From e8ef31a3518c7b1e63a804fe8cecd3e94418db84 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Wed, 31 Jul 2013 14:22:07 +0400 Subject: [PATCH 1/4] qemu-ga: build it even if !system Move qemu-ga build check out of if softmmu.. into its own section. We want to build qemu-ga for _guest_ even if system build isn't done. It is controlled separately using --enable-guest-agent. Additionally, give error message if guest agent is requested but not supported. Signed-off-by: Michael Tokarev --- configure | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/configure b/configure index f0761ea862..293f1677e6 100755 --- a/configure +++ b/configure @@ -231,7 +231,7 @@ libusb="" usb_redir="" glx="" zlib="yes" -guest_agent="yes" +guest_agent="" want_tools="yes" libiscsi="" coroutine="" @@ -3444,10 +3444,15 @@ if test "$softmmu" = yes ; then virtfs=no fi fi +fi +if [ "$guest_agent" != "no" ]; then if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then - if [ "$guest_agent" = "yes" ]; then tools="qemu-ga\$(EXESUF) $tools" - fi + guest_agent=yes + elif [ "$guest_agent" != yes ]; then + guest_agent=no + else + error_exit "Guest agent is not supported on this platform" fi fi From f5075224d6e7fe8cae7e3c1b52a6d0f7bd3533d0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 31 Jul 2013 22:20:26 +0100 Subject: [PATCH 2/4] block/iscsi.c: Fix printf format error. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error on armv7hl was: block/iscsi.c: In function ‘is_request_lun_aligned’: block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=] iscsilun->block_size, sector_num, nb_sectors); ^ This also splits the long line to comply with qemu coding guidelines. Signed-off-by: Richard W.M. Jones Reviewed-by: Stefan Weil Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- block/iscsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index 5f28c6a2ea..e7c1c2b538 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -247,7 +247,9 @@ static bool is_request_lun_aligned(int64_t sector_num, int nb_sectors, { if ((sector_num * BDRV_SECTOR_SIZE) % iscsilun->block_size || (nb_sectors * BDRV_SECTOR_SIZE) % iscsilun->block_size) { - error_report("iSCSI misaligned request: iscsilun->block_size %u, sector_num %ld, nb_sectors %d", + error_report("iSCSI misaligned request: " + "iscsilun->block_size %u, sector_num %" PRIi64 + ", nb_sectors %d", iscsilun->block_size, sector_num, nb_sectors); return 0; } From 437de2adc633ed28cdd84bcdffc3430b5ce96be6 Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 1 Aug 2013 10:55:30 +0300 Subject: [PATCH 3/4] memory.c: drop kvm.h dependency memory.c does not use any kvm specific interfaces, don't include kvm.h Signed-off-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- memory.c | 1 - 1 file changed, 1 deletion(-) diff --git a/memory.c b/memory.c index ac6f3c6a19..886f838951 100644 --- a/memory.c +++ b/memory.c @@ -18,7 +18,6 @@ #include "exec/ioport.h" #include "qemu/bitops.h" #include "qom/object.h" -#include "sysemu/kvm.h" #include "trace.h" #include From 8e50724313895a87057cc243ad805f2eb21feb9f Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Thu, 1 Aug 2013 18:12:17 +0800 Subject: [PATCH 4/4] vmdk: fix comment for vmdk_co_write_zeroes The comment was truncated. Add the missing parts, especially explain why we need zero_dry_run. Signed-off-by: Fam Zheng Signed-off-by: Michael Tokarev --- block/vmdk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 3756333c60..e6c50b1e35 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1200,8 +1200,10 @@ static coroutine_fn int vmdk_co_read(BlockDriverState *bs, int64_t sector_num, /** * vmdk_write: * @zeroed: buf is ignored (data is zero), use zeroed_grain GTE feature - * if possible, otherwise return -ENOTSUP. - * @zero_dry_run: used for zeroed == true only, don't update L2 table, just + * if possible, otherwise return -ENOTSUP. + * @zero_dry_run: used for zeroed == true only, don't update L2 table, just try + * with each cluster. By dry run we can find if the zero write + * is possible without modifying image data. * * Returns: error code with 0 for success. */ @@ -1328,6 +1330,8 @@ static int coroutine_fn vmdk_co_write_zeroes(BlockDriverState *bs, int ret; BDRVVmdkState *s = bs->opaque; qemu_co_mutex_lock(&s->lock); + /* write zeroes could fail if sectors not aligned to cluster, test it with + * dry_run == true before really updating image */ ret = vmdk_write(bs, sector_num, NULL, nb_sectors, true, true); if (!ret) { ret = vmdk_write(bs, sector_num, NULL, nb_sectors, true, false);