Re: [Qemu-devel] [PATCH v11 1/7] bitmap: fix bitmap_count_one

2018-12-13 Thread Dr. David Alan Gilbert
* Wei Wang (wei.w.w...@intel.com) wrote: > BITMAP_LAST_WORD_MASK(nbits) returns 0x when "nbits=0", which > makes bitmap_count_one fail to handle the "nbits=0" case. It appears to be > preferred to remain BITMAP_LAST_WORD_MASK identical to the kernel > implementation that it is ported from.

[Qemu-devel] [PATCH v3] log: Make glib logging go through QEMU

2018-12-13 Thread Christophe Fergeau
This commit adds a qemu_init_logging() helper which calls g_log_set_default_handler() so that glib logs (g_log, g_warning, ...) are handled similarly to other QEMU logs. This means they will get a timestamp if timestamps are enabled, and they will go through the monitor if one is configured. This

Re: [Qemu-devel] [PATCH v12 6/6] tpm: add ACPI memory clear interface

2018-12-13 Thread Igor Mammedov
On Thu, 13 Dec 2018 16:18:09 +0400 Marc-André Lureau wrote: > On Thu, Dec 13, 2018 at 4:01 PM Igor Mammedov wrote: > > > > On Wed, 12 Dec 2018 17:22:21 +0100 > > Philippe Mathieu-Daudé wrote: > > > > > On 9/10/18 10:32 AM, Marc-André Lureau wrote: > > > > This allows to pass the last

Re: [Qemu-devel] [Qemu-block] [PATCH RFC] qemu-io: Prefer stderr for error messages

2018-12-13 Thread Eric Blake
On 12/13/18 8:05 AM, Kevin Wolf wrote: Am 13.12.2018 um 11:47 hat Daniel P. Berrangé geschrieben: On Thu, Dec 13, 2018 at 01:52:29AM +0200, Nir Soffer wrote: On Thu, Dec 13, 2018 at 12:13 AM Eric Blake wrote: When a qemu-io command fails, it's best if the failure message goes to stderr

Re: [Qemu-devel] [PATCH RFC] qemu-io: Prefer stderr for error messages

2018-12-13 Thread Kevin Wolf
Am 13.12.2018 um 11:11 hat Daniel P. Berrangé geschrieben: > On Wed, Dec 12, 2018 at 04:04:10PM -0600, Eric Blake wrote: > > When a qemu-io command fails, it's best if the failure message > > goes to stderr rather than stdout. > > > > Reported-by: Richard W.M. Jones > > Signed-off-by: Eric Blake

Re: [Qemu-devel] Request for clarification on qemu-img convert behavior zeroing target host_device

2018-12-13 Thread Eric Blake
On 12/13/18 7:12 AM, De Backer, Fred (Nokia - BE/Antwerp) wrote: Hi, We're using Openstack Ironic to deploy baremetal servers. During the deployment process an agent (ironic-python-agent) running on Fedora linux uses qemu-img to write a qcow2 file to a blockdevice. Recently we saw a change

Re: [Qemu-devel] [PATCH v12 6/6] tpm: add ACPI memory clear interface

2018-12-13 Thread Philippe Mathieu-Daudé
On 12/13/18 1:18 PM, Marc-André Lureau wrote: > On Thu, Dec 13, 2018 at 4:01 PM Igor Mammedov wrote: >> >> On Wed, 12 Dec 2018 17:22:21 +0100 >> Philippe Mathieu-Daudé wrote: >> >>> On 9/10/18 10:32 AM, Marc-André Lureau wrote: This allows to pass the last failing test from the Windows HLK

Re: [Qemu-devel] [PATCH v8 20/22] qapi: add condition to variants documentation

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Signed-off-by: Marc-André Lureau Like the previous two patches, this will do for now. Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [Qemu-block] [PATCH RFC] qemu-io: Prefer stderr for error messages

2018-12-13 Thread Kevin Wolf
Am 13.12.2018 um 11:47 hat Daniel P. Berrangé geschrieben: > On Thu, Dec 13, 2018 at 01:52:29AM +0200, Nir Soffer wrote: > > On Thu, Dec 13, 2018 at 12:13 AM Eric Blake wrote: > > > > > > When a qemu-io command fails, it's best if the failure message > > > goes to stderr rather than stdout. > >

Re: [Qemu-devel] [PATCH RFC] qemu-io: Prefer stderr for error messages

2018-12-13 Thread Eric Blake
On 12/13/18 6:21 AM, Wainer dos Santos Moschetta wrote: On 12/12/2018 08:04 PM, Eric Blake wrote: When a qemu-io command fails, it's best if the failure message goes to stderr rather than stdout. Reported-by: Richard W.M. Jones Signed-off-by: Eric Blake --- RFC because at least iotest 60

Re: [Qemu-devel] [PATCH v8 19/22] qapi: add 'If:' condition to struct members documentation

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Signed-off-by: Marc-André Lureau Like the previous patch, this will do for now. Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [PATCH v8 18/22] qapi: add 'If:' condition to enum values documentation

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Use a common function to generate the "If:..." line. > > While at it, get rid of the existing \n\n (no idea why it was > there). Use a line-break in member description, this seems to look > slightly better in the plaintext version. > > Signed-off-by: Marc-André Lureau

Re: [Qemu-devel] [PATCH for-4.0 v7 22/27] qapi: add 'If:' condition to enum values documentation

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Tue, Dec 11, 2018 at 8:00 PM Markus Armbruster wrote: >> >> Marc-André Lureau writes: >> >> > Use a common function to generate the "If:..." line. >> > >> > While at it, get rid of the existing \n\n (no idea why it was >> > there). Use a line-break in

Re: [Qemu-devel] [PATCH v2] Add getsockopt for settable SOL_IPV6 options

2018-12-13 Thread Laurent Vivier
On 13/12/2018 14:37, tom.des...@gmail.com wrote: > From: Tom Deseyn > > Signed-off-by: Tom Deseyn > --- Please add here an history of the changes between the version 1 and 2: v2: ? > linux-user/syscall.c | 38 ++ > 1 file changed, 38 insertions(+) >

Re: [Qemu-devel] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-13 Thread Anton Nefedov
On 13/12/2018 3:02 PM, Vladimir Sementsov-Ogievskiy wrote: > 03.12.2018 13:14, Anton Nefedov wrote: >> If COW areas of the newly allocated clusters are zeroes on the backing image, >> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole >> cluster instead of writing

Re: [Qemu-devel] [PATCH 05/15] s390-bios: Factor finding boot device out of virtio code path

2018-12-13 Thread Farhan Ali
On 12/12/2018 09:11 AM, Jason J. Herne wrote: Make a new routine find_boot_device to locate the boot device for all cases. not just virtio. I don't think there should be a period after cases? In one case no boot device is specified and a suitable boot device can not be auto detected. The

Re: [Qemu-devel] [PATCH v2 7/7] iotests: add iotest 236 for testing bitmap merge

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > New interface, new smoke test. > > Signed-off-by: John Snow > --- > tests/qemu-iotests/236 | 123 + > tests/qemu-iotests/236.out | 265 + > tests/qemu-iotests/group | 1 + > 3 files changed, 389

Re: [Qemu-devel] [PULL 0/6] s390x: first batch of 4.0 changes

2018-12-13 Thread Peter Maydell
On Wed, 12 Dec 2018 at 09:55, Cornelia Huck wrote: > > The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086: > > Merge remote-tracking branch > 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 > 19:18:58 +) > > are available in the Git

[Qemu-devel] [PATCH v2] Add getsockopt for settable SOL_IPV6 options

2018-12-13 Thread tom . deseyn
From: Tom Deseyn Signed-off-by: Tom Deseyn --- linux-user/syscall.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 280137da8c..ad52cfbd54 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c

Re: [Qemu-devel] [PATCH v8 14/22] qapi: add an error in case a discriminator is conditional

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Making a discriminator conditional doesn't make much sense. "qapi: > add a dictionary form for TYPE" allows it, this patch fixes > it. Eventually the two could be merged, but for clarity of review it > is kept separate. > > Signed-off-by: Marc-André Lureau

[Qemu-devel] [PATCH] Add getsockopt for settable SOL_IPV6 options

2018-12-13 Thread tom . deseyn
From: Tom Deseyn Signed-off-by: Tom Deseyn --- linux-user/syscall.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 280137da8c..29bac79b61 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c

[Qemu-devel] Request for clarification on qemu-img convert behavior zeroing target host_device

2018-12-13 Thread De Backer, Fred (Nokia - BE/Antwerp)
Hi, We're using Openstack Ironic to deploy baremetal servers. During the deployment process an agent (ironic-python-agent) running on Fedora linux uses qemu-img to write a qcow2 file to a blockdevice. Recently we saw a change in behavior of qemu-img. Previously we were using Fedora 27

Re: [Qemu-devel] [PATCH v8 12/22] qapi: add a dictionary form for TYPE

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Wherever a struct/union/alternate/command/event member with NAME: TYPE > form is accepted, desugar it to a NAME: { 'type': TYPE } form. > > This will allow to add new member details, such as 'if' in the > following patch to introduce conditionals, or 'default' for

Re: [Qemu-devel] QEMU and Kconfig

2018-12-13 Thread Paolo Bonzini
On 13/12/18 12:50, Yang Zhong wrote: > Hello Paolo and all, > > The Kconfig has been completed the porting from your repo and > now i can sucessfully build x86_64-softmmu binary. But there > are still some issues: >1) Only support x86_64 platform. > Other platform, especially for ARM

Re: [Qemu-devel] [RFC PATCH v2] contrib: add a basic gitdm config

2018-12-13 Thread Aleksandar Markovic
On Dec 13, 2018 2:45 AM, aleksandar.m.m...@gmail.com wrote: > > > On Dec 12, 2018 11:26 AM, "Alex Bennée" wrote: > > > > This is a QEMU specific version of a gitdm config for generating > > reports on the contributor base of the project. I've added enough > > group maps and domain aliases to

Re: [Qemu-devel] [PATCH v8 06/22] qapi: add a dictionary form with 'name' key for enum members

2018-12-13 Thread Markus Armbruster
Marc-André Lureau writes: > Desugar the enum NAME form to { 'name': NAME }. This will allow to add > new enum members, such as 'if' in the following patch. > > Signed-off-by: Marc-André Lureau With the next two patches squashed in: Reviewed-by: Markus Armbruster Happy to squash when I apply.

Re: [Qemu-devel] [PATCH] qemu-options: Remove deprecated "-virtioconsole" option

2018-12-13 Thread Paolo Bonzini
On 13/12/18 08:05, Thomas Huth wrote: > It's been deprecated since QEMU 3.0, and nobody complained so far, so > it is time to remove this option now. > > Signed-off-by: Thomas Huth Queued (for the next pull request, not this one). It made sense for s390 before the sclp{,lm}console was

Re: [Qemu-devel] [PATCH 03/15] s390-bios: decouple common boot logic from virtio

2018-12-13 Thread Farhan Ali
On 12/12/2018 09:11 AM, Jason J. Herne wrote: Create a boot_setup function to handle getting boot information from the machine/hypervisor. This decouples common boot logic from the virtio code path and allows us to make use of it for the real dasd boot scenario. Signed-off-by: Jason J. Herne

Re: [Qemu-devel] [PATCH 02/15] s390-bios: decouple cio setup from virtio

2018-12-13 Thread Farhan Ali
On 12/12/2018 09:11 AM, Jason J. Herne wrote: Move channel i/o setup code out to a separate function. This decouples cio setup from the virtio code path and allows us to make use of it for booting dasd devices. Signed-off-by: Jason J. Herne Acked-by: Halil Pasic Reviewed-by: Collin Walling

Re: [Qemu-devel] [PATCH v2] hw/s390/ccw.c: Don't take address of packed members

2018-12-13 Thread Farhan Ali
On 12/13/2018 07:02 AM, Peter Maydell wrote: Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this.

Re: [Qemu-devel] [PATCH v2 6/7] iotests: allow pretty-print for qmp_log

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > If iotests have lines exceeding >998 characters long, git doesn't > want to send it plaintext to the list. We can solve this by allowing > the iotests to use pretty printed QMP output that we can match against > instead. > > As a bonus, it's much nicer for

Re: [Qemu-devel] [PULL 00/27] ppc-for-4.0 queue 20181213

2018-12-13 Thread Cédric Le Goater
>> Your patch has style problems, please review. If any of these errors >> are false positives report them to the maintainer, see >> CHECKPATCH in MAINTAINERS. >> Checking PATCH 14/27: ppc/xive: add support for the LSI interrupt sources... >> Checking PATCH 15/27: ppc/xive: introduce the

Re: [Qemu-devel] [PATCH] qdev/core: Can not replug device on bus that allows one device

2018-12-13 Thread Halil Pasic
On Thu, 13 Dec 2018 13:09:59 +0100 Igor Mammedov wrote: > On Tue, 11 Dec 2018 14:41:00 -0500 > Tony Krowiak wrote: > > > On 12/11/18 10:23 AM, Igor Mammedov wrote: > > > On Mon, 10 Dec 2018 14:14:14 -0500 > > > Tony Krowiak wrote: > > > > > >> If the maximum number of devices allowed on a

Re: [Qemu-devel] [PATCH v8 09/12] spapr: set the interrupt presenter at reset

2018-12-13 Thread Cédric Le Goater
On 12/11/18 11:38 PM, Cédric Le Goater wrote: > Currently, the interrupt presenter of the vCPU is set at realize > time. Setting it at reset will become necessary when the new machine > supporting both interrupt modes is introduced. In this machine, the > interrupt mode is chosen at CAS time and

Re: [Qemu-devel] [PATCH v2 5/7] iotests: add filter_generated_node_ids

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > To mimic the common filter of the same name, but for the python tests. > > Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/iotests.py | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git

Re: [Qemu-devel] [PATCH v4 16/18] xen: automatically create XenBlockDevice-s

2018-12-13 Thread Paul Durrant
> -Original Message- > From: Kevin Wolf [mailto:kw...@redhat.com] > Sent: 13 December 2018 11:52 > To: Paul Durrant > Cc: qemu-devel@nongnu.org; qemu-bl...@nongnu.org; xen- > de...@lists.xenproject.org; Max Reitz ; Stefano > Stabellini > Subject: Re: [PATCH v4 16/18] xen: automatically

Re: [Qemu-devel] [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.

2018-12-13 Thread Markus Armbruster
Gerd Hoffmann writes: > Open files and directories with O_NOFOLLOW to avoid symlinks attacks. > While being at it also add O_CLOEXEC. > > usb-mtp only handles regular files and directories and ignores > everything else, so users should not see a difference. > > Because qemu ignores symlinks

[Qemu-devel] [PATCH 1/3] qemu-deprecated.texi: Rename the HMP section

2018-12-13 Thread Kashyap Chamarthy
So that it is consistent with the naming of QMP's Signed-off-by: Kashyap Chamarthy --- qemu-deprecated.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 72b8191d60..46bec688db 100644 --- a/qemu-deprecated.texi +++

Re: [Qemu-devel] [PULL 0/2] Block patches

2018-12-13 Thread Peter Maydell
On Wed, 12 Dec 2018 at 09:53, Stefan Hajnoczi wrote: > > The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086: > > Merge remote-tracking branch > 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 > 19:18:58 +) > > are available in the Git

[Qemu-devel] [PATCH 3/3] Mention that QMP 'cpu-add' will be deprecated

2018-12-13 Thread Kashyap Chamarthy
Signed-off-by: Kashyap Chamarthy --- qemu-deprecated.texi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 79743ab8bd..2505e1f47f 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -114,6 +114,12 @@ The ``query-cpus''

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Peter Maydell
On Thu, 13 Dec 2018 at 12:39, Daniel P. Berrangé wrote: > The problem with this assertion is that there's many places which > call qemu_set_nonblock, so you don't know which code to look at, > as we don't know the caller. In an ideal world assert would print a stack backtrace :-) thanks -- PMM

[Qemu-devel] [PATCH 0/3] Update deprecation notes for QMP 'cpu-add' & HMP 'cpu_add'

2018-12-13 Thread Kashyap Chamarthy
Kashyap Chamarthy (3): qemu-deprecated.texi: Rename the HMP section Update that HMP 'cpu_add' is deprecated in 4.0 Mention that QMP 'cpu-add' will be deprecated qemu-deprecated.texi | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.17.2

[Qemu-devel] [PATCH 2/3] Update that HMP 'cpu_add' is deprecated in 4.0

2018-12-13 Thread Kashyap Chamarthy
Also fix the wrong spelling of it: s/cpu-add/cpu_add/ Signed-off-by: Kashyap Chamarthy --- qemu-deprecated.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 46bec688db..79743ab8bd 100644 --- a/qemu-deprecated.texi +++

Re: [Qemu-devel] [PATCH v2 4/7] iotests.py: don't abort if IMGKEYSECRET is undefined

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > Instead of using os.environ[], use .get with a default of empty string > to match the setup in check to allow us to import the iotests module > (for debugging, say) without needing a crafted environment just to > import the module. > > Signed-off-by: John Snow

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Daniel P . Berrangé
On Thu, Dec 13, 2018 at 01:28:23PM +0100, Markus Armbruster wrote: > Peter Maydell writes: > > > On Thu, 13 Dec 2018 at 10:19, Daniel P. Berrangé > > wrote: > >> > >> On Wed, Dec 12, 2018 at 06:09:37PM -0800, Li Qiang wrote: > >> > Assert that the return value is not an error. This is like

Re: [Qemu-devel] [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.

2018-12-13 Thread Michael Hanselmann
On 13.12.18 13:25, Gerd Hoffmann wrote: > Open files and directories with O_NOFOLLOW to avoid symlinks attacks. > While being at it also add O_CLOEXEC. > > usb-mtp only handles regular files and directories and ignores > everything else, so users should not see a difference. > > Because qemu

Re: [Qemu-devel] [PULL 00/27] ppc-for-4.0 queue 20181213

2018-12-13 Thread David Gibson
ormation: > > Type: series > Message-id: 20181213040126.6768-1-da...@gibson.dropbear.id.au > Subject: [Qemu-devel] [PULL 00/27] ppc-for-4.0 queue 20181213 [snip] > === OUTPUT BEGIN === > Checking PATCH 1/27: spapr: Fix ibm, max-associativity-domains property > number of

[Qemu-devel] [PATCH v8 22/22] qapi: add conditions to REPLICATION type/commands on the schema

2018-12-13 Thread Marc-André Lureau
Add #if defined(CONFIG_REPLICATION) in generated code, and adjust the code accordingly. Made conditional: * xen-set-replication, query-xen-replication-status, xen-colo-do-checkpoint Before the patch, we first register the commands unconditionally in generated code (requires a stub), then

[Qemu-devel] [PATCH v8 21/22] qapi: add more conditions to SPICE

2018-12-13 Thread Marc-André Lureau
Now that member can be made conditional, let's make SPICE chardev conditional: * spiceport, spicevmc Before and after the patch for !CONFIG_SPICE, the error is the same ('spiceport' is not a valid char driver name). Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster ---

Re: [Qemu-devel] [PATCH v2 3/7] block: remove 'x' prefix from experimental bitmap APIs

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > The 'x' prefix was added because I was uncertain of the direction we'd > take for the libvirt API. With the general approach solidified, I feel > comfortable committing to this API for 4.0. > > Signed-off-by: John Snow > Reviewed-by: Eric Blake Reviewed-by:

[Qemu-devel] [PATCH v8 19/22] qapi: add 'If:' condition to struct members documentation

2018-12-13 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 4 ++-- tests/qapi-schema/doc-good.json | 3 ++- tests/qapi-schema/doc-good.out | 1 + tests/qapi-schema/doc-good.texi | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/doc.py

[Qemu-devel] [PATCH v8 20/22] qapi: add condition to variants documentation

2018-12-13 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py | 4 ++-- tests/qapi-schema/doc-good.json | 4 ++-- tests/qapi-schema/doc-good.out | 3 +++ tests/qapi-schema/doc-good.texi | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/qapi/doc.py

[Qemu-devel] [PATCH v8 17/22] qapi: add #if conditions to generated code members

2018-12-13 Thread Marc-André Lureau
Wrap generated enum and struct members and their supporting code with We do enum and struct in a single patch because union tag enum and the associated variants tie them together, and dealing with that to split the patch doesn't seem worthwhile. Signed-off-by: Marc-André Lureau Reviewed-by:

[Qemu-devel] [PATCH v8 13/22] qapi: add 'if' to implicit struct members

2018-12-13 Thread Marc-André Lureau
The generated code is for now *unconditional*. Later patches generate the conditionals. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py | 14 +++--- docs/devel/qapi-code-gen.txt| 10 ++

[Qemu-devel] [PATCH v8 14/22] qapi: add an error in case a discriminator is conditional

2018-12-13 Thread Marc-André Lureau
Making a discriminator conditional doesn't make much sense. "qapi: add a dictionary form for TYPE" allows it, this patch fixes it. Eventually the two could be merged, but for clarity of review it is kept separate. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py

[Qemu-devel] [PATCH v8 18/22] qapi: add 'If:' condition to enum values documentation

2018-12-13 Thread Marc-André Lureau
Use a common function to generate the "If:..." line. While at it, get rid of the existing \n\n (no idea why it was there). Use a line-break in member description, this seems to look slightly better in the plaintext version. Signed-off-by: Marc-André Lureau --- scripts/qapi/doc.py |

[Qemu-devel] [PATCH v8 08/22] qapi: simplify make_enum_members()

2018-12-13 Thread Marc-André Lureau
The function only receives the dictionary form of enum expressions now, so we can make it shorter. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-)

[Qemu-devel] [PATCH v8 16/22] qapi: add 'if' to alternate members

2018-12-13 Thread Marc-André Lureau
Add 'if' key to alternate members: { 'alternate': 'TestIfAlternate', 'data': { 'alt': { 'type': 'TestStruct', 'if': 'COND' } } } Generated code is not changed by this patch but with "qapi: add #if conditions to generated code". Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster

Re: [Qemu-devel] [PATCH v2] util: check the return value of fcntl in qemu_set_{block, nonblock}

2018-12-13 Thread Markus Armbruster
Li Qiang writes: > Also add diagnostics info in 'qemu_set_cloexec' so that we can know > what happen when error occurs. > > Signed-off-by: Li Qiang > --- > Change since v1: add diagnostics info > > util/oslib-posix.c | 37 - > 1 file changed, 32

[Qemu-devel] [PATCH v8 15/22] qapi: add 'if' to union members

2018-12-13 Thread Marc-André Lureau
Add 'if' key to union members: { 'union': 'TestIfUnion', 'data': 'mem': { 'type': 'str', 'if': 'COND'} } The generated code remains unconditional for now. Later patches generate the conditionals. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py

[Qemu-devel] [PATCH v8 03/22] tests: print enum type members more like object type members

2018-12-13 Thread Marc-André Lureau
Commit 93bda4dd461 changed the internal representation of enum type members from str to QAPISchemaMember, but we still print only a string. Has been good enough, as the name is the member's only attribute of interest, but that's about to change. To prepare, print them more like object type

[Qemu-devel] [PATCH v8 10/22] qapi-events: add 'if' condition to implicit event enum

2018-12-13 Thread Marc-André Lureau
Add condition to QAPIEvent enum members based on the event 'if'. The generated code remains unconditional for now. Later patches generate the conditionals (also there is no additional coverage of this change in qapi-schema-test.out since the event_names enum is an implicit type created by

[Qemu-devel] [PATCH v8 12/22] qapi: add a dictionary form for TYPE

2018-12-13 Thread Marc-André Lureau
Wherever a struct/union/alternate/command/event member with NAME: TYPE form is accepted, desugar it to a NAME: { 'type': TYPE } form. This will allow to add new member details, such as 'if' in the following patch to introduce conditionals, or 'default' for default values etc. Signed-off-by:

[Qemu-devel] [PATCH v8 11/22] qapi: rename allow_dict to allow_implicit

2018-12-13 Thread Marc-André Lureau
This makes it a bit clearer what is the intent of the dictionnary for the check_type() function, since there was some confusion on a previous iteration of this series. Suggested-by: Markus Armbruster Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py | 12 ++-- 1 file changed,

[Qemu-devel] [PATCH v8 01/22] qapi: Do not define enumeration value explicitly

2018-12-13 Thread Marc-André Lureau
The generated C enumeration types explicitly set the enumeration constants to 0, 1, 2, ... That's exactly what you get when you don't supply values. Drop the explicit values. No change now, but it will avoid gaps in the values when we later add support for 'if' conditions. Avoiding such gaps

[Qemu-devel] [PATCH v8 04/22] qapi: factor out checking for keys

2018-12-13 Thread Marc-André Lureau
Introduce a new helper function to check if the given keys are known, and if mandatory keys are present. The function will be reused in other places in the following code changes. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py | 20

[Qemu-devel] [PATCH v8 09/22] qapi: add 'if' to enum members

2018-12-13 Thread Marc-André Lureau
QAPISchemaMember gains .ifcond for enum members: inherited classes, such as QAPISchemaObjectTypeMember, will thus have an ifcond member after this (those different types will also use the .ifcond to store the condition and generate conditional code in the following patches). The generated code

[Qemu-devel] [PATCH v8 06/22] qapi: add a dictionary form with 'name' key for enum members

2018-12-13 Thread Marc-André Lureau
Desugar the enum NAME form to { 'name': NAME }. This will allow to add new enum members, such as 'if' in the following patch. Signed-off-by: Marc-André Lureau --- scripts/qapi/common.py| 38 +++ tests/Makefile.include| 3 +-

[Qemu-devel] [PATCH v8 02/22] qapi: change enum visitor and gen_enum* to take QAPISchemaMember

2018-12-13 Thread Marc-André Lureau
This will allow to add and access more properties associated with enum values/members, like the associated 'if' condition. We may want to have a specialized type QAPISchemaEnumMember, for now this will do. Modify gen_enum() and gen_enum_lookup() for the same reason. Suggested-by: Markus

[Qemu-devel] [PATCH v8 00/22] qapi: add #if pre-processor conditions to generated code (part 2)

2018-12-13 Thread Marc-André Lureau
This is the second part of the "add #if pre-processor conditions to generated code" series, adding schema member conditions (roughly 16-38/49). Members can be exploded as dictionnary with 'type'/'if' keys: { 'struct': 'TestIfStruct', 'data': { 'foo': 'int', 'bar': { 'type': 'int', 'if':

[Qemu-devel] [PATCH v8 07/22] qapi: pass long form enum to make_enum_members

2018-12-13 Thread Marc-André Lureau
This will allow to get rid of short form handling in a following patch. Signed-off-by: Marc-André Lureau Suggested-by: Markus Armbruster --- scripts/qapi/common.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index

[Qemu-devel] [PATCH v8 05/22] qapi: improve reporting of unknown or missing keys

2018-12-13 Thread Marc-André Lureau
Report the set of missing or unknown keys. And give a hint about the accepted keys. The error message for multiple meta type members (visible in tests/qapi-schema/double-type.err) is not improved. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster --- scripts/qapi/common.py

Re: [Qemu-devel] [PATCH v1 1/2] target/arm: kvm64 make guest debug AA32 break point aware

2018-12-13 Thread Ard Biesheuvel
Hi Alex, Thanks again for looking into this. On Thu, 13 Dec 2018 at 12:55, Alex Bennée wrote: > > When supported by the hardware we can run AA32 guests or even AA64 EL1 > code with AA32 EL0 mode code. Inserting a AA64 break point into AA32 > code tends to break things. This is especially acute

Re: [Qemu-devel] [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.

2018-12-13 Thread Daniel P . Berrangé
On Thu, Dec 13, 2018 at 01:25:11PM +0100, Gerd Hoffmann wrote: > Open files and directories with O_NOFOLLOW to avoid symlinks attacks. > While being at it also add O_CLOEXEC. > > usb-mtp only handles regular files and directories and ignores > everything else, so users should not see a

Re: [Qemu-devel] [PATCH v4 2/2] memory-device: rewrite address assignment using ranges

2018-12-13 Thread David Hildenbrand
On 13.12.18 13:28, Igor Mammedov wrote: > On Wed, 12 Dec 2018 10:28:21 +0100 > David Hildenbrand wrote: > >> Let's rewrite it properly using ranges. This fixes certain overflows that >> are right now possible. E.g. >> >> qemu-system-x86_64 -m 4G,slots=20,maxmem=40G -M pc \ >> -object

Re: [Qemu-devel] [PATCH v4 2/2] memory-device: rewrite address assignment using ranges

2018-12-13 Thread Igor Mammedov
On Wed, 12 Dec 2018 10:28:21 +0100 David Hildenbrand wrote: > Let's rewrite it properly using ranges. This fixes certain overflows that > are right now possible. E.g. > > qemu-system-x86_64 -m 4G,slots=20,maxmem=40G -M pc \ > -object

Re: [Qemu-devel] [PATCH] util: check the return value of fcntl in qemu_set_{block, noblock}

2018-12-13 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 13 Dec 2018 at 10:19, Daniel P. Berrangé wrote: >> >> On Wed, Dec 12, 2018 at 06:09:37PM -0800, Li Qiang wrote: >> > Assert that the return value is not an error. This is like commit >> > 7e6478e7d4f for qemu_set_cloexec. >> > >> > Signed-off-by: Li Qiang >> >

[Qemu-devel] [PATCH] usb-mtp: use O_NOFOLLOW and O_CLOEXEC.

2018-12-13 Thread Gerd Hoffmann
Open files and directories with O_NOFOLLOW to avoid symlinks attacks. While being at it also add O_CLOEXEC. usb-mtp only handles regular files and directories and ignores everything else, so users should not see a difference. Because qemu ignores symlinks carrying out an successfull symlink

Re: [Qemu-devel] [PATCH v2 2/7] blockdev: n-ary bitmap merge

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
13.12.2018 4:50, John Snow wrote: > Especially outside of transactions, it is helpful to provide > all-or-nothing semantics for bitmap merges. This facilitates > the coalescing of multiple bitmaps into a single target for > the "checkpoint" interpretation when assembling bitmaps that > represent

Re: [Qemu-devel] [PATCH v3 0/3] Performance improvements for xen_disk^Wxen-block

2018-12-13 Thread Anthony PERARD
On Wed, Dec 12, 2018 at 11:16:23AM +, Paul Durrant wrote: > This series is a re-base of Tim's v2 series [1] on top of my series [2]. > > [1] https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg00243.html > [2] https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg02271.html For the

Re: [Qemu-devel] [PATCH RFC] qemu-io: Prefer stderr for error messages

2018-12-13 Thread Wainer dos Santos Moschetta
On 12/12/2018 08:04 PM, Eric Blake wrote: When a qemu-io command fails, it's best if the failure message goes to stderr rather than stdout. Reported-by: Richard W.M. Jones Signed-off-by: Eric Blake --- RFC because at least iotest 60 (found by -qcow2 -g quick) breaks due to reordering of

Re: [Qemu-devel] [PATCH] blk: postpone request execution on a context protected with "drained section"

2018-12-13 Thread Kevin Wolf
Am 13.12.2018 um 12:07 hat Denis Plotnikov geschrieben: > On 12.12.2018 15:24, Kevin Wolf wrote: > > Am 11.12.2018 um 17:55 hat Denis Plotnikov geschrieben: > >>> Why involve the AioContext at all? This could all be kept at the > >>> BlockBackend level without extending the layering violation that

Re: [Qemu-devel] [PATCH v6 9/9] qapi: query-blockstat: add driver specific file-posix stats

2018-12-13 Thread Markus Armbruster
I'm reviewing just the QAPI schema today. Anton Nefedov writes: > A block driver can provide a callback to report driver-specific > statistics. > > file-posix driver now reports discard statistics > > Signed-off-by: Anton Nefedov > --- > qapi/block-core.json | 38

Re: [Qemu-devel] [PATCH v12 6/6] tpm: add ACPI memory clear interface

2018-12-13 Thread Marc-André Lureau
On Thu, Dec 13, 2018 at 4:01 PM Igor Mammedov wrote: > > On Wed, 12 Dec 2018 17:22:21 +0100 > Philippe Mathieu-Daudé wrote: > > > On 9/10/18 10:32 AM, Marc-André Lureau wrote: > > > This allows to pass the last failing test from the Windows HLK TPM 2.0 > > > TCG PPI 1.3 tests. > > > > > > The

Re: [Qemu-devel] [PATCH] block/mirror: add missing coroutine_fn annotations

2018-12-13 Thread Kevin Wolf
Am 13.12.2018 um 12:24 hat Stefan Hajnoczi geschrieben: > Marking a function coroutine_fn currently has no effect on the compiler, > but it documents that this function must be called from coroutine > context and it may yield. This is important information for the > programmer. > > Also, if we

Re: [Qemu-devel] [PATCH] qdev/core: Can not replug device on bus that allows one device

2018-12-13 Thread Igor Mammedov
On Tue, 11 Dec 2018 14:41:00 -0500 Tony Krowiak wrote: > On 12/11/18 10:23 AM, Igor Mammedov wrote: > > On Mon, 10 Dec 2018 14:14:14 -0500 > > Tony Krowiak wrote: > > > >> If the maximum number of devices allowed on a bus is 1 and a device > >> which is plugged into the bus is subsequently

Re: [Qemu-devel] [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals

2018-12-13 Thread Igor Mammedov
On Wed, 12 Dec 2018 16:00:06 +0400 Marc-André Lureau wrote: > Hi > On Mon, Dec 10, 2018 at 8:55 PM Igor Mammedov wrote: > > > > On Mon, 10 Dec 2018 17:45:22 +0100 > > Igor Mammedov wrote: > > > > > On Tue, 4 Dec 2018 18:20:11 +0400 > > > Marc-André Lureau wrote: > > > > > > > Instead of

Re: [Qemu-devel] [PATCH v10 6/9] file-posix: support BDRV_REQ_ALLOCATE

2018-12-13 Thread Anton Nefedov
On 12/12/2018 8:19 PM, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2018 17:11, Anton Nefedov wrote: >> On 5/12/2018 4:25 PM, Vladimir Sementsov-Ogievskiy wrote: >>> 03.12.2018 13:14, Anton Nefedov wrote: } #endif -bs->supported_zero_flags =

Re: [Qemu-devel] [Xen-devel] [PATCH v1] xen_disk: fix memory leak

2018-12-13 Thread Paul Durrant
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xenproject.org] On Behalf > Of Anthony PERARD > Sent: 13 December 2018 11:34 > To: Olaf Hering > Cc: Kevin Wolf ; Stefano Stabellini > ; open list:Block layer core bl...@nongnu.org>; qemu-devel@nongnu.org; Max Reitz ;

Re: [Qemu-devel] [PULL 0/3] 9p patches 2018-12-13

2018-12-13 Thread Greg Kurz
On Thu, 13 Dec 2018 03:20:50 -0800 (PST) no-re...@patchew.org wrote: > Patchew URL: https://patchew.org/QEMU/20181213090343.1137475-1-gr...@kaod.org/ > > > > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Type: series > Message-id:

Re: [Qemu-devel] [PATCH v12 6/6] tpm: add ACPI memory clear interface

2018-12-13 Thread Igor Mammedov
On Wed, 12 Dec 2018 17:22:21 +0100 Philippe Mathieu-Daudé wrote: > On 9/10/18 10:32 AM, Marc-André Lureau wrote: > > This allows to pass the last failing test from the Windows HLK TPM 2.0 > > TCG PPI 1.3 tests. > > > > The interface is described in the "TCG Platform Reset Attack > > Mitigation

Re: [Qemu-devel] [PATCH v3 1/3] Deprecate QMP `cpu-add`

2018-12-13 Thread Kashyap Chamarthy
On Thu, Dec 13, 2018 at 12:05:05PM +0100, Kashyap Chamarthy wrote: > On Thu, Dec 13, 2018 at 07:38:03AM +0100, Thomas Huth wrote: > > On 2018-10-30 13:35, Kashyap Chamarthy wrote: [...] > > > index 1b9c007f12..c86924ad9a 100644 > > > --- a/qemu-deprecated.texi > > > +++ b/qemu-deprecated.texi >

[Qemu-devel] [PATCH v2] hw/s390/ccw.c: Don't take address of packed members

2018-12-13 Thread Peter Maydell
Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the problem by using local copies of the PMCW

Re: [Qemu-devel] [PATCH v10 8/9] qcow2: skip writing zero buffers to empty COW areas

2018-12-13 Thread Vladimir Sementsov-Ogievskiy
03.12.2018 13:14, Anton Nefedov wrote: > If COW areas of the newly allocated clusters are zeroes on the backing image, > efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole > cluster instead of writing explicit zero buffers later in perform_cow(). > [...] > ---

Re: [Qemu-devel] [PATCH v1 0/2] Fix kvm guest debugging of AA32 guests on AA64

2018-12-13 Thread Mark Rutland
Hi Alex, On Thu, Dec 13, 2018 at 11:55:01AM +, Alex Bennée wrote: > Hi, > > This is an attempt to fix debugging of AArch32 binaries when running > under KVM on AArch64 hardware. There are two parts to this, the first is > a handling the possibility of AArch32 software breakpoints with a >

Re: [Qemu-devel] [PATCH v6 00/28] Generalize machine compatibility properties

2018-12-13 Thread Cornelia Huck
On Thu, 13 Dec 2018 01:48:22 +0400 Marc-André Lureau wrote: > Hi, > > During "[PATCH v2 05/10] qom/globals: generalize > object_property_set_globals()" review, Eduardo suggested to rework the > GlobalProperty handling, so that -global is limited to QDev only and > we avoid mixing the machine

Re: [Qemu-devel] [PATCH v2] log: Make glib logging go through QEMU

2018-12-13 Thread Christophe Fergeau
On Thu, Dec 13, 2018 at 11:52:12AM +, Daniel P. Berrangé wrote: > On Thu, Dec 13, 2018 at 12:26:12PM +0100, Christophe Fergeau wrote: > > This commit adds a qemu_init_logging() helper which calls > > g_log_set_default_handler() so that glib logs (g_log, g_warning, ...) > > are handled

Re: [Qemu-devel] [PATCH v6 06/28] compat: replace PC_COMPAT_3_1 & HW_COMPAT_3_1 macros

2018-12-13 Thread Cornelia Huck
On Thu, 13 Dec 2018 01:48:28 +0400 Marc-André Lureau wrote: > Use static arrays instead. > > Suggested-by: Eduardo Habkost > Signed-off-by: Marc-André Lureau > --- > include/hw/boards.h | 3 +++ > include/hw/compat.h | 3 --- > include/hw/i386/pc.h | 4 ++-- > hw/arm/virt.c| 6

Re: [Qemu-devel] [PATCH v10 5/9] block: treat BDRV_REQ_ALLOCATE as serialising

2018-12-13 Thread Anton Nefedov
On 12/12/2018 3:48 PM, Vladimir Sementsov-Ogievskiy wrote: > 05.12.2018 17:01, Anton Nefedov wrote: >> --- a/include/block/block.h >> +++ b/include/block/block.h >> @@ -87,6 +87,9 @@ typedef enum { >> * efficiently allocate the space so it reads as zeroes, or return >> an error. >>

[Qemu-devel] [PATCH v1 1/2] target/arm: kvm64 make guest debug AA32 break point aware

2018-12-13 Thread Alex Bennée
When supported by the hardware we can run AA32 guests or even AA64 EL1 code with AA32 EL0 mode code. Inserting a AA64 break point into AA32 code tends to break things. This is especially acute with gdb as it inserts temporary breakpoints when stepping through code. The heuristic of checking the

<    1   2   3   4   5   >