Re: [Qemu-devel] [PATCH v4 15/21] block: return BDRV_BLOCK_ZERO past end of backing file

2013-08-29 Thread Eric Blake
-) 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 v4 16/21] qemu-img: add a "map" subcommand

2013-08-29 Thread Eric Blake
quot; \"zero\": %s, \"data\": %s", > + (e->start == 0 ? "[" : ",\n"), Here, e->start==0 will always be present, even when unallocated (since you don't elide any blocks, and the logical data always starts at 0). > + &

Re: [Qemu-devel] [PATCH v2 1/2] qcow2-refcount: Snapshot update for zero clusters

2013-08-30 Thread Eric Blake
ate *bs, > } > > for(j = 0; j < s->l2_size; j++) { > +uint64_t cluster_index; As long as you're touching this code, it might be worth s/for(/for (/ in the line above. Reviewed-by: Eric Blake -- Eric Blake eblake re

Re: [Qemu-devel] [PATCH v2 2/2] qemu-iotests: Snapshotting zero clusters

2013-08-30 Thread Eric Blake
iotests/062 | 64 > > tests/qemu-iotests/group | 1 + > 2 files changed, 65 insertions(+) > create mode 100755 tests/qemu-iotests/062 ACK. -- 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 2/2] qemu-iotests: Snapshotting zero clusters

2013-08-30 Thread Eric Blake
On 08/30/2013 07:07 AM, Eric Blake wrote: > On 08/30/2013 02:36 AM, Max Reitz wrote: >> This test creates an image with unallocated zero clusters, then creates >> a snapshot. Afterwards, there should be neither any errors nor leaks. >> >> Signed-off-by: Max Reitz >&g

Re: [Qemu-devel] [PATCH v2 2/2] qemu-iotests: Snapshotting zero clusters

2013-08-30 Thread Eric Blake
On 08/30/2013 07:08 AM, Eric Blake wrote: > On 08/30/2013 07:07 AM, Eric Blake wrote: >> On 08/30/2013 02:36 AM, Max Reitz wrote: >>> This test creates an image with unallocated zero clusters, then creates >>> a snapshot. Afterwards, there should be neither any errors no

Re: [Qemu-devel] [PATCH v4 2/8] qcow2: Metadata overlap checks

2013-08-30 Thread Eric Blake
uot;, > +[QEVENT_BLOCK_IMAGE_CORRUPTED] = "BLOCK_IMAGE_CORRUPTED", > }; You are missing documentation for this new event. Please provide a followup patch to qmp-events.txt. -- 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 V7 4/5] block: Add support for throttling burst max in QMP and the command line.

2013-08-30 Thread Eric Blake
ool is empty. > > Signed-off-by: Benoit Canet > --- > +++ b/qapi-schema.json > @@ -785,6 +785,18 @@ > # > # @image: the info of image used (since: 1.6) > # > +# @bps_max: #optional total max in bytes (Since 1.7) We don't have a consistent style, but at least the infor

Re: [Qemu-devel] [PATCH V7 5/5] block: Add iops_size to do the iops accounting for a given io size.

2013-08-30 Thread Eric Blake
containing > the following: > - "filename": image file name (json-string) > @@ -1851,6 +1854,7 @@ Example: > "iops_max": "0", > "iops_rd_max": "0", > &quo

Re: [Qemu-devel] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Eric Blake
emu-img convert -n - convert without creation > +# > +# Copyright (C) 2009 Red Hat, Inc. Where have you been the last 4 years? I could understand a range of years, if this test borrows significantly from another file that old, but I suspect that just 2013 is probably more accurate. Fix that, and you can add: 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] [PATCHv5] add qemu-img convert -n option (skip target volume creation)

2013-08-30 Thread Eric Blake
in there > particularly for such a meagre bit of code, but I suppose most > accurate would be: > > (c) 2009 Red Hat, Inc. > (c) 2013 Alex Bligh Yes, that looks like the best approach. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

[Qemu-devel] [PATCH] qmp: fix integer usage in examples

2013-08-30 Thread Eric Blake
* qmp-commands.hx (block_set_io_throttle): Use correct type. Signed-off-by: Eric Blake --- Noticed while reviewing Benoît's series of "Continuous Leaky Bucket Throttling" - depending on whose patch goes in first, the other will have to rebase... qmp-commands.hx | 12 +

Re: [Qemu-devel] [PATCH V8 4/5] block: Add support for throttling burst max in QMP and the command line.

2013-08-30 Thread Eric Blake
epending on whether my patch[1] goes in first, fix this to use '0' instead of '"0"'. [1] still waiting for it to hit https://lists.gnu.org/archive/html/qemu-devel/2013-08/threads.html, but message id <1377891353-10682-1-git-send-email-ebl...@redhat.com> [PATCH] qmp: fix integer usage in examples -- 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 V8 4/5] block: Add support for throttling burst max in QMP and the command line.

2013-08-30 Thread Eric Blake
impacted by a > patch was bad so I changed only this one. The funny thing is that it propagate > the scope of the patch. Indeed, which is why I don't mind respinning my patch to do ALL the cleanup in one go, as it's own patch series. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

[Qemu-devel] [PATCHv2] qmp: fix integer usage in examples

2013-08-30 Thread Eric Blake
Per the qapi schema, block_set_io_throttle takes most arguments as ints, not strings. * qmp-commands.hx (block_set_io_throttle): Use correct type. Fix whitespace and a copy-paste bug in the process. Signed-off-by: Eric Blake --- v2: also touch up the doc comments qmp-commands.hx | 26

Re: [Qemu-devel] [PATCH] qapi-types.py: Fix enum struct sizes on i686

2013-08-31 Thread Eric Blake
386 -S -nodefaults -nographic -M none -qmp stdio > > https://bugs.launchpad.net/qemu/+bug/1219207 > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Cole Robinson > --- > scripts/qapi-types.py | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > Review

Re: [Qemu-devel] [PATCH] qmp: Documentation for BLOCK_IMAGE_CORRUPTED

2013-09-03 Thread Eric Blake
event name, so this belongs between BALLOON_CHANGE and BLOCK_IO_ERROR. As sorting is trivial, you can add this to your v2: 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] public key not found?

2013-09-04 Thread Eric Blake
http://keys.fedoraproject.org or https://keys.fedoraproject.org HKP (keyserver protocol) by doing "gpg --keyserver keys.fedoraproject.org --recv-keys 0x110810E9" (just an example) You could also put in ~/.gnupg/gpg.conf: keyserver hkp://keys.fedoraproject.org -- 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/3] block: Additional info string in ImageInfo and BDI

2013-09-05 Thread Eric Blake
where the additional information is a union type discriminated by the image, so that we have full structure of the information being returned rather than just an ad-hoc blobbed string. Please rework this so that QMP clients like libvirt can easily probe what compat mode a qcow2 image uses, without having to parse a free-form string. -- 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 v3] async: aio_context_new(): Handle event_notifier_init failure

2014-09-16 Thread Eric Blake
tic void test_cancel(void) > int main(int argc, char **argv) > { > int ret; > +Error *local_error; > > init_clocks(); > > -ctx = aio_context_new(); > +ctx = aio_context_new(&local_error); > +if (!ctx) { > +error_report("Failed to create AIO Context: \'%s\'", Use of \' inside "" is unusual. (Multiple times in your 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 0/3] Fix confused output for alias properties

2014-09-16 Thread Eric Blake
str (Ethernet 6-byte MAC Address, format: AA:BB:CC:DD:EE:FF) Isn't this output only available under -help? Libvirt only cares about QMP listings of devices and their properties, so improving the human interface should have no negative impact to the machine interface. -- Eric Blake eblake redhat

Re: [Qemu-devel] [PATCH 0/3] Fix confused output for alias properties

2014-09-17 Thread Eric Blake
On 09/16/2014 11:54 PM, Markus Armbruster wrote: > Eric Blake writes: > >> On 09/16/2014 12:31 PM, Paolo Bonzini wrote: >> >>>> Change legacy_name to point to a detailed human-readable >>>> description of the type? >>>> E.g. "Ethernet

Re: [Qemu-devel] [PATCH v3] async: aio_context_new(): Handle event_notifier_init failure

2014-09-17 Thread Eric Blake
On 09/17/2014 03:16 AM, Chrysostomos Nanakos wrote: > On 09/16/2014 10:40 PM, Eric Blake wrote: >> On 09/16/2014 12:04 PM, Chrysostomos Nanakos wrote: >>> If event_notifier_init fails QEMU exits without printing >>> any error information to the user. This commit a

Re: [Qemu-devel] [PATCH v4] async: aio_context_new(): Handle event_notifier_init failure

2014-09-17 Thread Eric Blake
hen sending a single patch, omit the cover letter entirely, and stick what would have been the cover letter after the --- of the lone 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] migration: qemu-coroutine-lock.c:141: qemu_co_mutex_unlock: Assertion `mutex->locked == 1' failed

2014-09-17 Thread Eric Blake
on the source has cancelled/completed > before the guest is resumed on the destination. So I think there is > still a bug, maybe Eric can verify this? You may indeed be correct that libvirt is not waiting long enough for the block job to be gone on the source before resuming on the destination.

Re: [Qemu-devel] [PATCH v2 2/4] qapi: dealloc visitor, implement visit_start_union

2014-09-17 Thread Eric Blake
tions(+) > The comment helps. 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 v2 3/4] tests: add QMP input visitor test for unions with no discriminator

2014-09-17 Thread Eric Blake
t, which can lead to attempts to free random chunks of heap > memory. > > Cc: qemu-sta...@nongnu.org > Reviewed-by: Eric Blake > Reviewed-by: Paolo Bonzini > Signed-off-by: Michael Roth > --- > tests/qapi-schema/qapi-schema-test.json | 10 ++ > tests

Re: [Qemu-devel] [PATCH v2 1/4] qapi: add visit_start_union and visit_end_union

2014-09-17 Thread Eric Blake
mu-sta...@nongnu.org > Reported-by: Fam Zheng > Suggested-by: Paolo Bonzini > Reviewed-by: Paolo Bonzini > Signed-off-by: Michael Roth > --- Reviewed-by: Eric Blake > > +bool visit_start_union(Visitor *v, bool data_present, Error **errp) > +{ > +if (v->start_

Re: [Qemu-devel] [PATCH] qga: Fix possible freed memory accessing

2014-09-18 Thread Eric Blake
for (;;) { > if (readdir_r(dir, &entry, &result) != 0) { Eww. We're using readdir_r? That's an inherently broken interface, which can risk buffer overflow. readdir should be preferred. http://austingroupbugs.net/view.php?id=696 -- Eric Blake eblake redhat com+

Re: [Qemu-devel] [PATCH] pci-hotplug-old: avoid lossing error message

2014-09-18 Thread Eric Blake
r_report/Use error_report to/ > report it. > > Cc: Markus Armbruster > Signed-off-by: Gonglei > --- > hw/pci/pci-hotplug-old.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > With the commit message improved, Reviewed-by: Eric Blake -- Eric Blake eblake r

Re: [Qemu-devel] [PATCH] block: Catch simultaneous usage of options and their aliases

2014-09-18 Thread Eric Blake
gt; tests/qemu-iotests/051.out | 45 + > 3 files changed, 99 insertions(+), 15 deletions(-) Reviewed-by: Eric Blake > > -static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to) > +static void qemu_opt_rename(

Re: [Qemu-devel] [PATCH v2] pci-hotplug-old: avoid lossing error message

2014-09-18 Thread Eric Blake
On 09/18/2014 03:13 AM, arei.gong...@huawei.com wrote: > From: Gonglei > > When scsi_bus_legacy_add_drive() produce error, > we will loss error message. Using error_report > report it. Same typos/grammar issues as I flagged on v1. -- Eric Blake eblake redhat com+1-919-3

Re: [Qemu-devel] [PATCH] qga: Fix possible freed memory accessing

2014-09-18 Thread Eric Blake
On 09/18/2014 06:42 AM, zhanghailiang wrote: > On 2014/9/18 20:17, Eric Blake wrote: >> On 09/17/2014 09:33 PM, zhanghailiang wrote: >>> If readdir_r fails, error_setg_errno will reference the freed >>> pointer *dirpath*. >>> >>> Signed-off-by: zhan

Re: [Qemu-devel] [PATCH 1/6] block/qapi: Add cache information to query-block

2014-09-18 Thread Eric Blake
t to me as well; I'm fine with either, although I have a slight preference for just documenting on BlockdevCacheOptions that members are optional on input but will all be present when generated as output. -- 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 v3] pci-hotplug-old: avoid lossing error message

2014-09-18 Thread Eric Blake
; Signed-off-by: Gonglei > Reviewed-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > v3: > fix some typos/grammar issues (Eric) and add 'R-by' tag some but not all :) But I'm okay keeping my R-by. -- Eric Blake eblake redhat com+1-919-301-

Re: [Qemu-devel] [PATCH] ivshmem: use error_report

2014-09-18 Thread Eric Blake
} else if ((fd = shm_open(s->shmobj, O_CREAT|O_RDWR, > S_IRWXU|S_IRWXG|S_IRWXO)) < 0) { > -fprintf(stderr, "ivshmem: could not open shared file\n"); > +error_report("could not open shared file\n"); >

[Qemu-devel] [PATCH v4 00/19] drop qapi nested structs

2014-09-19 Thread Eric Blake
t from scratch anyways :) v3: No code changes, but fix mis-send of 11-14 [Peter] v2: New patches: 1-2, 5-9 consistent TAB usage in Makefile [Fam] catch more bad coding constructs, and test them avoid code duplication in type validity checks (patch 14 [former 7] is simpler beca

[Qemu-devel] [PATCH v4 09/19] qapi: Add tests of redefined expressions

2014-09-19 Thread Eric Blake
n things up and adjust the testsuite to match. Signed-off-by: Eric Blake --- tests/Makefile | 3 ++- tests/qapi-schema/redefined-builtin.err | 0 tests/qapi-schema/redefined-builtin.exit | 1 + tests/qapi-schema/redefined-builtin.json | 2 ++ tests/qapi-schema/redefi

[Qemu-devel] [PATCH v4 10/19] qapi: Better error messages for duplicated expressions

2014-09-19 Thread Eric Blake
I code. Signed-off-by: Eric Blake --- scripts/qapi.py | 71 +--- tests/qapi-schema/redefined-builtin.err | 1 + tests/qapi-schema/redefined-builtin.exit | 2 +- tests/qapi-schema/redefined-builtin.json | 2 +- tests/qapi-schema/redefined-bu

[Qemu-devel] [PATCH v4 03/19] qapi: Update docs given recent event, spacing fixes

2014-09-19 Thread Eric Blake
yet, which feels rather stale. Signed-off-by: Eric Blake --- docs/qapi-code-gen.txt | 100 +++-- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index a6197a9..8313ba6 100644 --- a/docs

[Qemu-devel] [PATCH v4 05/19] qapi: Add some enum tests

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator doesn't deal well with enums that aren't up to par. Later patches will update the expected results as the generator is made stricter. Signed-off-by: Eric Blake --- tests/Makefile | 5 - tests/qapi-schema/enum-clash-

[Qemu-devel] [PATCH v4 04/19] qapi: Document type-safety considerations

2014-09-19 Thread Eric Blake
Go into more details about the various types of valid expressions in a qapi schema, including tweaks to document fixes being done later in the current patch series. Signed-off-by: Eric Blake --- docs/qapi-code-gen.txt | 249 ++--- 1 file changed, 217

[Qemu-devel] [PATCH v4 07/19] qapi: Add some expr tests

2014-09-19 Thread Eric Blake
message quality is improved). Signed-off-by: Eric Blake --- tests/Makefile | 4 +++- tests/qapi-schema/bad-type-dict.err | 0 tests/qapi-schema/bad-type-dict.exit| 1 + tests/qapi-schema/bad-type-dict.json| 2 ++ tests/qapi-schema/bad-type-dict.out | 3

[Qemu-devel] [PATCH v4 02/19] qapi: Ignore files created during make check

2014-09-19 Thread Eric Blake
After an in-tree build and run of 'make check-{qapi-schema,unit}', I noticed some leftover files. Signed-off-by: Eric Blake Reviewed-by: Wenchao Xia --- tests/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index c71c110..e2e4

[Qemu-devel] [PATCH v4 08/19] qapi: Better error messages for bad expressions

2014-09-19 Thread Eric Blake
r any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake --- scripts/qapi.py | 76 + tests/qapi-schema/bad-type-dict.err | 1 + tests/qapi-schema/bad

[Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests

2014-09-19 Thread Eric Blake
Demonstrate that the qapi generator silently parses confusing types, which may cause other errors later on. Later patches will update the expected results as the generator is made stricter. Signed-off-by: Eric Blake --- tests/Makefile | 8 ++-- tests/qapi

[Qemu-devel] [PATCH v4 11/19] qapi: Add tests of type bypass

2014-09-19 Thread Eric Blake
the generated code. As the feature was previously undocumented, add some tests and documentation on what we'd like to guarantee, although it will take later patches to clean up test results. Signed-off-by: Eric Blake --- qapi-schema.json | 6 +++--- tests/Makefile

[Qemu-devel] [PATCH v4 13/19] qapi: More rigourous checking of types

2014-09-19 Thread Eric Blake
ltin or another type declared by the current qapi parse; this includes recursing into each member of a data dictionary. Dealing with '**' and nested sub-structs will be done in later patches. Update the testsuite to match improved output. Signed-off-by: Er

[Qemu-devel] [PATCH v4 01/19] qapi: Consistent whitespace in tests/Makefile

2014-09-19 Thread Eric Blake
tests/Makefile had a mix of TAB vs. 8-space indentation; given that it is a Makefile, TAB is more idiomatic even though in these particular cases the choice of whitespace didn't matter. Signed-off-by: Eric Blake --- tests/Makefile | 32 1 file change

[Qemu-devel] [PATCH v4 06/19] qapi: Better error messages for bad enums

2014-09-19 Thread Eric Blake
the 'data' member was silently accepted by the parser Add check_enum to cover these situations, and update testcases to match. While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Si

[Qemu-devel] [PATCH v4 19/19] qapi: Drop support for inline subtypes

2014-09-19 Thread Eric Blake
rn it into a hard error. Update the testsuite to reflect tighter parsing rules. Signed-off-by: Eric Blake --- scripts/qapi-commands.py | 8 +++--- scripts/qapi-event.py| 4 +-- scripts/qapi-types.py| 9 ++- scripts/qap

[Qemu-devel] [PATCH v4 15/19] qapi: Merge UserDefTwo and UserDefNested in tests

2014-09-19 Thread Eric Blake
code to add new allocations, also convert existing allocations to consistently prefer typesafe g_new0 over g_malloc0. Ensure that 'make check-qapi-schema check-unit' still passes. Signed-off-by: Eric Blake --- tests/qapi-schema/qapi-schema-test.json | 10 + tests/qapi-schema/q

[Qemu-devel] [PATCH v4 18/19] qapi: Drop inline subtype in query-pci

2014-09-19 Thread Eric Blake
ng into an explicit type. The QMP wire format is unaffected by this change. Prefer the safer g_new0() while making the conversion, and reduce some long lines. Signed-off-by: Eric Blake --- hmp.c| 26 hw/pci/pci.c | 42 ++ qapi-schema

[Qemu-devel] [PATCH v4 16/19] qapi: Drop tests for inline subtypes

2014-09-19 Thread Eric Blake
icit types. When touching code to add new allocations, also convert existing allocations to consistently prefer typesafe g_new0 over g_malloc0. Signed-off-by: Eric Blake --- tests/qapi-schema/qapi-schema-test.json | 12 ++-- tests/qapi-schema/qapi-schema-test.out | 8 +++-- tests/test-qmp-

[Qemu-devel] [PATCH v4 14/19] qapi: More rigorous checking for type safety bypass

2014-09-19 Thread Eric Blake
yes' could result in bypassing the generated code. These changes also enforce the changes made earlier in the series for documentation and consolidation of using '**' as the wildcard type. Signed-off-by: Eric Blake --- scripts/qapi.py| 21 +++

[Qemu-devel] [PATCH v4 17/19] qapi: Drop inline subtype in query-version

2014-09-19 Thread Eric Blake
ng into an explicit type. The QMP wire format is unaffected by this change. Prefer the safer g_new0() while making the conversion. Signed-off-by: Eric Blake --- hmp.c| 2 +- qapi/common.json | 26 +++--- qmp.c| 9 + 3 files changed, 25 inserti

Re: [Qemu-devel] [PATCH] chardev: Add reconnecting to client sockets

2014-09-19 Thread Eric Blake
recon: #optional If not a server socket, if the socket disconnect > +# then reconnect after the given number of seconds. Setting > +# to zero disables this function. (default: 0) "recon" makes me think of spy novels, not reconnect. Any reason you can't name

Re: [Qemu-devel] [PATCH v4 04/19] qapi: Document type-safety considerations

2014-09-22 Thread Eric Blake
On 09/22/2014 06:37 AM, Markus Armbruster wrote: > Eric Blake writes: > >> === Union types === >> >> +Usage: { 'union': 'str', 'data': 'dict', '*base': 'complex-type-name', >> + '

Re: [Qemu-devel] [PATCH] docs: add blkdebug block driver documentation

2014-09-22 Thread Eric Blake
ndent errno values? Might be worth a paragraph explaining that ENOSPC is not always 28. Or a design improvement to the setup to allow symbolic naming of the desired actions. Or both. > + > + errno - the POSIX errno value to return when a request matches this rule > + Again, POSIX doe

Re: [Qemu-devel] [PATCH 5/6] qemu-char: Add reconnecting to client sockets

2014-09-22 Thread Eric Blake
a discriminator of type bool (since we can enumerate all of its values). looking something like: { 'type': 'ChardevSocketBase', 'data': { 'addr': 'SocketAddress', '*nodelay': 'bool' } } { 'type': 'ChardevSocketServer', 'data': { '*wait': 'bool', '*telnet': 'bool' } } { 'type': 'ChardevSocketClient', 'data': { '*reconnect': 'int' } } { 'union': 'ChardevSocket', 'base': 'ChardevSocketBase', 'discriminator': 'bool', 'data': { true : 'ChardevSocketServer', false: 'ChardevSocketClient' } } but I don't know if it is worth the complexity for the added type safety. -- 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 5/6] qemu-char: Add reconnecting to client sockets

2014-09-22 Thread Eric Blake
. Since: 2.2. Looks like I reviewed v1 after you had posted v2; my comments still apply about this being awkward wording. -- 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 5/6] qemu-char: Add reconnecting to client sockets

2014-09-22 Thread Eric Blake
JSON dictionary, the left side of any 'key':'value' pair must be a string, only the right side can be an arbitrary JSON type. So we'd have to spell out the stringized version 'true' and 'false' as the enum keys, which is all the more special casing to be added to the qapi generator. Lots of work for not too much benefit. >> >> but I don't know if it is worth the complexity for the added type safety. >> > > Doesn't seem terrible, but I'm not sure. You're welcome to try it if you're interested, but in just typing this email, I can already see it's not a beginner's project, so I'm not going to insist. -- 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/2] qom: add error handler for security

2014-09-22 Thread Eric Blake
On 09/22/2014 09:25 PM, arei.gong...@huawei.com wrote: > From: Gonglei > > The PATCH 2 is splited from another patch series, which has been s/splited/split/ 'split' is one of those stupid English words whose past tense is spelled identically to its present tense. --

Re: [Qemu-devel] [PATCH v4 06/19] qapi: Better error messages for bad enums

2014-09-23 Thread Eric Blake
On 09/23/2014 08:23 AM, Markus Armbruster wrote: > Eric Blake writes: > >> The previous commit demonstrated that the generator had several >> flaws with less-than-perfect enums: >> - an enum that listed the same string twice (or two variant >> strings that ma

Re: [Qemu-devel] [PATCH v4 08/19] qapi: Better error messages for bad expressions

2014-09-23 Thread Eric Blake
On 09/23/2014 08:56 AM, Markus Armbruster wrote: > Eric Blake writes: > >> The previous commit demonstrated that the generator overlooked some >> fairly basic broken expressions: >> - missing metataype >> - metatype key has a non-string value >> - unk

Re: [Qemu-devel] [PATCH] Modify qemu_opt_rename to realize renaming all items in opts

2014-09-23 Thread Eric Blake
;t this just be written as: while ((value = qemu_opt_get(opts, from))) { > +if (value) { > +qemu_opt_set(opts, to, value); > +qemu_opt_unset(opts, from); > +} else { > +break; > + } and lose the if/else and break? But t

Re: [Qemu-devel] Why is virt-resize designed to involve two disks?

2014-09-23 Thread Eric Blake
es the fact that virt-resize is doing MUCH more than resizing the block device - it is also copying entire filesystems from the old location to the new resized location for optimal initial placement. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library ht

Re: [Qemu-devel] [RFC PATCH v2 18/23] COLO nic: add command line switch

2014-09-23 Thread Eric Blake
; +# @colo_nicname: #optional the host physical nic for QEMU (Since 2.2) > +# > +# @colo_script: #optional the script file which used by COLO (Since 2.2) Please use dash, not underscore, for these two new names. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualizatio

Re: [Qemu-devel] [PATCH v2] docs: add blkdebug block driver documentation

2014-09-23 Thread Eric Blake
n to this state number > + > +Suspend and resume > +-- > +Exercising code paths in block drivers may require specific ordering amongst > +concurrent requests. The "breakpoint" feature allows requests to be halted > on > +a blkdebug event and

Re: [Qemu-devel] [PATCH v4 10/19] qapi: Better error messages for duplicated expressions

2014-09-24 Thread Eric Blake
t'. I can go either way, but should probably add a test for a .json file that does {'command':'int'} to test which way we go. Preferences on whether that should be allowed or forbidden? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library ht

Re: [Qemu-devel] [PATCH v4 1/2] trace: [qmp] Add commands to query and control event tracing state

2014-09-24 Thread Eric Blake
quot;, "state": "disabled" } ] } It would be nice to use a glob in the "name" of the example, and show a multi-element array as the result. Those changes can be done in a followup patch, since Stefan has already queued this 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] [IGDVFIO] [PATCH 1/8] RFC and help completing: Intel IGD Direct Assignment with VFIO

2014-09-24 Thread Eric Blake
ok for advice at http://wiki.qemu.org/Contribute/SubmitAPatch -- 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 v3 1/3] throttle: Make NANOSECONDS_PER_SECOND an integer

2014-09-24 Thread Eric Blake
ned-off-by: Benoît Canet > --- > include/qemu/throttle.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/include/qemu/throttle.h b/include/qemu/throttle.h > index b890613..8f9e611 100644 > --- a/include/qemu/throttle.h >

Re: [Qemu-devel] [IGDVFIO] [PATCH 1/8] RFC and help completing: Intel IGD Direct Assignment with VFIO

2014-09-24 Thread Eric Blake
copy the settings from the PCH you > desire */ > +k->vendor_id = host_pci_read_config(0,0x1f,0,0x00,2); > +k->device_id = host_pci_read_config(0,0x1f,0,0x02,2); > +//k->revision = host_pci_read_config(0,0x1f,0,0x08,1); /**/ comments are preferred over //; also, it's good to explain with a comment why you are adding dead code. -- 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 v3] docs: add blkdebug block driver documentation

2014-09-24 Thread Eric Blake
t for powerful matching > +behavior. > + We could always expose it and update the documentation in a later patch. But it is fair to document the current state of things (current docs are always better than no docs :) -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization

Re: [Qemu-devel] [PATCH 1/4] os-posix/win32: convert fprintf/perror to error_report

2014-09-25 Thread Eric Blake
} > TFR(fd = qemu_open("/dev/null", O_RDWR)); > @@ -292,10 +293,11 @@ void os_pidfile_error(void) > if (daemonize) { > uint8_t status = 1; > if (write(fds[1], &status, 1) != 1) { > -perror("daemonize. Writing to pipe\n"); > +error_report("daemonize. Writing to pipe"); and another. > @@ -338,7 +340,7 @@ int os_mlock(void) > > ret = mlockall(MCL_CURRENT | MCL_FUTURE); > if (ret < 0) { > -perror("mlockall"); > +error_report("mlockall"); and another. -- 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/4] osdep: convert fprintf to error_report

2014-09-25 Thread Eric Blake
ed"), > - (requested ? "enabled" : "disabled")); > +error_report("FIPS mode %s (requested %s)", > + (fips_enabled ? "enabled" : "disabled"), > + (requested ? "enabled" : "disab

Re: [Qemu-devel] [PATCH 4/4] oslib-posix/win32: convert fprintf/perror to error_report

2014-09-25 Thread Eric Blake
cate pages\n"); > +error_report("os_mem_prealloc: failed to preallocate pages"); Another reduction in error message quality. You'll definitely need to respin this series, and at this point, I don't know if you can call it trivial. -- 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] block/raw-posix: use seek_hole ahead of fiemap

2014-09-25 Thread Eric Blake
_SYNC. > > Reported-By: Michael Steffens > CC: Pádraig Brady > Signed-off-by: Tony Breeds > --- > block/raw-posix.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Adding Kevin and Stefan in cc (per scripts/get_maintainer.pl). Reviewed-by: Eric Blake -- Er

Re: [Qemu-devel] [PATCH] block/raw-posix: use seek_hole ahead of fiemap

2014-09-25 Thread Eric Blake
SYNC. I agree with splitting this into two patches; one to add the flag as a data corruption fix but acknowledging that it slows fiemap down, the other to relegate fiemap to the fallback case since seek_hole can be faster when it doesn't have to force a sync. -- 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 12/19] qapi: Add some type check tests

2014-09-25 Thread Eric Blake
to instead return a dict) - except that back-compat demands that we can't return a dict in place of a primitive unless the arguments of the command are also enhanced (that is, older callers are not expecting a dict, so we can't return a dict unless the caller witnesses they are new eno

Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests

2014-09-25 Thread Eric Blake
On 09/25/2014 01:34 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Demonstrate that the qapi generator silently parses confusing >> types, which may cause other errors later on. Later patches >> will update the expected results as the generator is made stricter. &

Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests

2014-09-25 Thread Eric Blake
nsible). > > If we care, we can whitelist the existing offenders, and reject new > offenders. Also a good idea. The whitelist may grow over time, but forcing a developer to modify the whitelist calls attention to their action :) I'll add that to my v5 queue. Thanks again for a t

Re: [Qemu-devel] [PATCH v2] ui/input: fix event emitting of repeated combined keys

2014-09-26 Thread Eric Blake
Ctrl-Scroll-Scroll' emulate double scroll pushes all while ctrl is still held down. But this example is MUCH more realistic than 'r-o-o-t', so maybe there is merit to your patch after all. > So this fix just reference the physical implement, if you want to > input same key

[Qemu-devel] [PATCH v5 2/3] qapi: Ignore files created during make check

2014-09-26 Thread Eric Blake
After an in-tree build and run of 'make check-{qapi-schema,unit}', I noticed some leftover files. Signed-off-by: Eric Blake Reviewed-by: Wenchao Xia Reviewed-by: Markus Armbruster --- tests/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/.gitignore b/tests/

[Qemu-devel] [PATCH v5 1/3] qapi: Consistent whitespace in tests/Makefile

2014-09-26 Thread Eric Blake
tests/Makefile had a mix of TAB vs. 8-space indentation; given that it is a Makefile, TAB is more idiomatic even though in these particular cases the choice of whitespace didn't matter. Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster --- tests/Makefile

[Qemu-devel] [PATCH v5a 0/3] trivial qapi cleanups

2014-09-26 Thread Eric Blake
-09/msg04022.html Changelog: v5: no change (just splitting the series into two parts) v4: add docs (patch 3 is new) [Markus] v3: no changes v2: add makefile cleanups (patch 1-2) v1: this portion of the larger series was not present Eric Blake (3): qapi: Consistent whitespace in

[Qemu-devel] [PATCH v5 3/3] qapi: Update docs given recent event, spacing fixes

2014-09-26 Thread Eric Blake
yet, which feels rather stale. Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster --- docs/qapi-code-gen.txt | 100 +++-- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index a6197a

Re: [Qemu-devel] [PATCH v4 00/19] drop qapi nested structs

2014-09-26 Thread Eric Blake
On 09/19/2014 04:24 PM, Eric Blake wrote: > After dragging my feet due to some libvirt work, I've finally > revived this patch series as promised. > > v3 was here: > https://lists.gnu.org/archive/html/qemu-devel/2014-08/msg00725.html > > v4: > update commit messag

Re: [Qemu-devel] [PATCH v2] qga: Rewrite code where using readdir_r

2014-09-26 Thread Eric Blake
ir_r to readdir (Comment of Eric Blake) > --- > qga/commands-posix.c | 27 +++ > 1 file changed, 15 insertions(+), 12 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.or

Re: [Qemu-devel] [PATCH v2 1/2] block/raw-posix: Fix disk corruption in try_fiemap

2014-09-26 Thread Eric Blake
d-off-by: Tony Breeds > Cc: Kevin Wolf > Cc: Markus Armbruster > Cc: Stefan Hajnoczi > Cc: Max Reitz > Cc: Pádraig Brady > Cc: Eric Blake > --- > Changes since v1: > - split in to 2 patches > - tried to make the commit messages better > > block/raw-pos

Re: [Qemu-devel] [PATCH v2 2/2] block/raw-posix: use seek_hole ahead of fiemap

2014-09-26 Thread Eric Blake
nels. This matches what coreutils does, so I like it on that grounds. > > Reported-By: Michael Steffens > Signed-off-by: Tony Breeds > Cc: Kevin Wolf > Cc: Markus Armbruster > Cc: Stefan Hajnoczi > Cc: Max Reitz > Cc: Pádraig Brady > Cc: Eric Blake > --- > Changes

Re: [Qemu-devel] [PATCH v4 1/2] QEMUSizedBuffer based QEMUFile

2014-09-26 Thread Eric Blake
s->qsb = input; > +} > + > +if (s->qsb == NULL) { > +s->qsb = qsb_create(NULL, 0); > +} > +if (!s->qsb) { > +error_report("qemu_bufopen: qsb_create failed"); > +return NULL; Memory leak of s. > +} > +

Re: [Qemu-devel] [PATCH v4 2/2] Tests: QEMUSizedBuffer/QEMUBuffer

2014-09-26 Thread Eric Blake
- > 2 files changed, 39 insertions(+), 37 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 v4 13/19] qapi: More rigourous checking of types

2014-09-29 Thread Eric Blake
On 09/29/2014 02:27 AM, Markus Armbruster wrote: > Markus Armbruster writes: > >> Eric Blake writes: >> >>> Now that we know every expression is valid with regards to >>> its keys, we can add further tests that those keys refer to >>> valid types. W

Re: [Qemu-devel] [PATCH v4 14/19] qapi: More rigorous checking for type safety bypass

2014-09-29 Thread Eric Blake
On 09/29/2014 02:38 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Now that we have a way to validate every type, we can also be >> stricter about enforcing that callers that want to bypass >> type safety in generated code. Prior to this patch, it didn&#x

Re: [Qemu-devel] [PATCH v4 13/19] qapi: More rigourous checking of types

2014-09-29 Thread Eric Blake
On 09/26/2014 03:26 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Now that we know every expression is valid with regards to >> its keys, we can add further tests that those keys refer to >> valid types. With this patch, all references to a type (the >> &

Re: [Qemu-devel] [PATCH v5 0/2] In memory QEMUFile

2014-09-29 Thread Eric Blake
. Thus it seems best to put in, if only to stop people writing yet > another implementation. > > Dave > > v5: > Fixes from Eric's comments; including a memory leak in an error path Looks correct to me, so my R-b is valid. -- Eric Blake eblake redhat com+1-919-301-

Re: [Qemu-devel] [PATCH] block: Drop superfluous conditionals around qemu_opts_del()

2014-09-29 Thread Eric Blake
On 09/29/2014 08:07 AM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > blockdev.c | 4 +--- > qemu-img.c | 4 +--- > qemu-nbd.c | 4 +--- > 3 files changed, 3 insertions(+), 9 deletions(-) Reviewed-by: Eric Blake Made superfluous in commit 478218

Re: [Qemu-devel] [PATCH v3 6/7] qmp: print descriptions of object properties

2014-09-29 Thread Eric Blake
escription); (it's safe to call g_strdup(NULL), avoiding the need for ?: in the assignment). > return info; > } > klass = object_class_get_parent(klass); > @@ -475,6 +478,8 @@ static DevicePropertyInfo > *make_device_property_info(ObjectClass *klass, > info = g_malloc0(sizeof(*info)); > info->name = g_strdup(name); > info->type = g_strdup(default_type); > +info->description = description ? g_strdup(description) : NULL; Another place that should avoid the ?:, and set has_description. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

<    3   4   5   6   7   8   9   10   11   12   >