mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +00:00
backup: Add new parameters to qemu monitor nbd-server-add
The upcoming virDomainBackup() API needs to take advantage of the ability to expose a bitmap as part of nbd-server-add for a pull-mode backup (this is the recently-added QEMU_CAPS_NBD_BITMAP capability). Signed-off-by: Eric Blake <eblake@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ad1c17c8d5
commit
fbb5271c78
@ -424,7 +424,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
|
|||||||
goto exit_monitor;
|
goto exit_monitor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, true) < 0)
|
if (qemuMonitorNBDServerAdd(priv->mon, diskAlias, NULL, true, NULL) < 0)
|
||||||
goto exit_monitor;
|
goto exit_monitor;
|
||||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -3945,13 +3945,17 @@ qemuMonitorNBDServerStart(qemuMonitorPtr mon,
|
|||||||
int
|
int
|
||||||
qemuMonitorNBDServerAdd(qemuMonitorPtr mon,
|
qemuMonitorNBDServerAdd(qemuMonitorPtr mon,
|
||||||
const char *deviceID,
|
const char *deviceID,
|
||||||
bool writable)
|
const char *export,
|
||||||
|
bool writable,
|
||||||
|
const char *bitmap)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("deviceID=%s", deviceID);
|
VIR_DEBUG("deviceID=%s, export=%s, bitmap=%s", deviceID, NULLSTR(export),
|
||||||
|
NULLSTR(bitmap));
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
return qemuMonitorJSONNBDServerAdd(mon, deviceID, writable);
|
return qemuMonitorJSONNBDServerAdd(mon, deviceID, export, writable,
|
||||||
|
bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1118,7 +1118,9 @@ int qemuMonitorNBDServerStart(qemuMonitorPtr mon,
|
|||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
int qemuMonitorNBDServerAdd(qemuMonitorPtr mon,
|
int qemuMonitorNBDServerAdd(qemuMonitorPtr mon,
|
||||||
const char *deviceID,
|
const char *deviceID,
|
||||||
bool writable);
|
const char *export,
|
||||||
|
bool writable,
|
||||||
|
const char *bitmap);
|
||||||
int qemuMonitorNBDServerStop(qemuMonitorPtr);
|
int qemuMonitorNBDServerStop(qemuMonitorPtr);
|
||||||
int qemuMonitorGetTPMModels(qemuMonitorPtr mon,
|
int qemuMonitorGetTPMModels(qemuMonitorPtr mon,
|
||||||
char ***tpmmodels);
|
char ***tpmmodels);
|
||||||
|
@ -6736,15 +6736,20 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
|
|||||||
int
|
int
|
||||||
qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
|
qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
|
||||||
const char *deviceID,
|
const char *deviceID,
|
||||||
bool writable)
|
const char *export,
|
||||||
|
bool writable,
|
||||||
|
const char *bitmap)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
virJSONValuePtr cmd;
|
virJSONValuePtr cmd;
|
||||||
virJSONValuePtr reply = NULL;
|
virJSONValuePtr reply = NULL;
|
||||||
|
|
||||||
|
/* Note: bitmap must be NULL if QEMU_CAPS_NBD_BITMAP is lacking */
|
||||||
if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-add",
|
if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-add",
|
||||||
"s:device", deviceID,
|
"s:device", deviceID,
|
||||||
|
"S:name", export,
|
||||||
"b:writable", writable,
|
"b:writable", writable,
|
||||||
|
"S:bitmap", bitmap,
|
||||||
NULL)))
|
NULL)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -463,7 +463,9 @@ int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon,
|
|||||||
const char *tls_alias);
|
const char *tls_alias);
|
||||||
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
|
int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon,
|
||||||
const char *deviceID,
|
const char *deviceID,
|
||||||
bool writable);
|
const char *export,
|
||||||
|
bool writable,
|
||||||
|
const char *bitmap);
|
||||||
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
|
int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon);
|
||||||
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
|
int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon,
|
||||||
char ***tpmmodels)
|
char ***tpmmodels)
|
||||||
|
@ -1331,7 +1331,7 @@ GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "/foo/bar1", "/foo/bar2", "back
|
|||||||
GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")
|
GEN_TEST_FUNC(qemuMonitorJSONDrivePivot, "vdb")
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar")
|
GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar")
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false)
|
GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false)
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", true)
|
GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", "export", true, "bitmap")
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1")
|
GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1")
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayOpen, "foodev", true)
|
GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayOpen, "foodev", true)
|
||||||
GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayClose, "foodev")
|
GEN_TEST_FUNC(qemuMonitorJSONBlockdevTrayClose, "foodev")
|
||||||
|
Loading…
Reference in New Issue
Block a user