return qemuMonitorJSONDisplayReload(mon, type, tlsCerts);
}
+
+
+/**
+ * qemuMonitorBlockdevSetActive:
+ * @mon: monitor object
+ * @nodename: optional nodename to (de)activate
+ * @active: requested state
+ *
+ * Activate or deactivate @nodename based on @active. If @nodename is NULL,
+ * qemu will act on all block nodes.
+ */
+int
+qemuMonitorBlockdevSetActive(qemuMonitor *mon,
+ const char *nodename,
+ bool active)
+{
+ QEMU_CHECK_MONITOR(mon);
+ VIR_DEBUG("nodename='%s', active='%d'", NULLSTR(nodename), active);
+
+ return qemuMonitorJSONBlockdevSetActive(mon, nodename, active);
+}
const char *jobname,
const char *snapshotname,
const char **disks);
+
+int
+qemuMonitorBlockdevSetActive(qemuMonitor *mon,
+ const char *nodename,
+ bool active);
return qemuMonitorJSONCheckError(cmd, reply);
}
+
+
+int
+qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
+ const char *nodename,
+ bool active)
+{
+ g_autoptr(virJSONValue) cmd = NULL;
+ g_autoptr(virJSONValue) reply = NULL;
+
+ if (!(cmd = qemuMonitorJSONMakeCommand("blockdev-set-active",
+ "S:node-name", nodename,
+ "b:active", active,
+ NULL)))
+ return -1;
+
+ if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
+ return -1;
+
+ return qemuMonitorJSONCheckError(cmd, reply);
+}
const char *jobname,
const char *snapshotname,
const char **disks);
+
+int
+qemuMonitorJSONBlockdevSetActive(qemuMonitor *mon,
+ const char *nodename,
+ bool active);
}
+static int
+testQemuMonitorJSONqemuMonitorJSONBlockdevSetActive(const void *opaque)
+{
+ const testGenericData *data = opaque;
+ virDomainXMLOption *xmlopt = data->xmlopt;
+ g_autoptr(qemuMonitorTest) test = NULL;
+
+ if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
+ return -1;
+
+ if (qemuMonitorTestAddItem(test, "blockdev-set-active",
+ "{\"return\":{}}") < 0)
+ return -1;
+
+ if (qemuMonitorTestAddItem(test, "blockdev-set-active",
+ "{\"return\":{}}") < 0)
+ return -1;
+
+ if (qemuMonitorJSONBlockdevSetActive(qemuMonitorTestGetMonitor(test),
+ NULL, true) < 0)
+ return -1;
+
+ if (qemuMonitorJSONBlockdevSetActive(qemuMonitorTestGetMonitor(test),
+ "testnode", false) < 0)
+ return -1;
+
+ return 0;
+}
+
+
static bool
testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntry *a,
struct qemuMonitorQueryCpusEntry *b)
DO_TEST(qemuMonitorJSONSendKeyHoldtime);
DO_TEST(qemuMonitorJSONNBDServerStart);
DO_TEST(qemuMonitorJSONSnapshot);
+ DO_TEST(qemuMonitorJSONBlockdevSetActive);
DO_TEST_CPU_DATA("host");
DO_TEST_CPU_DATA("full");