From nobody Fri May 3 06:59:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1486456551460626.1802341700197; Tue, 7 Feb 2017 00:35:51 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v178VdUZ002963; Tue, 7 Feb 2017 03:31:40 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v178VcCR003190 for ; Tue, 7 Feb 2017 03:31:38 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v178Vcol008629 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 7 Feb 2017 03:31:38 -0500 Received: from m15-114.126.com (m15-114.126.com [220.181.15.114]) by mx1.redhat.com (Postfix) with ESMTP id 7DFCB3B712 for ; Tue, 7 Feb 2017 08:31:36 +0000 (UTC) Received: from localhost.localdomain.localdomain (unknown [58.213.111.46]) by smtp7 (Coremail) with SMTP id DsmowABnClXZhZlYOcjlEw--.2718S2; Tue, 07 Feb 2017 16:31:28 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=UijTBvL/vFYQocTAJS B9HtfeNL8CyYY3dVKGDnkU8Dk=; b=XNd6pY9A/Fdy8DW57k4gEKPF3EAs+6NX/k 6b6tU8ooHodN+R1hhK32FM1h1Zx4O5Xbr+Leod3FpNNfwiz++FmckzuVSuuSKYIz wQWOGAjAg1gcGmfI3ldmRgJIBMP/IWcRtNl+BPucZq2fHWJK702CAR+T9sdNO2Fq uiMwVpRu4= From: Chen Hanxiao To: libvir-list@redhat.com Date: Tue, 7 Feb 2017 16:31:20 +0800 Message-Id: <1486456280-30294-1-git-send-email-chen_han_xiao@126.com> X-CM-TRANSID: DsmowABnClXZhZlYOcjlEw--.2718S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxWFWrCw15urWfXFyDXF1fJFb_yoW5GF13pr srur45Kas5Xr47GF1kJrWkXF1a9w15W343tFZ0gr9aqw1kWF1Uur1xA3y0vrWjyFs3Cw17 Wa40qrZrKrn3J3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jSv38UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbitQB3rlYY7lzjswAAsA X-Greylist: Delayed for 96:07:22 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 07 Feb 2017 08:31:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 07 Feb 2017 08:31:37 +0000 (UTC) for IP:'220.181.15.114' DOMAIN:'m15-114.126.com' HELO:'m15-114.126.com' FROM:'chen_han_xiao@126.com' RCPT:'' X-RedHat-Spam-Score: 3.599 *** (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_ANBREP_L2, RCVD_IN_PSBL, RP_MATCHES_RCVD, SPF_PASS) 220.181.15.114 m15-114.126.com 220.181.15.114 m15-114.126.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: libvir-list@redhat.com Cc: Chen Hanxiao Subject: [libvirt] [PATCH] qemu_capabilities: introduce QEMU_CAPS_SD_CARD to probe sd-card drivers 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Chen Hanxiao This patch introduces QEMU_CAPS_SD_CARD for probing whether qemu support SD card by: {"execute": "device-list-properties", "arguments":{"typename":"sd-card"}} It will be helpful for apps which used cmd 'virsh domcaps` etc. Also helpful for: https://bugzilla.redhat.com/show_bug.cgi?id=3D1387218 Signed-off-by: Chen Hanxiao --- src/qemu/qemu_capabilities.c | 9 +++++++-- src/qemu/qemu_capabilities.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3247d25..b200b37 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -357,6 +357,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, =20 "query-cpu-model-expansion", /* 245 */ "virtio-net.host_mtu", + "sd-card", ); =20 =20 @@ -1624,6 +1625,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "ivshmem-plain", QEMU_CAPS_DEVICE_IVSHMEM_PLAIN }, { "ivshmem-doorbell", QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL }, { "vhost-scsi", QEMU_CAPS_DEVICE_VHOST_SCSI }, + { "sd-card", QEMU_CAPS_SD_CARD }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[]= =3D { @@ -5193,8 +5195,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qe= muCaps, VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_IDE, VIR_DOMAIN_DISK_BUS_SCSI, - VIR_DOMAIN_DISK_BUS_VIRTIO, - /* VIR_DOMAIN_DISK_BUS_SD */); + VIR_DOMAIN_DISK_BUS_VIRTIO); =20 /* PowerPC pseries based VMs do not support floppy device */ if (!ARCH_IS_PPC64(qemuCaps->arch) || @@ -5203,6 +5204,10 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr q= emuCaps, =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_USB); + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SD_CARD)) + VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_SD); + return 0; } =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 95bb67d..85e7959 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -393,6 +393,7 @@ typedef enum { /* 245 */ QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION, /* qmp query-cpu-model-expansion = */ QEMU_CAPS_VIRTIO_NET_HOST_MTU, /* virtio-net-*.host_mtu */ + QEMU_CAPS_SD_CARD, /* -sd abc.img */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list