mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Support mountpoints option of guest-fsfreeze-freeze
With this patch, virDomainFSFreeze will pass the mountpoints argument
to qemu guest agent. For example,
virDomainFSFreeze(dom, {"/mnt/vol1", "/mnt/vol2"}, 2, 0)
will issue qemu guest agent command:
{"execute":"guest-fsfreeze-freeze",
"arguments":{"mountpoints":["/mnt/vol1","/mnt/vol2"]}}
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
committed by
Eric Blake
parent
061c6347e4
commit
2bb520c802
@@ -36,6 +36,7 @@ testQemuAgentFSFreeze(const void *data)
|
||||
{
|
||||
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
|
||||
qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt);
|
||||
const char *mountpoints[] = {"/fs1", "/fs2", "/fs3", "/fs4", "/fs5"};
|
||||
int ret = -1;
|
||||
|
||||
if (!test)
|
||||
@@ -55,7 +56,8 @@ testQemuAgentFSFreeze(const void *data)
|
||||
"{ \"return\" : 7 }") < 0)
|
||||
goto cleanup;
|
||||
|
||||
if ((ret = qemuAgentFSFreeze(qemuMonitorTestGetAgent(test))) < 0)
|
||||
if ((ret = qemuAgentFSFreeze(qemuMonitorTestGetAgent(test),
|
||||
mountpoints, 5)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (ret != 5) {
|
||||
@@ -64,7 +66,7 @@ testQemuAgentFSFreeze(const void *data)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if ((ret = qemuAgentFSFreeze(qemuMonitorTestGetAgent(test))) < 0)
|
||||
if ((ret = qemuAgentFSFreeze(qemuMonitorTestGetAgent(test), NULL, 0)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (ret != 7) {
|
||||
@@ -547,7 +549,7 @@ testQemuAgentTimeout(const void *data)
|
||||
NULL, NULL) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (qemuAgentFSFreeze(qemuMonitorTestGetAgent(test)) != -1) {
|
||||
if (qemuAgentFSFreeze(qemuMonitorTestGetAgent(test), NULL, 0) != -1) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
"agent command should have failed");
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user