mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
qemu: monitor: Add handler for blockdev-reopen
Introduce the monitor code for using blockdev-reopen. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
ecdd929761
commit
9f436e067d
@ -4353,6 +4353,19 @@ qemuMonitorBlockdevAdd(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorBlockdevReopen(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props)
|
||||
{
|
||||
VIR_DEBUG("props=%p (node-name=%s)", *props,
|
||||
NULLSTR(virJSONValueObjectGetString(*props, "node-name")));
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
return qemuMonitorJSONBlockdevReopen(mon, props);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorBlockdevDel(qemuMonitorPtr mon,
|
||||
const char *nodename)
|
||||
|
@ -1322,6 +1322,9 @@ int qemuMonitorBlockdevCreate(qemuMonitorPtr mon,
|
||||
int qemuMonitorBlockdevAdd(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props);
|
||||
|
||||
int qemuMonitorBlockdevReopen(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props);
|
||||
|
||||
int qemuMonitorBlockdevDel(qemuMonitorPtr mon,
|
||||
const char *nodename);
|
||||
|
||||
|
@ -8815,6 +8815,27 @@ qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props)
|
||||
{
|
||||
g_autoptr(virJSONValue) cmd = NULL;
|
||||
g_autoptr(virJSONValue) reply = NULL;
|
||||
virJSONValuePtr pr = g_steal_pointer(props);
|
||||
|
||||
if (!(cmd = qemuMonitorJSONMakeCommandInternal("blockdev-reopen", pr)))
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
||||
return -1;
|
||||
|
||||
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon,
|
||||
const char *nodename)
|
||||
|
@ -602,6 +602,10 @@ int qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon,
|
||||
virJSONValuePtr *props)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
||||
int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon,
|
||||
const char *nodename)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
||||
|
Loading…
Reference in New Issue
Block a user