From nobody Sat Apr 20 01:22:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 14888025722491.16669316708942; Mon, 6 Mar 2017 04:16:12 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v26CCgl6046857; Mon, 6 Mar 2017 07:12:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v26CCfpo015199 for ; Mon, 6 Mar 2017 07:12:41 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v26CCfMv023488 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 6 Mar 2017 07:12:41 -0500 Received: from m15-112.126.com (m15-112.126.com [220.181.15.112]) by mx1.redhat.com (Postfix) with ESMTP id B0283C0467CA for ; Mon, 6 Mar 2017 12:12:39 +0000 (UTC) Received: from localhost.localdomain.localdomain (unknown [58.213.111.46]) by smtp2 (Coremail) with SMTP id DMmowADHbBnPSr1YrcsRDg--.20745S2; Mon, 06 Mar 2017 19:41:10 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=bFOmdqTYkyr8i6Favn 2dNT9e5SCvTnY0ODVRKs88jr4=; b=cdUiax1HWmbps9eeyavDm/03LTdgv2eq7x lyE6f7vZ0TPnsVb+mOou+oBrwtcMf0x8dNLvP6YKfbBgNHJ4FZ9Z2TZBSP5RwwRD ggjhQy5Rcwr68Ryvx94On2HnGgVcKxIp3wPu7/V3PaFe1eNzigG/JdGkibVgBF8x PXiC98U8w= From: Chen Hanxiao To: libvir-list@redhat.com Date: Mon, 6 Mar 2017 19:40:30 +0800 Message-Id: <1488800430-19547-1-git-send-email-chen_han_xiao@126.com> X-CM-TRANSID: DMmowADHbBnPSr1YrcsRDg--.20745S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxWFWxtFyxJFy7XryUGry3urg_yoW5ury8pr 4Dur45Kas5Xr47GFykXrWvvF1Y93Z8W347ta90gr9Yvw1kKF18ur1xA340qrWYyFs3Aw13 XFy0qrZrGFn3A3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jV4E_UUUUU= X-Originating-IP: [58.213.111.46] X-CM-SenderInfo: xfkh0spkdqs5xldrqiyswou0bp/1tbiFgOSrlhgj6GS6wABsH X-Greylist: Delayed for 00:31:25 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 06 Mar 2017 12:12:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 06 Mar 2017 12:12:40 +0000 (UTC) for IP:'220.181.15.112' DOMAIN:'m15-112.126.com' HELO:'m15-112.126.com' FROM:'chen_han_xiao@126.com' RCPT:'' X-RedHat-Spam-Score: 2.799 ** (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_PSBL, RP_MATCHES_RCVD, SPF_PASS) 220.181.15.112 m15-112.126.com 220.181.15.112 m15-112.126.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Chen Hanxiao Subject: [libvirt] [PATCH v2.1] 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 --- v2: rebased on upstream v2.1: add doc/news.xml description rebased on upstream docs/news.xml | 9 +++++++++ src/qemu/qemu_capabilities.c | 9 +++++++-- src/qemu/qemu_capabilities.h | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/news.xml b/docs/news.xml index 584c9af..b218463 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -26,6 +26,15 @@ don't start it with unsupported features. + + + qemu_capabilities: introduce QEMU_CAPS_SD_CARD to probe sd-car= d drivers + + + The new QEMU capability flag will allow libvirt to probe sd-card + drivers. + +
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5694d0b..1828b30 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -359,6 +359,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "query-cpu-model-expansion", /* 245 */ "virtio-net.host_mtu", "spice-rendernode", + "sd-card", ); =20 =20 @@ -1626,6 +1627,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 { @@ -5425,8 +5427,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) || @@ -5435,6 +5436,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 cc9f46e..decca12 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -394,6 +394,7 @@ typedef enum { QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION, /* qmp query-cpu-model-expansion = */ QEMU_CAPS_VIRTIO_NET_HOST_MTU, /* virtio-net-*.host_mtu */ QEMU_CAPS_SPICE_RENDERNODE, /* -spice rendernode */ + QEMU_CAPS_SD_CARD, /* -sd SD-card.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