From nobody Sat Feb 7 09:35:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606920525; cv=none; d=zohomail.com; s=zohoarc; b=PpjSNgcsAUyUjZwUIf7Ufd6ckoHGoUIInG3vdE6D3wwTCVVW2Pfpzj87Y16lfFzSAKLWRu/mj65/yAKm3g3CWerPnIk8Sn0aLF61RAbpIRS/AYnZ4tehf0T7AYb84WDGBnApsAm4X4I6xqa+jDh0oAmP6ffZEpntWxcVIzfN09A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606920525; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tvh71MVtEHkb85vXwTScARWgJpOkUdiFVxd/DSHFx+o=; b=UWDxZhiWB/0wYvruJinpMUFEUwnUXz8YX9WrvU+gpXabsengeakPm831lnt8Id4LHlxak/wAQwlOgvcqF8xK0KbFRPAvEq1SJnbpvFfD0MjpPABOSPxEBpbsP9fMvze0BY8/EEIEpqhttRyBmKglIaX10PQZu345wAfCs4eJDNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606920525839850.6190416943919; Wed, 2 Dec 2020 06:48:45 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-zDv9xrPzPNSFwFWlOVuNwA-1; Wed, 02 Dec 2020 09:48:42 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1126D858190; Wed, 2 Dec 2020 14:48:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E128D5C1BD; Wed, 2 Dec 2020 14:48:35 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 681194BB7B; Wed, 2 Dec 2020 14:48:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B2EmYmZ022269 for ; Wed, 2 Dec 2020 09:48:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 01A3360C6F; Wed, 2 Dec 2020 14:48:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76A2560C17 for ; Wed, 2 Dec 2020 14:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606920524; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tvh71MVtEHkb85vXwTScARWgJpOkUdiFVxd/DSHFx+o=; b=SEOAaBIe3UeJRr9gktoY9i8K0UWV7ySPY0bABnEyyXivGiKaNTcqYOy0O51nTuFKZEixtJ 15Ws3M4cWPHvpOPlJdAGubvLITSqfTuMoj6BKaplm/OroJOuOh5/WdB2tbG6RQ6nrdMDT8 V+aC/VZZYORKL0eHX22rVDo9TQvjuQo= X-MC-Unique: zDv9xrPzPNSFwFWlOVuNwA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu: Drop qemuMonitorGetVirtType() Date: Wed, 2 Dec 2020 15:48:24 +0100 Message-Id: <3c5803daa32dd759aaebf7953e1ab9f553f3a6ba.1606920504.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" It's unused since v5.5.0-rc1~113. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 10 ------- src/qemu/qemu_monitor.h | 2 -- src/qemu/qemu_monitor_json.c | 40 --------------------------- src/qemu/qemu_monitor_json.h | 2 -- tests/qemumonitorjsontest.c | 52 ------------------------------------ 5 files changed, 106 deletions(-) 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, } =20 =20 -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); =20 -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, } =20 =20 -int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon, - virDomainVirtType *virtType) -{ - int ret =3D -1; - virJSONValuePtr cmd =3D qemuMonitorJSONMakeCommand("query-kvm", - NULL); - virJSONValuePtr reply =3D NULL; - virJSONValuePtr data; - bool val =3D false; - - *virtType =3D 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 =3D 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 =3D VIR_DOMAIN_VIRT_KVM; - - ret =3D 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(con= st void *opaque) return 0; } =20 -static int -testQemuMonitorJSONqemuMonitorJSONGetVirtType(const void *opaque) -{ - const testGenericData *data =3D opaque; - virDomainXMLOptionPtr xmlopt =3D data->xmlopt; - virDomainVirtType virtType; - g_autoptr(qemuMonitorTest) test =3D NULL; - - if (!(test =3D 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), &virtT= ype) < 0) - return -1; - - if (virtType !=3D 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), &virtT= ype) < 0) - return -1; - - if (virtType !=3D 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); --=20 2.26.2