if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
- ret = qemuMonitorTransaction(priv->mon, actions);
+ ret = qemuMonitorTransaction(priv->mon, &actions);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || ret < 0) {
ret = -1;
}
}
- if (ret == 0 || !actions) {
+ if (ret == 0 || !do_transaction) {
if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0 ||
(persist && virDomainSaveConfig(cfg->configDir, driver->caps,
vm->newDef) < 0))
/* Use the transaction QMP command to run atomic snapshot commands. */
int
-qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
+qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
{
- VIR_DEBUG("actions=%p", actions);
+ VIR_DEBUG("actions=%p", *actions);
QEMU_CHECK_MONITOR_JSON(mon);
const char *file,
const char *format,
bool reuse);
-int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
+int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
ATTRIBUTE_NONNULL(2);
int qemuMonitorDriveMirror(qemuMonitorPtr mon,
const char *device,
}
int
-qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
+qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
{
int ret = -1;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
- virJSONValuePtr act = actions;
- bool protect = actions->protect;
- /* We do NOT want to free actions when recursively freeing cmd. */
- actions->protect = true;
cmd = qemuMonitorJSONMakeCommand("transaction",
- "a:actions", &act,
+ "a:actions", actions,
NULL);
if (!cmd)
goto cleanup;
cleanup:
virJSONValueFree(cmd);
virJSONValueFree(reply);
- actions->protect = protect;
return ret;
}
bool reuse)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5);
-int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
+int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon,
const char *device,