All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block-backend: Fix argument order when calling 'qapi_event_send_block_io_error()'
@ 2025-01-27 10:29 Peter Krempa
  2025-01-27 10:53 ` Daniel P. Berrangé
  2025-01-27 14:59 ` Kevin Wolf
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Krempa @ 2025-01-27 10:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Hanna Reitz, qemu-block

Commit 7452162adec25c10 introduced 'qom-path' argument to BLOCK_IO_ERROR
event but when the event is instantiated in 'send_qmp_error_event()' the
arguments for 'device' and 'qom_path' in
qapi_event_send_block_io_error() were reversed :

Generated code for sending event:

  void qapi_event_send_block_io_error(const char *qom_path,
                                      const char *device,
                                      const char *node_name,
                                      IoOperationType operation,
                                      [...]

Call inside send_qmp_error_event():

     qapi_event_send_block_io_error(blk_name(blk),
                                    blk_get_attached_dev_path(blk),
                                    bs ? bdrv_get_node_name(bs) : NULL, optype,
                                    [...]

This results into reporting the QOM path as the device alias and vice
versa which in turn breaks libvirt, which expects the device alias being
either a valid alias or empty (which would make libvirt do the lookup by
node-name instead).

Fixes: 7452162adec25c1003d5bf0079aca52913a80e0c
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 block/block-backend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index c93a7525ad..981be67e5d 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -2136,8 +2136,8 @@ static void send_qmp_error_event(BlockBackend *blk,
     BlockDriverState *bs = blk_bs(blk);

     optype = is_read ? IO_OPERATION_TYPE_READ : IO_OPERATION_TYPE_WRITE;
-    qapi_event_send_block_io_error(blk_name(blk),
-                                   blk_get_attached_dev_path(blk),
+    qapi_event_send_block_io_error(blk_get_attached_dev_path(blk),
+                                   blk_name(blk),
                                    bs ? bdrv_get_node_name(bs) : NULL, optype,
                                    action, blk_iostatus_is_enabled(blk),
                                    error == ENOSPC, strerror(error));
-- 
2.48.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-27 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 10:29 [PATCH] block-backend: Fix argument order when calling 'qapi_event_send_block_io_error()' Peter Krempa
2025-01-27 10:53 ` Daniel P. Berrangé
2025-01-27 11:07   ` Peter Krempa
2025-01-27 15:03     ` Kevin Wolf
2025-01-27 14:59 ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.