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

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 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 Bul

[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 tags/pull-

[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 Huth

[PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine

2020-07-06 Thread Thomas Huth
We can use the image from the advent calendar 2018 to test the sun4u machine. It's not using the "QEMU advent calendar" string, so we can not use the do_test_advcal_2018() from boot_linux_console.py, thus let's also put it into a separate file to also be able to add an entry to the MAINTAINERS file

[PULL 4/6] configure / util: Auto-detect the availability of openpty()

2020-07-06 Thread Thomas Huth
Recent versions of Solaris (v11.4) now feature an openpty() function, too, causing a build failure since we ship our own implementation of openpty() for Solaris in util/qemu-openpty.c so far. Since there are now both variants available in the wild, with and without this function (and illumos is sai

[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 d

Re: [PATCH v4 00/11] Add several Power ISA 3.1 32/64-bit vector instructions

2020-07-06 Thread Greg Kurz
On Sun, 5 Jul 2020 19:10:46 +1000 David Gibson wrote: > On Wed, Jul 01, 2020 at 06:43:35PM -0500, Lijun Pan wrote: > > This patch series add several newly introduced 32/64-bit vector > > instructions in Power ISA 3.1. Power ISA 3.1 flag is introduced in > > this version. In v4 version, coding sty

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 user

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 == &error_fatal >> (the pr

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 conditiona

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 == &error_fatal (th

[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- de

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

2020-07-06 Thread Markus Armbruster
Show errp instead of &err where &err 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 +++

[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 redundan

[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 --- a/monitor/hmp-cmd

[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 Reviewed-

[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 21/44] qom: Rename qdev_get_type() to object_get_type()

2020-07-06 Thread Markus Armbruster
Commit 2f262e06f0 lifted qdev_get_type() from qdev to object without renaming it accordingly. Do that now. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Vladimir Sementsov-Ogievskiy --- qom/object.c | 4 ++-- 1 file changed, 2 inser

[PATCH v3 14/44] block: Avoid error accumulation in bdrv_img_create()

2020-07-06 Thread Markus Armbruster
When creating an image fails because the format doesn't support option "backing_file" or "backing_fmt", bdrv_img_create() first has qemu_opt_set() put a generic error into @local_err, then puts the real error into @errp with error_setg(), and then propagates the former to the latter, which throws a

[PATCH v3 02/44] error: Document Error API usage rules

2020-07-06 Thread Markus Armbruster
This merely codifies existing practice, with one exception: the rule advising against returning void, where existing practice is mixed. 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 recommen

[PATCH v3 09/44] qemu-option: Simplify around 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 | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/util/qemu-option.c b/util/qemu-option.c index 14e211ddd8..e7b540a21b 100644 --- a/uti

[PATCH v3 24/44] qom: Use return values to check for error where that's simpler

2020-07-06 Thread Markus Armbruster
When using the Error object to check for error, we need to receive it into a local variable, then propagate() it to @errp. Using the return value permits allows receiving it straight to @errp. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qom/object.c | 25 ++

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

2020-07-06 Thread Markus Armbruster
Convert foo(..., &err); if (err) { ... } to if (!foo(..., &err)) { ... } for qdev_realize(), qdev_realize_and_unref(), qbus_realize() and their wrappers isa_realize_and_unref(), pci_realize_and_unref(), sysbus_realize(), sysbus_realize_and_unref(), usb_realiz

[PATCH v3 34/44] error: Eliminate error_propagate() with Coccinelle, part 2

2020-07-06 Thread Markus Armbruster
When all we do with an Error we receive into a local variable is propagating to somewhere else, we can just as well receive it there right away. The previous commit did that with a Coccinelle script I consider fairly trustworthy. This commit uses the same script with the matching of return taken

[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 1df55bc881

[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 a/util/qemu-opt

[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 pas

[PATCH v3 41/44] error: Avoid error_propagate() after migrate_add_blocker()

2020-07-06 Thread Markus Armbruster
When migrate_add_blocker(blocker, &errp) is followed by error_propagate(errp, err), we can often just as well do migrate_add_blocker(..., errp). Do that with this Coccinelle script: @@ expression blocker, err, errp; expression ret; @@ -ret = migrate_add_blocker(blocker, &e

[PATCH v3 22/44] qom: Crash more nicely on object_property_get_link() failure

2020-07-06 Thread Markus Armbruster
Pass &error_abort instead of NULL where the returned value is dereferenced or asserted to be non-null. Drop a now redundant assertion. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- hw/core/platform-bus.c | 6 +++--- hw/ppc/spapr_drc

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

2020-07-06 Thread Markus Armbruster
The previous commit enables conversion of visit_foo(..., &err); if (err) { ... } to if (!visit_foo(..., errp)) { ... } for visitor functions that now return true / false on success / error. Coccinelle script: @@ identifier fun =~ "check_list|input_t

[PATCH v3 06/44] qemu-option: Check return value instead of @err where convenient

2020-07-06 Thread Markus Armbruster
Convert uses like opts = qemu_opts_create(..., &err); if (err) { ... } to opts = qemu_opts_create(..., &err); if (!opts) { ... } Eliminate error_propagate() that are now unnecessary. Delete @err that are now unused. Signed-off-by: Markus Armbruster Rev

[PATCH v3 36/44] error: Reduce unnecessary error propagation

2020-07-06 Thread Markus Armbruster
When all we do with an Error we receive into a local variable is propagating to somewhere else, we can just as well receive it there right away, even when we need to keep error_propagate() for other error paths. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- block.c |

[PATCH v3 35/44] error: Eliminate error_propagate() manually

2020-07-06 Thread Markus Armbruster
When all we do with an Error we receive into a local variable is propagating to somewhere else, we can just as well receive it there right away. The previous two commits did that for sufficiently simple cases with Coccinelle. Do it for several more manually. Signed-off-by: Markus Armbruster Rev

[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(..., &err); 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 Reviewe

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

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

[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(..., &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 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 13/44] qemu-option: Use returned bool to check for failure

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

[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 --- a/include/qom

[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 Re

[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 a/include/hw/q

[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 ++-- scripts/qapi/c

[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 --- a/qapi/qapi-v

[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 Signed-off-b

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

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

[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(-) d

[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 &error_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 +

[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 +++ b/hw/core/q

[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

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

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/6/20 9:09 AM, Markus Armbruster wrote: > 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é >> ---

[PATCH v3 16/44] qapi: Make visitor 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 --- docs/devel/qapi-code-gen.txt | 51 +-- include/qapi/clone-visitor.h | 8 +- include/qapi/visitor-impl.h

[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 +-- hw/s390x/s390-v

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, Generic

[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 add_old_style_options

[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 v3 04/10] block/vpc: return ZERO block-status when appropriate

2020-07-06 Thread Max Reitz
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 "qemu-io -c map" commands. For

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

2020-07-06 Thread Philippe Mathieu-Daudé
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 > Signed-off-by: Marc-André Lureau > --- > include/hw/qdev-properties.h | 2

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 as

Re: [PATCH v3 2/2] net: detect errors from probing vnet hdr flag for TAP devices

2020-07-06 Thread Philippe Mathieu-Daudé
On 7/1/20 9:39 PM, Laurent Vivier wrote: > From: "Daniel P. Berrange" > > When QEMU sets up a tap based network device backend, it mostly ignores errors > reported from various ioctl() calls it makes, assuming the TAP file descriptor > is valid. This assumption can easily be violated when the use

Re: [PATCH v2] MAINTAINERS: Cover the firmware JSON schema

2020-07-06 Thread Daniel P . Berrangé
On Fri, Jul 03, 2020 at 08:34:50PM +0200, Philippe Mathieu-Daudé wrote: > Add an entry to cover firmware.json (see commit 3a0adfc9bf: > schema that describes the different uses and properties of > virtual machine firmware). > > Cc: Laszlo Ersek > Cc: Gerd Hoffmann > Cc: Michael S. Tsirkin > Cc:

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 syste

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 portio

Re: [PATCH v7 09/17] hw/sd/sdcard: Special case the -ENOMEDIUM error

2020-07-06 Thread Peter Maydell
On Mon, 6 Jul 2020 at 06:52, Markus Armbruster wrote: > This is TYPE_SD_CARD's ("sd-card"). What exactly does that device > model? It is I think supposed to be an SD card. The modelling may well be odd -- it's a qomification of a pre-existing abstraction layer that predates QOM and qbus. > If i

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 c

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 "q

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 > load

Re: [PATCH v2 3/7] docs: document non-net VHOST_USER_GET_FEATURES behavior

2020-07-06 Thread Stefan Hajnoczi
On Wed, Jun 10, 2020 at 01:01:26AM -0400, Michael S. Tsirkin wrote: > On Tue, Jun 09, 2020 at 06:02:14PM +0100, Stefan Hajnoczi wrote: > > +For devices other than the networking device, masters may assume the > > following > > +feature bits are always set in ``VHOST_USER_GET_FEATURES`` for > > co

[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

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 th

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 a/hw/block/

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 07d58aa945f2..e3984

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 insertions(+)

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

[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 g

[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 tags/pull-block-202

[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: Ma

[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 wha

[PULL 05/31] iotests/common.rc: Add _require_working_luks

2020-07-06 Thread Max Reitz
That the luks driver is present is little indication on whether it is actually working. Without the crypto libraries linked in, it does not work. So add this function, which tries to create a luks image to see whether that actually works. Signed-off-by: Max Reitz Message-Id: <20200625125548.870

[PULL 07/31] iotests.py: Add (verify|has)_working_luks()

2020-07-06 Thread Max Reitz
Similar to _require_working_luks for bash tests, these functions can be used to check whether our luks driver can actually create images. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-6-mre...@redhat.com> Reviewed-by: Maxim Levitsky --- tests/qemu-iotests/iotests.py | 39 +

[PULL 08/31] iotests: Check whether luks works

2020-07-06 Thread Max Reitz
Whenever running an iotest for the luks format, we should check whether luks actually really works. Tests that try to create luks-encrypted qcow2 images should do the same. Signed-off-by: Max Reitz Message-Id: <20200625125548.870061-7-mre...@redhat.com> Reviewed-by: Maxim Levitsky --- tests/qe

[PULL 14/31] block/crypto: rename two functions

2020-07-06 Thread Max Reitz
From: Maxim Levitsky rename the write_func to create_write_func, and init_func to create_init_func. This is preparation for other write_func that will be used to update the encryption keys. No functional changes Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé Message-Id: <20200

[PULL 04/31] iotests: filter few more luks specific create options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky This allows more tests to be able to have same output on both qcow2 luks encrypted images and raw luks images Signed-off-by: Maxim Levitsky Signed-off-by: Max Reitz Reviewed-by: Maxim Levitsky Message-Id: <20200625125548.870061-3-mre...@redhat.com> --- tests/qemu-iotest

[PULL 13/31] block/amend: refactor qcow2 amend options

2020-07-06 Thread Max Reitz
From: Maxim Levitsky Some qcow2 create options can't be used for amend. Remove them from the qcow2 create options and add generic logic to detect such options in qemu-img Signed-off-by: Maxim Levitsky Reviewed-by: Daniel P. Berrangé [mreitz: Dropped some iotests reference output hunks that bec

[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 --- tests/qemu

[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 Reitz

[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: <20200608094030.670121-2-mlevi...@redh

[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 Reit

[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 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 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. S

[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 Levit

[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 ---

  1   2   3   4   5   >