mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
qemuBlockReopenFormatMon: Adapt to new argument format of 'blockdev-reopen'
This function was added prior 'blockdev-reopen' being stable and qemu changed the arguments to actually contain an array of block node definitions to reopen. In our case we are just changing between read-only and read-write modes and thus we can keep operating on the nodes one-by-one. Modify the code to add the wrapper array. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
6f5980ee39
commit
c1d17ca64b
@ -3291,8 +3291,18 @@ qemuBlockReopenFormatMon(qemuMonitor *mon,
|
||||
virStorageSource *src)
|
||||
{
|
||||
g_autoptr(virJSONValue) reopenprops = NULL;
|
||||
g_autoptr(virJSONValue) srcprops = NULL;
|
||||
g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
|
||||
|
||||
if (!(reopenprops = qemuBlockStorageSourceGetBlockdevProps(src, src->backingStore)))
|
||||
if (!(srcprops = qemuBlockStorageSourceGetBlockdevProps(src, src->backingStore)))
|
||||
return -1;
|
||||
|
||||
if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
|
||||
return -1;
|
||||
|
||||
if (virJSONValueObjectCreate(&reopenprops,
|
||||
"a:options", &reopenoptions,
|
||||
NULL) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorBlockdevReopen(mon, &reopenprops) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user