Re: [Qemu-devel] [PATCH 29/34] ram: Use memory_region_test_and_clear_dirty

2012-12-20 Thread Eric Blake
On 12/19/2012 05:33 AM, Juan Quintela wrote: > This avoids having to do two walks over the dirty bitmap, once reading > the dirty bits, and anthoer cleaning them. s/anthoer/another/ -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvi

Re: [Qemu-devel] [PATCH 32/34] ram: refactor ram_save_block() return value

2012-12-20 Thread Eric Blake
ram_addr_t offset = last_offset; > bool complete_round = false; > -int bytes_sent = -1; > +int bytes_sent = 0; Are we guaranteed that we will never send more than 2G bytes in one call to this function, or should this be changed to int64_t? -- Eric Blake eblake redhat com+1-919

Re: [Qemu-devel] [PATCH 18/20] mirror: add support for persistent dirty bitmap

2012-12-20 Thread Eric Blake
as completed or not. > > Signed-off-by: Paolo Bonzini > --- > block/mirror.c | 15 +++ > 1 file changed, 15 insertions(+) Sure tiny for what it adds :) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization

Re: [Qemu-devel] [PATCH 19/20] block: choose the default dirty bitmap granularity in bdrv_enable_dirty_tracking

2012-12-20 Thread Eric Blake
lock.c | 46 +- > block.h | 3 ++- > block/mirror.c| 30 ++ > blockdev.c| 11 +-- > 5 files changed, 55 insertions(+), 37 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301

Re: [Qemu-devel] [PATCH 2/3] HMP: pass in parameter for info sub command

2012-12-21 Thread Eric Blake
and another that adds the 'table' argument to the function. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 20/20] monitor: add commands to start/stop dirty bitmap

2012-12-21 Thread Eric Blake
ularity argument must be absent You named it 'drive-mirror', not 'blockdev-drive-mirror'. > +# or equal to the active granularity. > +# > +# @device: the name of the device to track dirty blocks of > +# > +# @force: #optional true to immediately stop writ

Re: [Qemu-devel] [PATCH] qemu-ga: Extend guest-network-get-interfaces

2012-12-21 Thread Eric Blake
Since: 1.1 > +# Since: 1.1, @up, @loopback, @promisc, @multicast and @type since 1.3 1.4 > ## > { 'type': 'GuestNetworkInterface', >'data': {'name': 'str', > + 'up': 'bool', > + 'loopback': 'bool', > + 'promisc': 'bool', > + 'multicast': 'bool', > + '*type': 'GuestNetworkInterfaceType', Again, is this field optional? > '*hardware-address': 'str', > '*ip-addresses': ['GuestIpAddress'] } } > > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 3/6] snapshot: design of common API to take snapshots

2012-12-21 Thread Eric Blake
Again, prefer present tense (avoid 'were' in comments). > +/* async snapshot, not supported now */ > +typedef struct BlkTransactionStatesAsync { > +int reserved; > +} BlkTransactionStatesAsync; Why declare a struct if we aren't supporting it yet? -- Eric Blake eblake

[Qemu-devel] qemu-ga command listing

2012-12-31 Thread Eric Blake
Is there a guest-agent command for querying the list of available commands for a given guest agent? If not, should there be? In other words, I'm looking for the counterpart to QMP {"execute":"query-commands"}. -- Eric Blake eblake redhat com+1-919-301-3266 Libvi

Re: [Qemu-devel] [PATCH 5/6] snapshot: qmp interface

2013-01-02 Thread Eric Blake
drive the sequence of operations needed). blockdev-snapshot-sync would then be rewritten as a wrapper that calls the underlying sequence of operations in one command, blocking until complete. But for deletion, we might as well do it right from the beginning. I wonder if you can even design things to just have 'blockdev-snapshot-delete' without needing to distinguish between a sync or async operation. > +# > +# @device: the name of the device to delete the snapshot from. > +# > +# @snapshot-file: the target name of the snapshot. In external case, it is > +# the file's name to be merged, In internal case, it is the > +# internal snapshot record's name. > +# > +# @type: #optional internal snapshot or external, default is > +#'external', note that delete 'external' snapshot is not supported > +#now for that it is the same to commit it. Again, do you really need this field, or can it be inferred from snapshot-file? > +# > +# Returns: nothing on success > +# If @device is not a valid block device, DeviceNotFound > +# > +# Since 1.4 > +## > +{ 'command': 'blockdev-snapshot-delete-sync', > + 'data': { 'device': 'str', 'snapshot-file': 'str', > +'*type': 'SnapshotType'} } > > ## > # @human-monitor-command: > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [Bug 1025244] Re: qcow2 image increasing disk size above the virtual limit

2013-01-02 Thread Eric Blake
s. You might also want to try modifying step 5 to use the HMP delvm monitor command from within the running qemu rather than going behind qemu's back with a qemu-img invocation. That's how libvirt deletes internal snapshots from a running qemu. Also, there are patches currently under

[Qemu-devel] [PATCH] qga: add missing commas in json docs

2013-01-02 Thread Eric Blake
* qga/qapi-schema.json: Use valid JSON. Signed-off-by: Eric Blake --- qga/qapi-schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index ed0eb69..d91d903 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json

Re: [Qemu-devel] [RFC V4 30/30] qemu-iotests: Filter dedup=on/off so existing tests don't break.

2013-01-02 Thread Eric Blake
ch be hoisted earlier into the series, or even squashed in with the patch that introduced the temporary test failures? That is, you want 'git bisect' to pass on every patch in the series, rather than introducing problems in one patch that only get cleaned up in a later patch. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 01/11] qemu-img: remove unused parameter in collect_image_info()

2013-01-02 Thread Eric Blake
On 12/29/2012 01:45 AM, Wenchao Xia wrote: > Parameter *fmt was not used, so remove it. > > Signed-off-by: Wenchao Xia > --- > qemu-img.c |5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-91

Re: [Qemu-devel] [RFC V4 00/30] QCOW2 deduplication

2013-01-02 Thread Eric Blake
collisions, just to prove that you handle them correctly. De-duplicating collided data, while unlikely, is still a case of data loss that not everyone is happy to risk. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] qemu-ga command listing

2013-01-02 Thread Eric Blake
On 01/02/2013 01:34 PM, Jeff Cody wrote: > On Mon, Dec 31, 2012 at 01:41:57PM -0700, Eric Blake wrote: >> Is there a guest-agent command for querying the list of available >> commands for a given guest agent? If not, should there be? In other >> words, I'm looking

Re: [Qemu-devel] [PATCH 02/11] block: add bdrv_get_filename() function

2013-01-02 Thread Eric Blake
0 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 03/11] qemu-img: remove parameter filename in collect_image_info()

2013-01-03 Thread Eric Blake
gt; > diff --git a/qemu-img.c b/qemu-img.c > index 5a4df3a..d70435f 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -1180,15 +1180,17 @@ static void dump_json_image_info(ImageInfo *info) > QDECREF(str); > } > > +/* Assume bs is already openned. */ s/openned/o

Re: [Qemu-devel] [RFC V4 01/30] qcow2: Add deduplication to the qcow2 specification.

2013-01-03 Thread Eric Blake
gt; + > +cluster_size = 4096 > +dedup_block_size = 65536 > +l2_size = 65536 > + > +The 16 remaining bytes in each l2 deduplication blocks are set to zero and > +reserved for a future usage. ...and move this paragraph closer to the point where you mention the rounding up in size. > + > == Host cluster management == > > qcow2 manages the allocation of host clusters by maintaining a reference > count > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH] qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema

2013-01-25 Thread Eric Blake
On 01/25/2013 06:27 AM, Michal Privoznik wrote: > Currently, we are using 'tray_open' in QMP and 'tray-open' in > HMP. However, the QMP documentation was mistakenly using the > HMP version. > --- > qmp-commands.hx | 2 +- > 1 file changed, 1 insertion(+),

Re: [Qemu-devel] [PATCH] qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema

2013-01-25 Thread Eric Blake
08: '*tray_open': 'bool', '*io-status': > 'BlockDeviceIoStatus', > qapi-schema.json-709- '*dirty': 'BlockDirtyInfo' } } And since existing qemu versions output tray_open, we would be breaking API if we fixed the QMP to return tray-open (libvirt could cope with that API break by checking both spellings, but that feels dirty). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCHv3 1/2] qemu-img: find the highest offset in use during check

2013-01-25 Thread Eric Blake
On 01/21/2013 10:52 AM, Eric Blake wrote: > On 01/21/2013 10:03 AM, Kevin Wolf wrote: >> Am 21.01.2013 17:27, schrieb Eric Blake: >>> On 01/21/2013 07:25 AM, Federico Simoncelli wrote: >>>> This patch adds the support for reporting the highest offset in use by >&

Re: [Qemu-devel] [PATCH V5 03/13] block: add bdrv_can_read_snapshot() function

2013-01-25 Thread Eric Blake
drv_can_read_snapshot(BlockDriverState *bs) > +{ > +/* return whether internal snapshot can be write on @bs */ > int bdrv_can_snapshot(BlockDriverState *bs) I see you just copied existing code; but any reason why these functions return int instead of bool? Would that be worth a separate

Re: [Qemu-devel] [PATCH] block: Create proper size file for disk mirror

2013-01-25 Thread Eric Blake
the original has already been applied to the block branch, you are best off sending a separate patch for the test addition. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 00/57] target-i386 eflags cleanup and bmi/adx extensions

2013-01-25 Thread Eric Blake
ist your #ifdeffery earlier into the file, and then you can avoid #ifdefs inside the function body, and thus avoid the checkpatch complaints; plus you get the benefit of testing that the code for SOMETHING compiles cleanly even when SOMETHING is not defined. -- Eric Blake eblake redhat com

Re: [Qemu-devel] [PATCH 00/57] target-i386 eflags cleanup and bmi/adx extensions

2013-01-25 Thread Eric Blake
On 01/25/2013 11:40 AM, Richard Henderson wrote: > On 2013-01-25 10:16, Eric Blake wrote: >>> >Which is exactly the case for all three errors reported in this series. >>> >I know of no other good way to arrange this pattern. >> #ifdef SOMETHING >> # define S

Re: [Qemu-devel] [qemu-devel]The problem of QMP command getfd.

2013-01-28 Thread Eric Blake
t; qemu-char.c:unix_process_msgfd(). > Thanks a lot for your detailed explanation and suggestions. > I will look into the code to understand how it works. Additionally, using the 'getfd' command is not very robust; new code should be preferring to use the 'add-fd' command f

Re: [Qemu-devel] [PATCHv4 1/2] qemu-img: find the image end offset during check

2013-01-28 Thread Eric Blake
sions of sed. Better would be: '[0-9][0-9]*'. Then again, since you aren't anchoring the expression, you don't really care whether there was more than one digit; you still end up deleting the entire line. Thus, a simpler version would be: $QEMU_IMG check "$@" -f $IMGF

Re: [Qemu-devel] [PATCH V2 2/4] block: make path_hash_protocol public.

2013-01-28 Thread Eric Blake
uot;:" */ > -static int path_has_protocol(const char *path) > +int path_has_protocol(const char *path) > { While you are touching this function, does it make sense to change it to return 'bool' instead of 'int'? -- Eric Blake eblake redhat com+1-919-3

Re: [Qemu-devel] [PATCHv4 2/2] qemu-img: add json output option to the check command

2013-01-28 Thread Eric Blake
/qemu-devel/2013-01/msg03858.html But I guess Kevin was okay with it as one patch. Therefore: Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 1/2] qga: add guest-get-time command

2013-01-28 Thread Eric Blake
27;, > +'utc-offset': 'int' } } > + > +## > +# @guest-get-time: > +# > +# Get the information about host time in UTC and the s/host/guest/ > +# UTC offset. > +# > +# This command tries to get the host time which is > +# presumably correct, s

Re: [Qemu-devel] [PATCH 2/2] qga: add guest-set-time command

2013-01-28 Thread Eric Blake
{ 'command': 'guest-set-time', > + 'data': { '*seconds': 'int', '*microseconds': 'int', > +'*utc-offset': 'int' } } Why not just call out 'data': 'TimeInfo', especially if we make the time argument mandatory at this level? And see Anthony's comments on 1/2, that you really don't need utc-offset here; passing a single int64_t of nanoseconds relative to the Epoch in UTC, and forcing the guest to translate that according to the guest's time zone, does seem simpler on the protocol (maybe more work for the management app in generating the number to send over the protocol, and more work for the guest to interpret that number, but that's the engineering tradeoff for a simpler interface). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH] qemu-iotests: Test qcow2 image creation options

2013-01-29 Thread Eric Blake
"_cleanup; exit \$status" 0 1 2 3 15 > + > +# get standard environment, filters and checks > +. ./common.rc > +. ./common.filter > + > +_supported_fmt qcow2 > +_supported_proto file > +_supported_os Linux > + > +function test_qemu_img() ...bash-style declaration. I ge

Re: [Qemu-devel] [RFC V8 11/13] quorum: Add quorum_snapshot_img_create.

2013-01-29 Thread Eric Blake
ere, where the parser is actually implemented). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH V2 3/4] blockdev: Allow snapshoting of protocols.

2013-01-29 Thread Eric Blake
t of opening the quorum_, something like: quorum:2/3:file1[raw]:snap2.qcow2[qcow2]:snap3.qed[qed] or some such punctuation. And of course, that means you'd have to extend your escaping mechanism to allow escaping of whatever syntax you use for declaring a per-member format. -- Eric Blake eblake

Re: [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code

2013-01-29 Thread Eric Blake
} else { > -s->port = g_strdup(SD_DEFAULT_PORT); > -} > +s->host_spec = g_strdup_printf("%s:%d", uri->server ?: SD_DEFAULT_ADDR, > + uri->port ?: SD_DEFAULT_PORT); Is this going to properly handle IPv6 addresses, w

Re: [Qemu-devel] [PATCH v2] qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema

2013-01-29 Thread Eric Blake
> -add S-o-b line > > qmp-commands.hx | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/qmp-commands.hx b/qmp-commands.hx > index f58a841..f90efe5 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -1659,7

Re: [Qemu-devel] [PATCH] bitops: unify bitops_ffsl with the one in host-utils.h

2013-01-30 Thread Eric Blake
emu/host-utils.h | 25 - > util/hbitmap.c| 2 +- > 4 files changed, 16 insertions(+), 53 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 4/5] Disable XBZRLE during migrate to file if it is active

2013-01-30 Thread Eric Blake
ler. I'm not sure I buy this argument of XBZRLE being incompatible with migration to file, at least without not more explanation why it fails. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH v2] bitops: unify bitops_ffsl with the one in host-utils.h, using __builtin_ffsl

2013-01-30 Thread Eric Blake
*/ > static unsigned long bitops_ffsl(unsigned long word) > { > - int num = 0; > +#if QEMU_GNUC_PREREQ(3, 4) > +return __builtin_ffsl(word) + 1; Nope. The +1 is wrong (it was only needed when using __builtin_ctzl()). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH v2 1/5] Move XBZRLE encoding code to a separate file to allow testing

2013-01-30 Thread Eric Blake
3 files changed, 174 insertions(+), 160 deletions(-) > create mode 100644 xbzrle.c > > +++ b/xbzrle.c > @@ -0,0 +1,173 @@ > +/* > + * Xor Based Zero Run Length Encoding > + * > + * Copyright 2012 Red Hat, Inc. and/or its affiliates Is it worth adding 2013 now? -- Eric

Re: [Qemu-devel] [PATCH v2 2/5] Add XBZRLE testing

2013-01-30 Thread Eric Blake
contents of val on error? > + > +g_free(buf); If you make buf stack-local, you don't need to free it here. > +static void test_encode_decode_overflow(void) > +{ > +uint8_t *compressed = g_malloc0(PAGE_SIZE); > +uint8_t *test = g_malloc0(PAGE_SIZE); > + uint8_t *buff

Re: [Qemu-devel] [PATCH v2 3/5] Fix example for query-migrate-capabilities

2013-01-30 Thread Eric Blake
On 01/30/2013 04:41 AM, Orit Wasserman wrote: > Signed-off-by: Orit Wasserman > --- > qmp-commands.hx | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http:/

Re: [Qemu-devel] [PATCH v2 4/5] Allow XBZRLE encoding without enabling the capability

2013-01-30 Thread Eric Blake
vm.gz" > The user won't be able to load vm.gz and get an error. > > Signed-off-by: Orit Wasserman > --- > arch_init.c | 3 --- > 1 file changed, 3 deletions(-) Makes sense - be liberal in what you accept. Reviewed-by: Eric Blake -- Eric Blake eblake redhat

Re: [Qemu-devel] [PATCH v2 5/5] Fix error message in migrate_set_capability HMP command

2013-01-30 Thread Eric Blake
On 01/30/2013 04:41 AM, Orit Wasserman wrote: > Signed-off-by: Orit Wasserman > --- > hmp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org s

Re: [Qemu-devel] [PATCH] bitops: unify bitops_ffsl with the one in host-utils.h

2013-01-30 Thread Eric Blake
1; >> -} >> - return num; >> } > > This reimplementation appears to have an off by one error. > For example, on an input of 4, the old algorithm returns 2 > and this one returns 3. Ouch - you are right that the old implementation is indeed a ctz() inst

Re: [Qemu-devel] [PATCH V4 00/22] Multiqueue virtio-net

2013-01-31 Thread Eric Blake
On 01/31/2013 12:00 AM, Jason Wang wrote: > On 01/31/2013 02:29 AM, Eric Blake wrote: >> On 01/30/2013 04:12 AM, Jason Wang wrote: >> >>> With this changes, user could start a multiqueue virtio-net device through >>> >>> ./qemu -netdev tap,id=hn0,que

Re: [Qemu-devel] [PATCH v3 0/5] XBZRLE fixes

2013-01-31 Thread Eric Blake
he error in loading a guest from a compressed file with > XBZRLE by allowing encoding of XBZRLE without activating it. > Series: Reviewed-by: Eric Blake But see my comment in 1/5; I'm wondering if that can just be fixed by whoever applies the series. > Orit Wasserman (5): > M

Re: [Qemu-devel] [PATCH v3 1/5] Move XBZRLE encoding code to a separate file to allow testing

2013-01-31 Thread Eric Blake
lly, I would have written 2012-2013 - while this file is 2013 only, it comes from code that was first written in 2012. But I'm not sure it is worth a v4 just to fix this. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH V4 00/22] Multiqueue virtio-net

2013-01-31 Thread Eric Blake
wire up qemu_open() nor any need to use 'add-fd'. Okay, my question has been answered, your approach looks right now that I know more about how -netdev works to begin with. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH V4 RESEND 05/22] net: intorduce qemu_del_nic()

2013-02-01 Thread Eric Blake
gt; NiCState and NetClientState were not 1:1 in multiqueue. The following patches > would refactor this function to support multiqueue nic. > > Signed-off-by: Jason Wang > Signed-off-by: Michael S. Tsirkin > --- -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt

Re: [Qemu-devel] [PATCH V4 RESEND 15/22] tap: multiqueue support

2013-02-01 Thread Eric Blake
e through s/disabe/disable/ > TUNSETQUEUE. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC][PATCH]Add timestamp to error message

2013-02-01 Thread Eric Blake
ck a child process due to the non-safe use of a more naive timestamp generator), but I don't know if qemu suffers from the same restriction of when it has anything worth logging. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org

Re: [Qemu-devel] [PATCH v3] bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl

2013-02-01 Thread Eric Blake
bit are set. > */ > -static inline unsigned long ffz(unsigned long word) > +static inline unsigned long bitops_ctol(unsigned long word) Likewise; if we are changing this name, should we also change the return type to be signed? However, the wrong return type doesn't impact any of the

Re: [Qemu-devel] [PATCH v3] bitops: unify bitops_ffsl with the one in host-utils.h, call it bitops_ctzl

2013-02-02 Thread Eric Blake
undefined" [matches gcc builtin_ctz semantics] For all non-zero values of var, ffsl(var) == bitops_ctzl(var)+1. Extending the equivalency for var==0 makes the function usable in the most places. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH] bitops: unify bitops_flsl with host-utils.h, call it bitops_clzl

2013-02-04 Thread Eric Blake
| 2 +- > 3 files changed, 17 insertions(+), 31 deletions(-) Reviewed-by: Eric Blake > > diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h > index 8b88791..07ada63 100644 > --- a/include/qemu/bitops.h > +++ b/include/qemu/bitops.h > @@ -50,41 +50,27 @@ static un

Re: [Qemu-devel] [PATCH] linux-user: Support setgroups syscall with no groups

2013-02-04 Thread Eric Blake
if (!target_grouplist) { > -ret = -TARGET_EFAULT; > -goto fail; > +if (gidsetsize) { > +grouplist = alloca(gidsetsize * sizeof(gid_t)); Is this alloca() safe, or are you risking stack overflow if the user passes an

Re: [Qemu-devel] [PATCH] linux-user: Support setgroups syscall with no groups

2013-02-04 Thread Eric Blake
On 02/04/2013 02:07 PM, Peter Maydell wrote: > On 4 February 2013 18:38, Eric Blake wrote: >> On 02/02/2013 04:04 PM, dill...@dillona.com wrote: >>> - >>> -grouplist = alloca(gidsetsize * sizeof(gid_t)); >>> -target_grouplist = loc

Re: [Qemu-devel] [PATCH for-1.4 02/12] qmp: Clean up design of memchar-read

2013-02-05 Thread Eric Blake
return an error that the user's requested encoding is insufficient for the data that is trying to be read? At any rate, I agree with the idea of this patch in simplifying the API, and concur that we must solve it before 1.4 locks us in to a bad design. -- Eric Blake eblake redhat

Re: [Qemu-devel] [PATCH for-1.4 03/12] qmp: Clean up type usage in qmp_memchar_write(), qmp_memchar_read()

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Const-correctness, consistently use standard C types instead of mixing > them with GLib types. > > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Re

Re: [Qemu-devel] [PATCH for-1.4 01/12] qmp: Fix design bug and read beyond buffer in memchar-write

2013-02-05 Thread Eric Blake
SON is not a valid base64-encoded string? Does g_base64_decode report an error in that case, and should you be handling the error here? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH for-1.4 04/12] qmp: Plug memory leaks in memchar-write, memchar-read

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 5 + > 1 file changed, 5 insertions(+) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org s

Re: [Qemu-devel] [PATCH for-1.4 05/12] qmp: Drop superfluous special case "empty" in qmp_memchar_read()

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 4 > 1 file changed, 4 deletions(-) Reviewed-by: Eric Blake > > diff --git a/qemu-char.c b/qemu-char.c > index 9bf53e0..036ca2c 100644 > --- a/qemu-ch

Re: [Qemu-devel] [PATCH 1/5] qcow2: introduce check_refcounts_l1/l2() flags

2013-02-05 Thread Eric Blake
fect semantics, and I assume checkpatch.pl isn't calling out either case of potentially unusual spacing, you are free to use this whether or not you make a reindentation change: Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 2/5] qcow2: record fragmentation statistics during check

2013-02-05 Thread Eric Blake
ed. > > Signed-off-by: Stefan Hajnoczi > --- > block/qcow2-refcount.c | 25 - > 1 file changed, 24 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake > @@ -963,6 +965,17 @@ static int check_refcounts_l2(BlockDriverState *bs, > BdrvCheckRe

Re: [Qemu-devel] [PATCH for-1.4 06/12] qmp: Drop wasteful zero-initialization in qmp_memchar_read()

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http:/

Re: [Qemu-devel] [PATCH 3/5] qemu-img: avoid excessive BlockFragInfo line length

2013-02-05 Thread Eric Blake
s beneficial to > straighten out this code before modifying it. > > Signed-off-by: Stefan Hajnoczi > --- > qemu-img.c | 12 +++- > 1 file changed, 7 insertions(+), 5 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Li

Re: [Qemu-devel] [PATCH 4/5] qemu-img: add compressed clusters to BlockFragInfo

2013-02-05 Thread Eric Blake
ere found on the image./' I think I've mentioned this on other pending patches that touch this same function... /me goes looking https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg05364.html 'grep -v | sed' is slightly inefficient compared to: sed -e '/compressed$/d' \

Re: [Qemu-devel] [PATCH for-1.4 07/12] qemu-char: Fix chardev "memory" not to drop IAC characters

2013-02-05 Thread Eric Blake
On 02/05/2013 09:22 AM, Markus Armbruster wrote: > Undocumented misfeature, get rid of it while we can. > > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 5 - > 1 file changed, 5 deletions(-) Reviewed-by: Eric Blake > > diff --git a/qemu-char.c b/qem

Re: [Qemu-devel] [PATCH 5/5] qcow2: support compressed clusters in BlockFragInfo

2013-02-05 Thread Eric Blake
refcount.c > +++ b/block/qcow2-refcount.c > @@ -968,6 +968,7 @@ static int check_refcounts_l2(BlockDriverState *bs, > BdrvCheckResult *res, > > if (flags & CHECK_FRAG_INFO) { > res->bfi.allocated_clusters++; > + res->bfi.com

Re: [Qemu-devel] [PATCH for-1.4 08/12] qemu-char: Drop undocumented chardev "memory" compatibility syntax

2013-02-05 Thread Eric Blake
ed, 5 deletions(-) Reviewed-by: Eric Blake We can always add shorthand later, if it turns out to be popular; but we can't take shorthand away once it is added, so I agree with being conservative on the first release by having no shorthand. -- Eric Blake eblake redhat com+1-919-301

Re: [Qemu-devel] [PATCH for-1.4 09/12] qemu-char: Redo chardev "memory" size configuration

2013-02-05 Thread Eric Blake
x | 11 --- > 2 files changed, 9 insertions(+), 13 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH for-1.4 11/12] qmp: Use generic errors in memchar-read, memchar-write

2013-02-05 Thread Eric Blake
> 2 files changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH for-1.4 12/12] QAPI QMP HMP: Fix and improve memchar-read/-write docs

2013-02-05 Thread Eric Blake
+Read up to @var{size} bytes from memory character device @var{device}. > +Bug: can screw up when the buffer contains invalid UTF-8 sequences, > +NUL characters, after the ring buffer lost data, and when reading > +stops because the size limit is reached. Fair enough for 1.4 since w

Re: [Qemu-devel] [PATCH for-1.4 10/12] qemu-char: General chardev "memory" code cleanup

2013-02-05 Thread Eric Blake
here. > > Signed-off-by: Markus Armbruster > --- > qemu-char.c | 31 --- > 1 file changed, 12 insertions(+), 19 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features

2013-02-05 Thread Eric Blake
of > + * 'container'. > + */ > +#define endof(container, field) \ > +(intptr_t)(&(((container *)0)->field)+1) Insufficient (); should be: ((intptr_t)(&(((container *)0)->field)+1)) -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualizat

Re: [Qemu-devel] [PATCH v2 3/5] qemu-img: avoid excessive BlockFragInfo line length

2013-02-06 Thread Eric Blake
yet have a way to force JSON output to get at the same information, arbitrarily changing the output format may break some existing user that is scraping the output. It would be nice if we had access to this output information in a more stable format. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH v2 0/5] qcow2: add fragmentation and compression info support

2013-02-06 Thread Eric Blake
just "compressed" to "compressed > clusters" [eblake] > * Improve grep and sed usage in common.rc [eblake] > * Introduce sector_offset local variable for & ~511 [eblake] > * Improve nb_csectors rounding down explanation in comment [eblake] Thanks; from my

Re: [Qemu-devel] [PATCH 4/5] qemu-img: add compressed clusters to BlockFragInfo

2013-02-06 Thread Eric Blake
And if a line doesn't apply to the given image > (format), it's just left out. > > Kevin > > > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH v2 3/5] qemu-img: avoid excessive BlockFragInfo line length

2013-02-06 Thread Eric Blake
o rework the human output however we'd like. But even if we don't get JSON added in time for 1.4, I don't think it is the end of the world for this particular use case. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V6 01/33] qcow2: Add deduplication to the qcow2 specification.

2013-02-06 Thread Eric Blake
tiple > clusters, however it must be contiguous in the image file. L2 tables are > -exactly one cluster in size. > +exactly one cluster in size excepted for the deduplication case. s/size excepted/size; except/ s/case./case, where clusters are fixed at 4k and the L2 table is fixed at 64

Re: [Qemu-devel] [RFC V6 03/33] qcow2: Add deduplication structures and fields.

2013-02-06 Thread Eric Blake
cent to it). > +/* deduplication node */ > +typedef struct { > +QCowHash hash; > +uint64_t physical_sect; /* where the cluster is stored on disk */ > +uint64_t first_logical_sect; /* logical sector of the first occurence of s/occurence/occurrence/ -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V6 05/33] qcow2: Make update_refcount public.

2013-02-06 Thread Eric Blake
int qcow2_check_refcounts(BlockDriverState *bs, BdrvCheckResult *res, >BdrvCheckMode fix); > +int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, > +int64_t offset, int64_t length, int addend); Indentation is off (second line should start after the '(' of the first

Re: [Qemu-devel] [RFC V6 08/33] qcow2: Add qcow2_dedup_store_new_hashes.

2013-02-06 Thread Eric Blake
+/* Remember that this QCowHashNoderepresent the first occurence of the s/QCowHashNoderepresent/QCowHashNode represents/ s/occurence/occurrence/ > + * cluste so we will be able to clear QCOW_OFLAG_COPIED from the L2 table s/cluste/cluster/ -- Eric Blake eblake redhat com+1-919-301-3266

Re: [Qemu-devel] [RFC V6 04/33] qcow2: Add qcow2_dedup_read_missing_and_concatenate

2013-02-06 Thread Eric Blake
with qemu_blockalign() instead of the more typical malloc() or glib functions, you should document that the caller is responsible to use qemu_vfree() to clean up data on success. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH for-1.4 v2 00/13] Rework ring buffer chardev before API calcifies

2013-02-06 Thread Eric Blake
On 02/06/2013 01:27 PM, Markus Armbruster wrote: > We have a serious design bug in memchar-write [PATCH 01], and a less > serious one in memchar-read [PATCH 02]. I really, really want them > fixed before the API gets calcified by the release. Series: Reviewed-by: Eric Blake -- E

Re: [Qemu-devel] [RFC V2 11/16] qcow2: Count deduplication refcount overflow metric.

2013-02-07 Thread Eric Blake
ram so we won't use it anymore for dedup > */ > qcow2_remove_hash_node(bs, hash_node); > +s->dedup_metrics.refcount_overflows++; > } > > bool qcow2_dedup_is_running(BlockDriverState *bs) > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V2 12/16] qapi: Add support for deduplication infos in qapi-schema.json.

2013-02-07 Thread Eric Blake
uplicated-clusters: Number of clusters which where not > deduplicated. That's long; would it be any better calling it: @unique-clusters: Number of clusters found to be unique. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V2 5/7] qcow2: Add qcow2_dedup_control.

2013-02-07 Thread Eric Blake
ol exit; Naming local variables that shadow global functions is risky. I don't know if qemu has a policy on being clean under -Wshadow, but this would fail such a policy. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V6 25/33] qcow2: Serialize write requests when deduplication is activated.

2013-02-07 Thread Eric Blake
On 02/06/2013 05:31 AM, BenoƮt Canet wrote: > This fix the sub cluster sized writes race conditions while waiting s/fix/fixes/ > for a more faster solution. s/more// Would it be worth describing the race condition in more detail? -- Eric Blake eblake redhat com+1-919-301-3266 L

Re: [Qemu-devel] [RFC V2 14/16] qcow2: Add qcow2_dedup_update_metrics to compute dedup RAM usage.

2013-02-07 Thread Eric Blake
sync with the actual struct used by the version of glib that you are linked with? Would it be better to propose that upstream glib add a new function for getting memory usage of an opaque hash object, and that qemu merely omit the memory usage statistic when linked with an older version of glib t

Re: [Qemu-devel] [PATCH v3 0/5] qcow2: add fragmentation and compression info support

2013-02-07 Thread Eric Blake
27; in qemu-img check output [kwolf] > * Count compressed clusters as fragmented, explained in comment [kwolf] Series: Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V6 32/33] qemu-iotests: Filter dedup=on/off so existing tests don't break.

2013-02-07 Thread Eric Blake
hould be squashed in with the patch that caused the output to change, so that 'git bisect' won't find any test failures no matter which patch it lands on. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V2 7/7] qmp: Add block-dedup-control.

2013-02-07 Thread Eric Blake
message would hopefully explain why. > +SQMP > +block-dedup-control > + > + > +Start or stop the deduplication on a device that support it. s/support/supports/ -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [RFC V6 00/33] QCOW2 deduplication core functionality

2013-02-08 Thread Eric Blake
ow. You probably also want to mention what happens when one of the clusters that previously map to a common hash is then modified, because it requires updating the lookup tables to reflect the new hash and a possible change in first logical offset associated with the old hash. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 0/4] Add subcommand compare for qemu-img

2013-02-08 Thread Eric Blake
into the documentation > - minor non-functional changes > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 2/4] qemu-img: Add "Quiet mode" option

2013-02-08 Thread Eric Blake
commands only) > +@item -q > +Quiet mode - do not print any output (except errors). There's no progress bar > +in case both @var{-q} and @var{-p} options are used. But at least your documentation matches your code, so I guess I can live with your choice that -q is always more powerful than -p, no matter what order they appear in. You have an extra space before the second @var. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH 4/4] qemu-iotests: Add qemu-img compare test

2013-02-08 Thread Eric Blake
s/048 > new file mode 100755 > index 000..1264446 > --- /dev/null > +++ b/tests/qemu-iotests/048 > @@ -0,0 +1,77 @@ > +#!/bin/bash > +## > +## qemu-img compare test > +## > +## > +## Copyright (C) 2009 Red Hat, Inc. It's 2013 (prior years can be listed also, if y

Re: [Qemu-devel] [PATCH 3/4] This patch adds new qemu-img subcommand that compares content of two disk images.

2013-02-08 Thread Eric Blake
L possible exits, rather than prose about success and table for failure, as in: 0 - images are identical 1 - images differ 2 - error opening an image 3 - error checking sector allocation 4 - error reading from an image Isn't failure to determine sector allocation a subset of failure to read from an image? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH V21 1/7] Support for TPM command line options

2013-02-08 Thread Eric Blake
arameters are present depends on which model was in use? That is, if we add a new model that uses a new field, would it be better to have a union type, something like: { 'type': 'TPMTis', 'data': {'path':'str', '*cancel-path':'str'

<    1   2   3   4   5   6   7   8   9   10   >