qemu: Drop qemuMonitorGetVirtType()

It's unused since v5.5.0-rc1~113.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2020-12-02 15:47:02 +01:00
parent a2196bc238
commit bfcf1a3ca9
5 changed files with 0 additions and 106 deletions

View File

@ -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

View File

@ -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,

View File

@ -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.

View File

@ -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);

View File

@ -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);