diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index c333fc1364..ce1a06c4c8 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1964,16 +1964,6 @@ qemuMonitorSetLink(qemuMonitorPtr mon, } -int -qemuMonitorGetVirtType(qemuMonitorPtr mon, - virDomainVirtType *virtType) -{ - QEMU_CHECK_MONITOR(mon); - - return qemuMonitorJSONGetVirtType(mon, virtType); -} - - /** * Returns: 0 if balloon not supported, +1 if balloon query worked * or -1 on failure diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 3dcceffef8..8bc092870b 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -656,8 +656,6 @@ virBitmapPtr qemuMonitorGetCpuHalted(qemuMonitorPtr mon, size_t maxvcpus, bool fast); -int qemuMonitorGetVirtType(qemuMonitorPtr mon, - virDomainVirtType *virtType); int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon, unsigned long long *currmem); int qemuMonitorGetMemoryStats(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index ab83abf6b3..5acc1a10aa 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -2052,46 +2052,6 @@ qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon, } -int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, - virDomainVirtType *virtType) -{ - int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-kvm", - NULL); - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - bool val = false; - - *virtType = VIR_DOMAIN_VIRT_QEMU; - - if (!cmd) - return -1; - - if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0) - goto cleanup; - - if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_OBJECT) < 0) - goto cleanup; - - data = virJSONValueObjectGetObject(reply, "return"); - - if (virJSONValueObjectGetBoolean(data, "enabled", &val) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("info kvm reply missing 'enabled' field")); - goto cleanup; - } - - if (val) - *virtType = VIR_DOMAIN_VIRT_KVM; - - ret = 0; - cleanup: - virJSONValueFree(cmd); - virJSONValueFree(reply); - return ret; -} - - /** * Loads correct video memory size values from QEMU and update the video * definition. diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index da988f0d41..d2928b0ffc 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -57,8 +57,6 @@ int qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon, size_t *nentries, bool force, bool fast); -int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, - virDomainVirtType *virtType); int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, virDomainVideoDefPtr video, char *path); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index d22a92d3e1..79ef2a545e 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1445,57 +1445,6 @@ testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *opaque) return 0; } -static int -testQemuMonitorJSONqemuMonitorJSONGetVirtType(const void *opaque) -{ - const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; - virDomainVirtType virtType; - g_autoptr(qemuMonitorTest) test = NULL; - - if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) - return -1; - - if (qemuMonitorTestAddItem(test, "query-kvm", - "{" - " \"return\": {" - " \"enabled\": true," - " \"present\": true" - " }," - " \"id\": \"libvirt-8\"" - "}") < 0 || - qemuMonitorTestAddItem(test, "query-kvm", - "{" - " \"return\": {" - " \"enabled\": false," - " \"present\": true" - " }," - " \"id\": \"libvirt-7\"" - "}") < 0) - return -1; - - if (qemuMonitorJSONGetVirtType(qemuMonitorTestGetMonitor(test), &virtType) < 0) - return -1; - - if (virtType != VIR_DOMAIN_VIRT_KVM) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "Unexpected virt type: %d, expecting %d", virtType, VIR_DOMAIN_VIRT_KVM); - return -1; - } - - if (qemuMonitorJSONGetVirtType(qemuMonitorTestGetMonitor(test), &virtType) < 0) - return -1; - - if (virtType != VIR_DOMAIN_VIRT_QEMU) { - virReportError(VIR_ERR_INTERNAL_ERROR, - "Unexpected virt type: %d, expecting %d", virtType, VIR_DOMAIN_VIRT_QEMU); - return -1; - } - - return 0; -} - - static void testQemuMonitorJSONGetBlockInfoPrint(const struct qemuDomainDiskInfo *d) { @@ -3205,7 +3154,6 @@ mymain(void) DO_TEST(qemuMonitorJSONGetMigrationCapabilities); DO_TEST(qemuMonitorJSONQueryCPUs); DO_TEST(qemuMonitorJSONQueryCPUsFast); - DO_TEST(qemuMonitorJSONGetVirtType); DO_TEST(qemuMonitorJSONSendKey); DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability); DO_TEST(qemuMonitorJSONSendKeyHoldtime);