Re: [PATCH trivial] qemu-img: factor out parse_output_format() and use it in the code

2024-02-09 Thread Michael Tokarev
07.02.2024 20:52, Michael Tokarev : Use common code and simplify error message I've sent this as part of qemu-img --help/options refactoring series, done in that context so this path does not make sense anymore. /mjt

Re: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 09/02/2024 11:37, Peter Maydell wrote: On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/sun4m.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 00/23] qemu-img: refersh options and --help handling

2024-02-09 Thread Michael Tokarev
10.02.2024 00:22, Michael Tokarev wrote: Quite big patchset implementing normal, readable qemu-img --help (and qemu-img COMMAND --help) output with readable descriptions, and adding many long options in the process. ... I forgot to run checkpatch.pl - minor edits, the result is at

Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
On 09/02/2024 11:34, Peter Maydell wrote: On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc64/sparc64.c | 4 +++- 1 file

Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc64/sparc64.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

Re: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

Re: [PATCH 11/23] qemu-img: allow specifying -f fmt for snapshot subcommand

2024-02-09 Thread Michael Tokarev
10.02.2024 00:22, Michael Tokarev wrote: For consistency with other commands, and since it already accepts --image-opts, allow specifying -f fmt too. ... -c = getopt_long(argc, argv, ":la:c:d:hqU", +c = getopt_long(argc, argv, ":la:c:d:fhqU",

Re: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/sun4m.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index

Re: [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/macio/macio.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index

Re: [PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:12, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/prep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 1a6cd05c61..4eb5477069 100644 ---

[PATCH 14/23] qemu-img: refresh options/--help for "rebase" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. Options added: --format, --cache - for the image in question --backing, --backing-format, --backing-cache, --backing-unsafe - for the new backing file (was eg CACHE vs SRC_CACHE, which is unclear). Probably should rename local variables. ---

[PATCH 07/23] qemu-img: refresh options/--help for "compare" command

2024-02-09 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index eabf45c423..8f16ee9deb 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1464,9 +1464,17 @@ static int img_compare(const img_cmd_t

[PATCH 21/23] qemu-img: refresh options/--help for "measure" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. Also add -s short option for --size (and remove OPTION_SIZE). --- qemu-img.c | 43 +++ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index db1f80e15d..e2c8855ff5 100644

[PATCH 19/23] qemu-img: refresh options/--help for "bitmap" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 3be365cd07..9a0cd05d42 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -5103,7 +5103,24 @@ static int img_bitmap(const

[PATCH 23/23] qemu-img: inline list of supported commands, remove qemu-img-cmds.h include

2024-02-09 Thread Michael Tokarev
also add short description to each command and use it in --help Signed-off-by: Michael Tokarev --- qemu-img.c | 42 +++--- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index d9c5c6078b..e57076738e 100644 ---

[PATCH 06/23] qemu-img: refresh options/--help for "commit" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index ad7fa033b1..eabf45c423 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1029,8

[PATCH 04/23] qemu-img: refresh options/--help for "check" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 4e962843da..3ae07bfae0 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -792,7 +792,9 @@

[PATCH 17/23] qemu-img: refresh options/--help for "amend" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index e552401074..f598eba3a8 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4493,7 +4493,12 @@ static int img_amend(const

[PATCH 05/23] qemu-img: simplify --repair error message

2024-02-09 Thread Michael Tokarev
Signed-off-by: Michael Tokarev --- qemu-img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 3ae07bfae0..ad7fa033b1 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -843,8 +843,8 @@ static int img_check(const img_cmd_t *ccmd, int argc, char

[PATCH 18/23] qemu-img: refresh options/--help for "bench" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index f598eba3a8..3be365cd07 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4781,9 +4781,19 @@ static int

[PATCH 20/23] qemu-img: refresh options/--help for "dd" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 9a0cd05d42..db1f80e15d 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -5417,6 +5417,8 @@ static int img_dd(const

[PATCH 22/23] qemu-img: implement short --help, remove global help() function

2024-02-09 Thread Michael Tokarev
now once all individual subcommands has --help support, remove the large unreadable help() thing and replace it with small global --help, which refers to individual command --help for more info. While at it, also line-wrap list of formats after 74 chars. Signed-off-by: Michael Tokarev ---

[PATCH 16/23] qemu-img: refresh options/--help for "resize" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 929a25a021..e552401074 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4283,7 +4283,9 @@ static int img_resize(const

[PATCH 02/23] qemu-img: refresh options/--help for "create" subcommand

2024-02-09 Thread Michael Tokarev
Add missing long options (eg --format). Create helper function cmd_help() to display command-specific help text, and use it to print --help for 'create' subcommand. Signed-off-by: Michael Tokarev --- qemu-img.c | 45 - 1 file changed, 44

[PATCH 10/23] qemu-img: refresh options/--help for "map" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index a1a0ba99f0..5af0b8ec18 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3425,7 +3425,20 @@ static int img_map(const img_cmd_t

[PATCH 11/23] qemu-img: allow specifying -f fmt for snapshot subcommand

2024-02-09 Thread Michael Tokarev
For consistency with other commands, and since it already accepts --image-opts, allow specifying -f fmt too. Signed-off-by: Michael Tokarev --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- qemu-img.c | 9 ++--- 3 files changed, 9 insertions(+), 6

[PATCH 13/23] qemu-img: refresh options/--help for "snapshot" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. --- qemu-img.c | 26 -- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index d9dfff2f07..67e6a7797d 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3553,9 +3553,15 @@ static int

[PATCH 08/23] qemu-img: refresh options/--help for "convert" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. convert uses -B for --backing, - why not -b? Signed-off-by: Michael Tokarev --- qemu-img.c | 52 +++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index

[PATCH 15/23] qemu-img: resize: do not always eat last argument

2024-02-09 Thread Michael Tokarev
'qemu-img resize --help' does not work, since it wants more arguments. Only eat last option at the beginning if it starts like -N.., and allow getopt() to do its work, and eat it up at the end if not already eaten. This will not allow to mix options and size anyway, but it is better than now.

[PATCH 03/23] qemu-img: factor out parse_output_format() and use it in the code

2024-02-09 Thread Michael Tokarev
Use common code and simplify error message Signed-off-by: Michael Tokarev --- qemu-img.c | 63 -- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7edfc56572..4e962843da 100644 --- a/qemu-img.c +++

[PATCH 12/23] qemu-img: make -l (list) the default for "snapshot" subcommand

2024-02-09 Thread Michael Tokarev
also remove bdrv_oflags handling (only list can use RO mode) --- qemu-img.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 1e09b78d00..d9dfff2f07 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3541,7 +3541,7 @@ static int

[PATCH 01/23] qemu-img: pass current cmd info into command handlers

2024-02-09 Thread Michael Tokarev
In order to be able to give correct --help output, pass current cmd information (img_cmd_t structure) to command handlers and to common error reporting functions. After the change, in case of command-line error, qemu-img will now print: Try 'qemu-img create --help' for more information. Current

[PATCH 09/23] qemu-img: refresh options/--help for "info" command

2024-02-09 Thread Michael Tokarev
Add missing long options and --help output. Signed-off-by: Michael Tokarev --- qemu-img.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index d4dafebff9..a1a0ba99f0 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -65,7 +65,6 @@

[PATCH 00/23] qemu-img: refersh options and --help handling

2024-02-09 Thread Michael Tokarev
Quite big patchset implementing normal, readable qemu-img --help (and qemu-img COMMAND --help) output with readable descriptions, and adding many long options in the process. In the end I stopped using qemu-img-opts.hx in qemu-img.c, perhaps this can be avoided, with only list of commands and

[PATCH] iotests: Make 144 deterministic again

2024-02-09 Thread Kevin Wolf
Since commit effd60c8 changed how QMP commands are processed, the order of the block-commit return value and job events in iotests 144 wasn't fixed and more and caused the test to fail intermittently. Change the test to cache events first and then print them in a predefined order. Waiting three

Re: [PATCH v2 3/3] virtio-blk: Use ioeventfd_attach in start_ioeventfd

2024-02-09 Thread Hanna Czenczek
On 09.02.24 15:38, Michael Tokarev wrote: 02.02.2024 18:31, Hanna Czenczek : Commit d3f6f294aeadd5f88caf0155e4360808c95b3146 ("virtio-blk: always set ioeventfd during startup") has made virtio_blk_start_ioeventfd() always kick the virtqueue (set the ioeventfd), regardless of whether the BB is

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-09 Thread Hanna Czenczek
On 09.02.24 15:08, Michael Tokarev wrote: 02.02.2024 17:47, Hanna Czenczek : Hi, Without the AioContext lock, a BB's context may kind of change at any time (unless it has a root node, and I/O requests are pending). That also means that its own context (BlockBackend.ctx) and that of its root

Re: [RFC PATCH 0/7] hw/qdev: Split 'wiring' phase from 'realize'

2024-02-09 Thread Bernhard Beschow
Am 9. Februar 2024 12:32:18 UTC schrieb "Philippe Mathieu-Daudé" : >Hi, > >Various issues related to implementing dynamic machines have >been documented in [1]. > >We are trying to understand what means "a qdev is realized". >One explanation was "the device is guest visible"; however >many

Re: [PATCH v2 3/3] virtio-blk: Use ioeventfd_attach in start_ioeventfd

2024-02-09 Thread Michael Tokarev
02.02.2024 18:31, Hanna Czenczek : Commit d3f6f294aeadd5f88caf0155e4360808c95b3146 ("virtio-blk: always set ioeventfd during startup") has made virtio_blk_start_ioeventfd() always kick the virtqueue (set the ioeventfd), regardless of whether the BB is drained. That is no longer necessary,

[PULL 14/17] block: Support detached LUKS header creation using blockdev-create

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang Firstly, enable the ability to choose the block device containing a detachable LUKS header by adding the 'header' parameter to BlockdevCreateOptionsLUKS. Secondly, when formatting the LUKS volume with a detachable header, truncate the payload volume to length without a header

[PULL 16/17] crypto: Introduce 'detached-header' field in QCryptoBlockInfoLUKS

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang When querying the LUKS disk with the qemu-img tool or other APIs, add information about whether the LUKS header is detached. Additionally, update the test case with the appropriate modification. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé Signed-off-by:

[PULL 09/17] chardev: close QIOChannel before unref'ing

2024-02-09 Thread Daniel P . Berrangé
The chardev socket backend will unref the QIOChannel object while it is still potentially open. When using TLS there could be a pending TLS handshake taking place. If the channel is left open then when the TLS handshake callback runs, it can end up accessing free'd memory in the

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-09 Thread Michael Tokarev
02.02.2024 17:47, Hanna Czenczek : Hi, Without the AioContext lock, a BB's context may kind of change at any time (unless it has a root node, and I/O requests are pending). That also means that its own context (BlockBackend.ctx) and that of its root node can differ sometimes (while the context

[PULL 03/17] qemu_init: increase NOFILE soft limit on POSIX

2024-02-09 Thread Daniel P . Berrangé
From: Fiona Ebner In many configurations, e.g. multiple vNICs with multiple queues or with many Ceph OSDs, the default soft limit of 1024 is not enough. QEMU is supposed to work fine with file descriptors >= 1024 and does not use select() on POSIX. Bump the soft limit to the allowed hard limit

[PULL 08/17] docs: re-generate x86_64 ABI compatibility CSV

2024-02-09 Thread Daniel P . Berrangé
This picks up the new EPYC-Genoa, SapphireRapids & GraniteRapids CPUs, removes the now deleted Icelake-Client CPU, and adds the newer versions of many existing CPUs. Signed-off-by: Daniel P. Berrangé --- docs/system/cpu-models-x86-abi.csv | 20 ++-- 1 file changed, 18

[PULL 10/17] io: add trace event when cancelling TLS handshake

2024-02-09 Thread Daniel P . Berrangé
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé --- io/channel-tls.c | 1 + io/trace-events | 1 + 2 files changed, 2 insertions(+) diff --git a/io/channel-tls.c b/io/channel-tls.c index 58fe1aceee..1d9c9c72bf 100644 --- a/io/channel-tls.c +++ b/io/channel-tls.c @@

[PULL 11/17] crypto: Support LUKS volume with detached header

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang By enhancing the LUKS driver, it is possible to implement the LUKS volume with a detached header. Normally a LUKS volume has a layout: disk: | header | key material | disk payload data | With a detached LUKS header, you need 2 disks so getting: disk1: | header | key

[PULL 17/17] tests: Add case for LUKS volume with detached header

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang Also, add a section to the MAINTAINERS file for detached LUKS header, it only has a test case in it currently. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé --- MAINTAINERS | 5 +

[PULL 01/17] meson: sort C warning flags alphabetically

2024-02-09 Thread Daniel P . Berrangé
When scanning the list of warning flags to see if one is present, it is helpful if they are in alphabetical order. It is further helpful to separate out the 'no-' prefixed warnings. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Daniel P. Berrangé --- meson.build | 40

[PULL 02/17] crypto: Introduce SM4 symmetric cipher algorithm

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). SM4 (GBT.32907-2016) is a cryptographic standard issued by the Organization of State Commercial Administration of China (OSCCA) as an authorized cryptographic algorithms for the use within China. Detect the SM4

[PULL 15/17] block: Support detached LUKS header creation using qemu-img

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang Even though a LUKS header might be created with cryptsetup, qemu-img should be enhanced to accommodate it as well. Add the 'detached-header' option to specify the creation of a detached LUKS header. This is how it is used: $ qemu-img create --object secret,id=sec0,data=abc123

[PULL 12/17] qapi: Make parameter 'file' optional for BlockdevCreateOptionsLUKS

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang To support detached LUKS header creation, make the existing 'file' field in BlockdevCreateOptionsLUKS optional. Signed-off-by: Hyman Huang Reviewed-by: Daniel P. Berrangé Signed-off-by: Daniel P. Berrangé --- block/crypto.c | 21 ++---

[PULL 13/17] crypto: Modify the qcrypto_block_create to support creation flags

2024-02-09 Thread Daniel P . Berrangé
From: Hyman Huang Expand the signature of qcrypto_block_create to enable the formation of LUKS volumes with detachable headers. To accomplish that, introduce QCryptoBlockCreateFlags to instruct the creation process to set the payload_offset_sector to 0. Signed-off-by: Hyman Huang Reviewed-by:

[PULL 05/17] softmmu: remove obsolete comment about libvirt timeouts

2024-02-09 Thread Daniel P . Berrangé
For a long time now, libvirt has pre-created the monitor connection socket and passed the pre-opened FD into QEMU during startup. Thus libvirt does not have any timeouts waiting for the monitor socket to appear, it is immediately connected. Reviewed-by: Zhao Liu Signed-off-by: Daniel P. Berrangé

[PULL 07/17] docs: fix highlighting of CPU ABI header rows

2024-02-09 Thread Daniel P . Berrangé
The 'header-rows' directive indicates how many rows in the generated table are to be highlighted as headers. We only have one such row in the CSV file included. This removes the accident bold highlighting of the 'i486' CPU model. Signed-off-by: Daniel P. Berrangé ---

[PULL 06/17] scripts: drop comment about autogenerated CPU API file

2024-02-09 Thread Daniel P . Berrangé
The RST doc include can't be made to skip the comment indicating the CPU CSV file is auto-generated when importing it. This comment line was previously manually removed from the generated output that was committed. Signed-off-by: Daniel P. Berrangé --- scripts/cpu-x86-uarch-abi.py | 1 - 1 file

[PULL 04/17] ui: drop VNC feature _MASK constants

2024-02-09 Thread Daniel P . Berrangé
Each VNC feature enum entry has a corresponding _MASK constant which is the bit-shifted value. It is very easy for contributors to accidentally use the _MASK constant, instead of the non-_MASK constant, or the reverse. No compiler warning is possible and it'll just silently do the wrong thing at

[PULL 00/17] Misc fixes patches

2024-02-09 Thread Daniel P . Berrangé
The following changes since commit 9e34f127f419b3941b36dfdfac79640dc81e97e2: Merge tag 'pull-request-2024-02-06' of https://gitlab.com/thuth/qemu into staging (2024-02-08 11:59:28 +) are available in the Git repository at: https://gitlab.com/berrange/qemu tags/misc-fixes-pull-request

Re: [RFC PATCH 0/7] hw/qdev: Split 'wiring' phase from 'realize'

2024-02-09 Thread BALATON Zoltan
Hello, Instead of adding a new method to devices, why not move wiring to the code that created/realized the device? Either it's the job of the code that created the device and wants to use it or if it's an internal object the device itself is created then it should be OK to wire it in the

[RFC PATCH 5/7] hw/ide/via: Configure IDE bus IRQs after realization

2024-02-09 Thread Philippe Mathieu-Daudé
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé --- Ideally we should rework the current IDE bus model to really use QOM and not globals. Left for later. --- hw/ide/via.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[RFC PATCH 7/7] hw/misc/mac_via: Have VIA1 child access parent IRQ once realized

2024-02-09 Thread Philippe Mathieu-Daudé
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/mac_via.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index db6142b5f4..67e51430bf 100644 --- a/hw/misc/mac_via.c

[RFC PATCH 6/7] hw/intc/mips_gic: Initialize IRQ array once device is realized

2024-02-09 Thread Philippe Mathieu-Daudé
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/mips_gic.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/intc/mips_gic.c b/hw/intc/mips_gic.c index 77ba7348a3..05c8b8f4c4 100644 ---

[RFC PATCH 1/7] hw/qdev: Introduce DeviceClass::[un]wire() handlers

2024-02-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 8 +++- hw/core/qdev.c | 21 - 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index d47536eadb..2ca33aea3b 100644 ---

[RFC PATCH 3/7] hw/ide/cmd646: Configure IDE bus IRQs after realization

2024-02-09 Thread Philippe Mathieu-Daudé
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé --- Ideally we should rework the current IDE bus model to really use QOM and not globals. Left for later. --- hw/ide/cmd646.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-)

[RFC PATCH 4/7] hw/ide/sii3112: Configure IDE bus IRQs after realization

2024-02-09 Thread Philippe Mathieu-Daudé
We shouldn't call qdev_get_gpio_in() on unrealized devices. Signed-off-by: Philippe Mathieu-Daudé --- Ideally we should rework the current IDE bus model to really use QOM and not globals. Left for later. --- hw/ide/sii3112.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[RFC PATCH 0/7] hw/qdev: Split 'wiring' phase from 'realize'

2024-02-09 Thread Philippe Mathieu-Daudé
Hi, Various issues related to implementing dynamic machines have been documented in [1]. We are trying to understand what means "a qdev is realized". One explanation was "the device is guest visible"; however many devices are realized before being mapped, thus are not "guest visible". Some

[RFC PATCH 2/7] hw/input/pckbd: Connect i8042 GPIOs once mouse/keyboard are realized

2024-02-09 Thread Philippe Mathieu-Daudé
While a device is not realized, we shouldn't call: - qdev_get_gpio_in_named() - qdev_connect_gpio_out() - isa_connect_gpio_out() Signed-off-by: Philippe Mathieu-Daudé --- Probably better would be to declare the ISA wiring handlers in ISADeviceClass, but such class doesn't exist yet. ---

Re: [PATCH v3] blockcommit: Reopen base image as RO after abort

2024-02-09 Thread Alexander Ivanov
Could you please review the patch? On 1/30/24 10:14, Alexander Ivanov wrote: If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to the disk

Re: [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:15, Philippe Mathieu-Daudé wrote: > > We should not wire IRQs on unrealized device. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sparc/leon3.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > We should not wire IRQs on unrealized device. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sparc/sun4m.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c >

Re: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > Inline cpu_create() in order to call > qdev_init_gpio_in_named_with_opaque() > before the CPU is realized. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sparc/leon3.c | 7 --- > 1 file changed, 4 insertions(+), 3

Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > Inline cpu_create() in order to call > qdev_init_gpio_in_named_with_opaque() > before the CPU is realized. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sparc64/sparc64.c | 4 +++- > 1 file changed, 3 insertions(+), 1

Re: [PATCH v3 07/11] hw/sh4/r2d: Realize IDE controller before accessing it

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > We should not wire IRQs on unrealized device. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/sh4/r2d.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > We should not wire IRQs on unrealized device. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v3 03/11] hw/rx/rx62n: Only call qdev_get_gpio_in() when necessary

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: > > Instead of filling an array of all the possible IRQs, only call > qdev_get_gpio_in() when an IRQ is used. Remove the array from > RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an > unrealized device. > > Signed-off-by:

Re: [PATCH v3 02/11] hw/rx/rx62n: Reduce inclusion of 'qemu/units.h'

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:13, Philippe Mathieu-Daudé wrote: > > "qemu/units.h" is not used in the "hw/rx/rx62n.h" > header, include it in the source where it is. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v3 01/11] hw/ide/ich9: Use AHCIPCIState typedef

2024-02-09 Thread Peter Maydell
On Thu, 8 Feb 2024 at 18:13, Philippe Mathieu-Daudé wrote: > > QEMU coding style recommend using structure typedefs: > https://www.qemu.org/docs/master/devel/style.html#typedefs > > Signed-off-by: Philippe Mathieu-Daudé > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PULL 00/16] Block layer patches

2024-02-09 Thread Peter Maydell
On Wed, 7 Feb 2024 at 21:57, Kevin Wolf wrote: > > The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440: > > Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru into > staging (2024-02-03 13:31:58 +) > > are available in the Git repository at: > >

Re: [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working

2024-02-09 Thread Kevin Wolf
Am 07.02.2024 um 18:58 hat Michael Tokarev geschrieben: > This is an incomplete first attempt only, there's a lot left to do. > > All the options in qemu-img is a complete mess, - no, inconsistent or > incomplete syntax in documentation, many undocumented options, option > names are used