qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] block: stream: Allow users to request only format driver


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 2/2] block: stream: Allow users to request only format driver names in backing file format
Date: Wed, 29 Nov 2023 13:24:57 +0300
User-agent: Mozilla Thunderbird

On 24.11.23 17:52, Peter Krempa wrote:
Introduce a new flag 'backing_file_format_no_protocol' for the
block-commit QMP command which instructs the internals to use 'raw'
instead of the protocol driver in case when a image is used without a
dummy 'raw' wrapper.

The flag is designed such that it can be always asserted by management
tools even when there isn't any update to backing files.

The flag will be used by libvirt so that the backing images still
reference the proper format even when libvirt will stop using the dummy
raw driver (raw driver with no other config). Libvirt needs this so that
the images stay compatible with older libvirt versions which didn't
expect that a protocol driver name can appear in the backing file format
field.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
  block/monitor/block-hmp-cmds.c         |  2 +-
  block/stream.c                         | 10 +++++++++-
  blockdev.c                             |  7 +++++++
  include/block/block_int-global-state.h |  3 +++
  qapi/block-core.json                   | 11 ++++++++++-
  5 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c
index c729cbf1eb..28e708a981 100644
--- a/block/monitor/block-hmp-cmds.c
+++ b/block/monitor/block-hmp-cmds.c
@@ -509,7 +509,7 @@ void hmp_block_stream(Monitor *mon, const QDict *qdict)
      const char *base = qdict_get_try_str(qdict, "base");
      int64_t speed = qdict_get_try_int(qdict, "speed", 0);

-    qmp_block_stream(device, device, base, NULL, NULL, NULL,
+    qmp_block_stream(device, device, base, NULL, NULL, NULL, false, false,

that should be

+    qmp_block_stream(device, device, base, NULL, NULL, false, false, NULL,


( definitely we lack named arguments of python in C :)


with that fixed:
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>

                       qdict_haskey(qdict, "speed"), speed,
                       true, BLOCKDEV_ON_ERROR_REPORT, NULL,
                       false, false, false, false, &error);

...

--- a/blockdev.c
+++ b/blockdev.c
@@ -2408,6 +2408,8 @@ void qmp_block_stream(const char *job_id, const char 
*device,
                        const char *base,
                        const char *base_node,
                        const char *backing_file,
+                      bool has_backing_file_format_no_protocol,
+                      bool backing_file_format_no_protocol,
                        const char *bottom,
                        bool has_speed, int64_t speed,
                        bool has_on_error, BlockdevOnError on_error,

--
Best regards,
Vladimir




reply via email to

[Prev in Thread] Current Thread [Next in Thread]