[PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Add support for the Get Log Page command and basic implementations of the mandatory Error Information, SMART / Health Information and Firmware Slot Information log pages. In violation of the specification, the SMART / Health Information log page does not persist information

[PATCH v3 04/18] hw/block/nvme: add support for the abort command

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Required for compliance with NVMe revision 1.3d. See NVM Express 1.3d, Section 5.1 ("Abort command"). The Abort command is a best effort command; for now, the device always fails to abort the given command. Signed-off-by: Klaus Jensen Signed-off-by: Klaus Jensen Acked-by:

[PATCH v3 03/18] hw/block/nvme: additional tracing

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Add various additional tracing and streamline nvme_identify_ns and nvme_identify_nslist (they do not need to repeat the command, it is already in the trace name). Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 33 +

[PATCH v3 00/18] hw/block/nvme: bump to v1.3

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen This adds mandatory features of NVM Express v1.3 to the emulated NVMe device. v3: * hw/block/nvme: additional tracing - Reverse logic in nvme_cid(). (Philippe) - Move nvme_cid() and nvme_sqid() to source file. (Philippe) * hw/block/nvme: fix missing endian

[PATCH v3 05/18] hw/block/nvme: add temperature threshold feature

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen It might seem weird to implement this feature for an emulated device, but it is mandatory to support and the feature is useful for testing asynchronous event request support, which will be added in a later patch. Signed-off-by: Klaus Jensen Acked-by: Keith Busch

[PATCH v3 10/18] hw/block/nvme: flush write cache when disabled

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen If the write cache is disabled with a Set Features command, flush it if currently enabled. Signed-off-by: Klaus Jensen Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index

[PATCH v3 12/18] hw/block/nvme: support the get/set features select and save fields

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Since the device does not have any persistent state storage, no features are "saveable" and setting the Save (SV) field in any Set Features command will result in a Feature Identifier Not Saveable status code. Similarly, if the Select (SEL) field is set to request saved

[PATCH v3 02/18] hw/block/nvme: fix missing endian conversion

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Fix a missing cpu_to conversion by moving conversion to just before returning instead. Signed-off-by: Klaus Jensen Suggested-by: Philippe Mathieu-Daudé --- hw/block/nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/block/nvme.c

[PATCH v3 06/18] hw/block/nvme: mark fw slot 1 as read-only

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Mark firmware slot 1 as read-only and only support that slot. Signed-off-by: Klaus Jensen Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 3 ++- include/block/nvme.h | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c

[PATCH v3 11/18] hw/block/nvme: add remaining mandatory controller parameters

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Add support for any remaining mandatory controller operating parameters (features). Signed-off-by: Klaus Jensen Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 56 ++- hw/block/trace-events | 2 ++ include/block/nvme.h |

[PATCH v3 17/18] hw/block/nvme: provide the mandatory subnqn field

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen The SUBNQN field is mandatory in NVM Express 1.3. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 07d58aa945f2..e3984157926b 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c

Re: [PATCH 00/13] Reverse debugging

2020-07-06 Thread Pavel Dovgalyuk
Ping. On 26.06.2020 13:19, Pavel Dovgalyuk wrote: GDB remote protocol supports reverse debugging of the targets. It includes 'reverse step' and 'reverse continue' operations. The first one finds the previous step of the execution, and the second one is intended to stop at the last breakpoint

Re: [PATCH v11 1/8] error: auto propagated local_err

2020-07-06 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Introduce a new ERRP_AUTO_PROPAGATE macro, to be used at start of > functions with an errp OUT parameter. > > It has three goals: > > 1. Fix issue with error_fatal and error_prepend/error_append_hint: user > can't see this additional information, because

[PATCH v3 01/18] hw/block/nvme: bump spec data structures to v1.3

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Add missing fields in the Identify Controller and Identify Namespace data structures to bring them in line with NVMe v1.3. This also adds data structures and defines for SGL support which requires a couple of trivial changes to the nvme block driver as well. Signed-off-by:

[PATCH v3 14/18] hw/block/nvme: support identify namespace descriptor list

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Since we are not providing the NGUID or EUI64 fields, we must support the Namespace UUID. We do not have any way of storing a persistent unique identifier, so conjure up a UUID that is just the namespace id. Signed-off-by: Klaus Jensen Reviewed-by: Dmitry Fomichev ---

[PATCH v3 15/18] hw/block/nvme: reject invalid nsid values in active namespace id list

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Reject the nsid broadcast value (0x) and 0xfffe in the Active Namespace ID list. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index fc58f3d76530..af39126cd8d1

[PATCH v3 12/44] qemu-option: Make functions taking Error ** return bool, not void

2020-07-06 Thread Markus Armbruster
See recent commit "error: Document Error API usage rules" for rationale. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qemu/option.h | 16 blockdev.c| 5 ++- util/qemu-option.c| 92

[PATCH v3 31/44] qdev: Use returned bool to check for failure, Coccinelle part

2020-07-06 Thread Markus Armbruster
The previous commit enables conversion of qdev_prop_set_drive_err(..., ); if (err) { ... } to if (!qdev_prop_set_drive_err(..., errp)) { ... } Coccinelle script: @@ identifier fun = qdev_prop_set_drive_err; expression list args; typedef Error;

[PATCH v3 26/44] qom: Make functions taking Error ** return bool, not void

2020-07-06 Thread Markus Armbruster
See recent commit "error: Document Error API usage rules" for rationale. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/qom/object.h| 42 ++ include/qom/object_interfaces.h | 12 +++- include/qom/qom-qobject.h | 4 +- qom/object.c

[PATCH v3 43/44] qdev: Ignore Error objects where the return value suffices

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- hw/core/qdev-properties.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 9d52c0c0f4..31c59aa80a 100644 --- a/hw/core/qdev-properties.c +++

Re: [PATCH v3 1/2] net: tap: check if the file descriptor is valid before using it

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/2/20 10:18 AM, Philippe Mathieu-Daudé wrote: > On 7/2/20 10:17 AM, Laurent Vivier wrote: >> On 02/07/2020 10:00, Philippe Mathieu-Daudé wrote: >>> On 7/1/20 9:39 PM, Laurent Vivier wrote: qemu_set_nonblock() checks that the file descriptor can be used and, if not, crashes QEMU. An

[PULL 06/31] iotests.py: Add qemu_img_pipe_and_status()

2020-07-06 Thread Max Reitz
This function will be used by the next patch, which intends to check both the exit code and qemu-img's output. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-5-mre...@redhat.com> Reviewed-by: Maxim Levitsky [mreitz: Rebased on 49438972b8c2e] Signed-off-by: Max Reitz ---

[PULL 20/31] block/qcow2: implement blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Currently the implementation only supports amending the encryption options, unlike the qemu-img version Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-14-mlevi...@redhat.com> Signed-off-by: Max

[PULL 25/31] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy In case when get_image_offset() returns -1, we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and "qemu-io -c map" commands. For qemu-img map, the change

Re: [PATCH v3 03/44] qdev: Use returned bool to check for qdev_realize() etc. failure

2020-07-06 Thread Greg Kurz
On Mon, 6 Jul 2020 10:09:09 +0200 Markus Armbruster wrote: > Convert > > foo(..., ); > if (err) { > ... > } > > to > > if (!foo(..., )) { > ... > } > > for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and their > wrappers

[PULL 16/31] block/qcow2: extend qemu-img amend interface with crypto options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Now that we have all the infrastructure in place, wire it in the qcow2 driver and expose this to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-9-mlevi...@redhat.com> Signed-off-by: Max

[PATCH v3 09/18] hw/block/nvme: move NvmeFeatureVal into hw/block/nvme.h

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen The NvmeFeatureVal does not belong with the spec-related data structures in include/block/nvme.h that is shared between the block-level nvme driver and the emulated nvme device. Move it into the nvme device specific header file as it is the only user of the structure. Also,

Re: [PATCH v4 2/2] nvme: allow cmb and pmr to be enabled on same device

2020-07-06 Thread Klaus Jensen
On Jul 2 16:33, Andrzej Jakowski wrote: > On 7/2/20 10:51 AM, Klaus Jensen wrote: > > On Jul 2 08:07, Andrzej Jakowski wrote: > >> On 7/2/20 3:31 AM, Klaus Jensen wrote: > >>> Aight, an update here. This only happens when QEMU is run with a virtual > >>> IOMMU. Otherwise, the kernel is happy. >

[PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines

2020-07-06 Thread Thomas Huth
We have the same check in three places. Let's unify it in a central place instead. Message-Id: <20200622104339.21000-1-th...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/qtest/device-introspect-test.c | 5 - tests/qtest/libqtest.c | 4

[PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask()

2020-07-06 Thread Thomas Huth
From: Thomas Huth hw_error() dumps the CPU state and exits QEMU. This is ok during initial code development (to see where the guest code is currently executing), but it is certainly not the desired behavior that we want to present to normal users, and it can also cause trouble when e.g. fuzzing

[Bug 1886343] Re: configure has non-posix bash syntax

2020-07-06 Thread Thomas Huth
Thanks for reporting! Seems like others ran into this problem, too - a patch is already on the list: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg08967.html ** Changed in: qemu Status: New => Confirmed -- You received this bug notification because you are a member of qemu-

Re: [PATCH v11 8/8] xen: introduce ERRP_AUTO_PROPAGATE

2020-07-06 Thread Vladimir Sementsov-Ogievskiy
04.07.2020 19:36, Philippe Mathieu-Daudé wrote: On 7/3/20 11:08 AM, Vladimir Sementsov-Ogievskiy wrote: If we want to add some info to errp (by error_prepend() or error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. Otherwise, this info will not be added when errp == _fatal (the

[PATCH v3 04/44] macio: Tidy up error handling in macio_newworld_realize()

2020-07-06 Thread Markus Armbruster
macio_newworld_realize() effectively ignores ns->gpio realization errors, leaking the Error object. Fortunately, macio_gpio_realize() can't actually fail. Tidy up. Cc: Mark Cave-Ayland Cc: David Gibson Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Acked-by: David Gibson

[PATCH v3 01/44] error: Improve examples in error.h's big comment

2020-07-06 Thread Markus Armbruster
Show errp instead of where is actually unusual. Add a missing declaration. Add a second error pileup example. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz --- include/qapi/error.h | 19 +++ 1

[PATCH v3 15/44] hmp: Eliminate a variable in hmp_migrate_set_parameter()

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- monitor/hmp-cmds.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 2b0b58a336..d7810cb564 100644 ---

[PATCH v3 11/44] qemu-option: Replace opt_set() by cleaner opt_validate()

2020-07-06 Thread Markus Armbruster
opt_set() frees its argument @value on failure. Slightly unclean; functions ideally do nothing on failure. To tidy this up, move opt_create() from opt_set() into its callers, along with the cleanup. Rename opt_set() to opt_validate(), noting its similarity to qemu_opts_validate(). Drop

[PATCH v3 13/44] qemu-option: Use returned bool to check for failure

2020-07-06 Thread Markus Armbruster
The previous commit enables conversion of foo(..., ); if (err) { ... } to if (!foo(..., )) { ... } for QemuOpts functions that now return true / false on success / error. Coccinelle script: @@ identifier fun = { opts_do_parse,

Re: [PATCH v3 0/2] net: tap: check file descriptor can be used

2020-07-06 Thread Laurent Vivier
Hi, ping. I think it would be good to have this fix in next release. Thanks, Laurent On 01/07/2020 21:39, Laurent Vivier wrote: > v3: move qemu_fd_is_valid() checking into a new function > qemu_try_set_nonblock(), and use qemu_try_set_nonblock() in > qemu_set_nonblock(). > > v2: Add

[PATCH v3 20/44] qom: Use error_reportf_err() instead of g_printerr() in examples

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qom/object.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 94a61ccc3f..b70edd8cd9 100644 ---

[PATCH v3 39/44] qapi: Smooth visitor error checking in generated code

2020-07-06 Thread Markus Armbruster
Use visitor functions' return values to check for failure. Eliminate error_propagate() that are now unnecessary. Delete @err that are now unused. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/devel/qapi-code-gen.txt | 60 ++--

[PATCH v3 19/44] s390x/pci: Fix harmless mistake in zpci's property fid's setter

2020-07-06 Thread Markus Armbruster
s390_pci_set_fid() sets zpci->fid_defined to true even when visit_type_uint32() failed. Reproducer: "-device zpci,fid=junk". Harmless in practice, because qdev_device_add() then fails, throwing away @zpci. Fix it anyway. Cc: Matthew Rosato Cc: Cornelia Huck Signed-off-by: Markus Armbruster

[PATCH v3 30/44] qdev: Make functions taking Error ** return bool, not void

2020-07-06 Thread Markus Armbruster
See recent commit "error: Document Error API usage rules" for rationale. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/hw/qdev-properties.h | 4 ++-- hw/core/qdev-properties-system.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v3 37/44] block/parallels: Simplify parallels_open() after previous commit

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/parallels.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 180dd41e2b..cb5259ac44 100644 --- a/block/parallels.c

Re: [PATCH v2] fcntl: Add 32bit filesystem mode

2020-07-06 Thread Linus Walleij
On Tue, Jun 23, 2020 at 12:08 PM Peter Maydell wrote: > On Fri, 29 May 2020 at 08:22, Linus Walleij wrote: > > > > It was brought to my attention that this bug from 2018 was > > still unresolved: 32 bit emulators like QEMU were given > > 64 bit hashes when running 32 bit emulation on 64 bit

Re: [PATCH 3/3] target/nios2: Use gen_io_start around wrctl instruction

2020-07-06 Thread Peter Maydell
On Sun, 5 Jul 2020 at 21:54, Max Filippov wrote: > > On Sun, Jul 5, 2020 at 11:16 AM Max Filippov wrote: > > On Sun, Jul 5, 2020 at 10:09 AM Peter Maydell > > wrote: > > > On Thu, 2 Jul 2020 at 19:53, Richard Henderson > > > wrote: > > > > This isn't right. Not so much the gen_io_start

Re: [PATCH v3 15/18] hw/block/nvme: reject invalid nsid values in active namespace id list

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:13 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Reject the nsid broadcast value (0x) and 0xfffe in the > Active Namespace ID list. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git

Re: [PATCH v3 17/18] hw/block/nvme: provide the mandatory subnqn field

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:13 AM, Klaus Jensen wrote: > From: Klaus Jensen > > The SUBNQN field is mandatory in NVM Express 1.3. > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/hw/block/nvme.c b/hw/block/nvme.c > index

[PULL 17/31] iotests: qemu-img tests for luks key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This commit adds two tests, which test the new amend interface of both luks raw images and qcow2 luks encrypted images. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Let 293 verify that LUKS works; drop $(seq) usage from 293; drop 293 and

[PULL 22/31] qemu-img: convert: don't use unallocated_blocks_are_zero

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy qemu-img convert wants to distinguish ZERO which comes from short backing files. unallocated_blocks_are_zero field of bdi is unrelated: space after EOF is always considered to be zero anyway. So, just make post_backing_zero true in case of short backing file.

[PULL 11/31] block/amend: add 'force' option

2020-07-06 Thread Max Reitz
From: Maxim Levitsky 'force' option will be used for some unsafe amend operations. This includes things like erasing last keyslot in luks based formats (which destroys the data, unless the master key is backed up by external means), but that _might_ be desired result. Signed-off-by: Maxim

[PULL 10/31] qcrypto/luks: implement encryption key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Next few patches will expose that functionality to the user. Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id: <20200608094030.670121-3-mlevi...@redhat.com> Signed-off-by: Max Reitz --- qapi/crypto.json| 59 ++- crypto/block-luks.c | 416

[PULL 19/31] block/crypto: implement blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Reviewed-by: Max Reitz Message-Id: <20200608094030.670121-13-mlevi...@redhat.com> Signed-off-by: Max Reitz --- qapi/block-core.json | 14 - block/crypto.c | 72

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 12:01 PM, Marc-André Lureau wrote: > Hi > > On Mon, Jul 6, 2020 at 12:44 PM Philippe Mathieu-Daudé > wrote: >> >> On 1/7/20 4:04 PM, Marc-André Lureau wrote: >>> No longer used in the tree. The comment about user_creatable is still >>> quite relevant, but there is already a similar

[PATCH v3 08/18] hw/block/nvme: add support for the asynchronous event request command

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Add support for the Asynchronous Event Request command. Required for compliance with NVMe revision 1.3d. See NVM Express 1.3d, Section 5.2 ("Asynchronous Event Request command"). Mostly imported from Keith's qemu-nvme tree. Modified with a max number of queued events

[PATCH v3 13/18] hw/block/nvme: make sure ncqr and nsqr is valid

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen 0x is not an allowed value for NCQR and NSQR in Set Features on Number of Queues. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v3 18/18] hw/block/nvme: bump supported version to v1.3

2020-07-06 Thread Klaus Jensen
From: Klaus Jensen Bump the supported NVM Express version to v1.3. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index

Re: [PATCH v3] target/ppc: add vmsumudm vmsumcud instructions

2020-07-06 Thread David Gibson
On Mon, Jun 22, 2020 at 11:25:01PM -0500, Lijun Pan wrote: > vmsumudm (Power ISA 3.0) - Vector Multiply-Sum Unsigned Doubleword Modulo > VA-form. > vmsumcud (Power ISA 3.1) - Vector Multiply-Sum & write Carry-out Unsigned > Doubleword VA-form. If this is only in ISA 3.1, shouldn't it be

[PATCH v3 07/44] qemu-option: Make uses of find_desc_by_name() more similar

2020-07-06 Thread Markus Armbruster
This is to make the next commit easier to review. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- util/qemu-option.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/util/qemu-option.c

[PATCH v3 32/44] error: Avoid unnecessary error_propagate() after error_setg()

2020-07-06 Thread Markus Armbruster
Replace error_setg(, ...); error_propagate(errp, err); by error_setg(errp, ...); Related pattern: if (...) { error_setg(, ...); goto out; } ... out: error_propagate(errp, err); return; When all paths to label out are that way, replace by

[PATCH v3 29/44] qom: Make functions taking Error ** return bool, not 0/-1

2020-07-06 Thread Markus Armbruster
Just for consistency. Also fix the example in object_set_props()'s documentation. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- include/qom/object.h | 28 +++- qom/object.c | 14 +++--- 2 files changed, 18 insertions(+), 24 deletions(-)

[PATCH v3 23/44] qom: Don't handle impossible object_property_get_link() failure

2020-07-06 Thread Markus Armbruster
Don't handle object_property_get_link() failure that can't happen unless the programmer screwed up, pass _abort. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/bcm2835_peripherals.c | 7 +-- hw/arm/bcm2836.c | 7

Re: [PATCH v3 04/10] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Vladimir Sementsov-Ogievskiy
06.07.2020 11:28, Max Reitz wrote: On 28.05.20 11:43, Vladimir Sementsov-Ogievskiy wrote: In case when get_image_offset() returns -1, we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and

[PATCH v1] target/riscv: fix pmp implementation

2020-07-06 Thread Alexandre Mergnat
The end address calculation for NA4 mode is wrong because the address used isn't shifted. That imply all NA4 setup are not applied by the PMP. The solution is to use the shifted address calculated for start address variable. Modifications are tested on Zephyr OS userspace test suite which works

[PULL 21/31] iotests: add tests for blockdev-amend

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This commit adds two tests that cover the new blockdev-amend functionality of luks and qcow2 driver Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Let 295 verify that LUKS works; drop 295 and 296 from the auto group] Signed-off-by: Max

[PULL 09/31] qcrypto/core: add generic infrastructure for crypto options amendment

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This will be used first to implement luks keyslot management. block_crypto_amend_opts_init will be used to convert qemu-img cmdline to QCryptoBlockAmendOptions Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id:

[PULL 15/31] block/crypto: implement the encryption key management

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This implements the encryption key management using the generic code in qcrypto layer and exposes it to the user via qemu-img This code adds another 'write_func' because the initialization write_func works directly on the underlying file, and amend works on instance of luks

[PULL 18/31] block/core: add generic infrastructure for x-blockdev-amend qmp command

2020-07-06 Thread Max Reitz
From: Maxim Levitsky blockdev-amend will be used similiar to blockdev-create to allow on the fly changes of the structure of the format based block devices. Current plan is to first support encryption keyslot management for luks based formats (raw and embedded in qcow2) Signed-off-by: Maxim

Re: [PATCH v3 05/16] block/nvme: Improve error message when IO queue creation failed

2020-07-06 Thread Stefan Hajnoczi
On Sat, Jul 04, 2020 at 11:30:40PM +0200, Philippe Mathieu-Daudé wrote: > Do not use the same error message for different failures. > Display a different error whether it is the CQ or the SQ. > > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 4 ++-- > 1 file changed, 2

[PATCH] ram: add support for dirty page tracking

2020-07-06 Thread Bingsong Si
In production, the VM with insentive memory activity maybe failed to migrate, because of the change of memory in the VM greater than the throughtput of the network interface, and we want to identify it before migration. 1. dirty tracking start: virsh qemu-monitor-command --hmp dirty_track 2.

Re: [PATCH v11 8/8] xen: introduce ERRP_AUTO_PROPAGATE

2020-07-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 7/3/20 11:08 AM, Vladimir Sementsov-Ogievskiy wrote: >> If we want to add some info to errp (by error_prepend() or >> error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro. >> Otherwise, this info will not be added when errp == _fatal >> (the program

[PATCH v3 00/44] Less clumsy error checking

2020-07-06 Thread Markus Armbruster
When the Error API was created, we adopted the (unwritten) rule to return void when the function returns no useful value on success, unlike GError, which recommends to return true on success and false on error then. When a function returns a distinct error value, say false, a checked call that

[PATCH v3 08/44] qemu-option: Factor out helper find_default_by_name()

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- util/qemu-option.c | 47 ++ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index

[PATCH v3 10/44] qemu-option: Factor out helper opt_create()

2020-07-06 Thread Markus Armbruster
There is just one use so far. The next commit will add more. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- util/qemu-option.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git

[PATCH v3 40/44] qapi: Purge error_propagate() from QAPI core

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qapi/qapi-visit-core.c | 40 +++- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 5a9c47aabf..7e5f40e7f0 100644 ---

[PATCH v3 05/44] virtio-crypto-pci: Tidy up virtio_crypto_pci_realize()

2020-07-06 Thread Markus Armbruster
virtio_crypto_pci_realize() continues after realization of its "virtio-crypto-device" fails. Only an object_property_set_link() follows; looks harmless to me. Tidy up anyway: return after failure, just like virtio_rng_pci_realize() does. Cc: "Gonglei (Arei)" Cc: Michael S. Tsirkin

Re: [PATCH v3 2/2] PCI: vmd: Use Shadow MEMBAR registers for QEMU/KVM guests

2020-07-06 Thread Lorenzo Pieralisi
On Wed, May 27, 2020 at 11:02:40PM -0400, Jon Derrick wrote: > VMD device 28C0 natively assists guest passthrough of the VMD endpoint > through the use of shadow registers that provide Host Physical Addresses > to correctly assign bridge windows. These shadow registers are only > available if VMD

Re: [PATCH 0/2] Add new features for intel processor

2020-07-06 Thread Paolo Bonzini
On 06/07/20 01:17, Cathy Zhang wrote: > This patchset is to add two new features for intel processors > which support them, like Sapphire Rapids. SERIALIZE is a faster > serializing instruction which does not modify registers, > arithmetic flags or memory, will not cause VM exit. TSX suspend >

Re: [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/4/20 11:30 PM, Philippe Mathieu-Daudé wrote: > To be able to use multiple queues on the same hardware, > we need to have each queuepair able to receive IRQ > notifications in the correct AIO context. > > The AIO context and the notification handler have to be proper > to each queue, not to

[PULL 02/31] qcow2: Fix preallocation on images with unaligned sizes

2020-07-06 Thread Max Reitz
From: Alberto Garcia When resizing an image with qcow2_co_truncate() using the falloc or full preallocation modes the code assumes that both the old and new sizes are cluster-aligned. There are two problems with this: 1) The calculation of how many clusters are involved does not always

[PULL 00/31] Block patches

2020-07-06 Thread Max Reitz
The following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git

[PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure check

2020-07-06 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy ret may be > 0 on success path at this point. Fix assertion, which may crash currently. Fixes: 4ce5dd3e9b5ee0fac18625860eb3727399ee965e Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20200526181347.489557-1-vsement...@virtuozzo.com> Signed-off-by:

[PULL 03/31] iotests: Make _filter_img_create more active

2020-07-06 Thread Max Reitz
Right now, _filter_img_create just filters out everything that looks format-dependent, and applies some filename filters. That means that we have to add another filter line every time some format gets a new creation option. This can be avoided by instead discarding everything and just keeping

Re: [PATCH v2] hw/core/qdev: Increase qdev_realize() kindness

2020-07-06 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Since commit 510ef98dca5, qdev_realize() aborts if bus-less > device is realized on a bus. Be kind with the developer by > displaying a hint about what is wrong. > > Signed-off-by: Philippe Mathieu-Daudé > --- > v2: Use errp (bonzini suggestion) > > Paolo, I was

[PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap

2020-07-06 Thread Thomas Huth
From: Alexander Bulekov We used shm_open with mmap to share libfuzzer's coverage bitmap with child (runner) processes. The same functionality can be achieved with MAP_SHARED | MAP_ANONYMOUS, since we do not care about naming or permissioning the shared memory object. Signed-off-by: Alexander

[PULL 0/6] qtest and misc patches

2020-07-06 Thread Thomas Huth
Hi Peter, the following changes since commit eb6490f544388dd24c0d054a96dd304bc7284450: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200703' into staging (2020-07-04 16:08:41 +0100) are available in the Git repository at: https://gitlab.com/huth/qemu.git

[PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork

2020-07-06 Thread Thomas Huth
From: Alexander Bulekov The qtest_enabled check introduced in d6919e4 always returns false, as it is called prior to configure_accelerators(). Instead of trying to skip rcu_disable_atfork in qemu_main, simply call rcu_enable_atfork in the fuzzer, after qemu_main returns. Reported-by: Thomas

[PATCH v3 27/44] qom: Use returned bool to check for failure, Coccinelle part

2020-07-06 Thread Markus Armbruster
The previous commit enables conversion of foo(..., ); if (err) { ... } to if (!foo(..., errp)) { ... } for QOM functions that now return true / false on success / error. Coccinelle script: @@ identifier fun = { object_apply_global_props,

[PATCH v3 18/44] qapi: Use returned bool to check for failure, manual part

2020-07-06 Thread Markus Armbruster
The previous commit used Coccinelle to convert from checking the Error object to checking the return value. Convert a few more manually. Also tweak control flow in places to conform to the conventional "if error bail out" pattern. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake

[PATCH v3 38/44] qapi: Smooth another visitor error checking pattern

2020-07-06 Thread Markus Armbruster
Convert visit_type_FOO(v, ..., , ); ... if (err) { ... } to visit_type_FOO(v, ..., , errp); ... if (!ptr) { ... } for functions that set @ptr to non-null / null on success / error. Eliminate error_propagate() that are now unnecessary. Delete

[PATCH v3 44/44] hmp: Ignore Error objects where the return value suffices

2020-07-06 Thread Markus Armbruster
qdev_print_props() receives and throws away Error objects just to check for object_property_get_str() and object_property_print() failure. Unnecessary, both return suitable values, so use those instead. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qdev-monitor.c | 12

[PATCH v3 28/44] qom: Use returned bool to check for failure, manual part

2020-07-06 Thread Markus Armbruster
The previous commit used Coccinelle to convert from checking the Error object to checking the return value. Convert a few more manually. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- hw/core/bus.c | 6 +- hw/core/qdev.c | 7 +--

Re: [PATCH v3 00/44] Less clumsy error checking

2020-07-06 Thread Markus Armbruster
diff between v2 rebased and v3, with hunks that change only whitespace dropped: diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 6d8f4b6928..7781c23a42 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -235,12 +235,12 @@ opts_start_list(Visitor *v, const char *name,

[PATCH v3 42/44] qemu-img: Ignore Error objects where the return value suffices

2020-07-06 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qemu-img.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index fc405ee171..a6af0eaf80 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -464,22 +464,18 @@ static int

Re: [PATCH v3 03/18] hw/block/nvme: additional tracing

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:12 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Add various additional tracing and streamline nvme_identify_ns and > nvme_identify_nslist (they do not need to repeat the command, it is > already in the trace name). > > Signed-off-by: Klaus Jensen > --- > hw/block/nvme.c

Re: [PATCH v3 02/18] hw/block/nvme: fix missing endian conversion

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 8:12 AM, Klaus Jensen wrote: > From: Klaus Jensen > > Fix a missing cpu_to conversion by moving conversion to just before > returning instead. > > Signed-off-by: Klaus Jensen > Suggested-by: Philippe Mathieu-Daudé > --- > hw/block/nvme.c | 6 +++--- > 1 file changed, 3

Re: [PULL 36/37] qdev: remove QDEV_PROP_PTR

2020-07-06 Thread Marc-André Lureau
Hi On Mon, Jul 6, 2020 at 12:44 PM Philippe Mathieu-Daudé wrote: > > On 1/7/20 4:04 PM, Marc-André Lureau wrote: > > No longer used in the tree. The comment about user_creatable is still > > quite relevant, but there is already a similar comment in qdev-core.h. > > > > Reviewed-by: Peter Maydell

[REPORT] [GSoC - TCG Continuous Benchmarking] [#3] QEMU 5.0 and 5.1-pre-soft-freeze Dissect Comparison

2020-07-06 Thread Ahmed Karaman
Hi, The third report of the TCG Continuous Benchmarking series utilizes the tools presented in the previous report for comparing the performance of 17 different targets across two versions of QEMU. The two versions addressed are 5.0 and 5.1-pre-soft-freeze (current state of QEMU). After

Re: [PULL 00/31] Block patches

2020-07-06 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200706100432.2301919-1-mre...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PULL 00/31] Block patches Type: series Message-id: 20200706100432.2301919-1-mre...@redhat.com === TEST

Re: [PATCH] hw/core/qdev: Increase qdev_realize() kindness

2020-07-06 Thread Markus Armbruster
Paolo Bonzini writes: > Are we sure that qdev_realize is never called with user-provided input? If The only way to call qdev_realize() with a user-provided bus is -device / device_add via qdev_device_add(). qdev_device_add() carefully checks the user-provided bus before passing it to

Re: [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask()

2020-07-06 Thread Thomas Huth
On 06/07/2020 09.28, Thomas Huth wrote: > From: Thomas Huth > > hw_error() dumps the CPU state and exits QEMU. This is ok during initial > code development (to see where the guest code is currently executing), > but it is certainly not the desired behavior that we want to present to > normal

  1   2   3   4   5   >