From nobody Sat Apr 27 11:49:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490198951826318.65314350316237; Wed, 22 Mar 2017 09:09:11 -0700 (PDT) Received: from localhost ([::1]:51955 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqiow-0000fx-7w for importer@patchew.org; Wed, 22 Mar 2017 12:09:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqihl-0002vW-Ms for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqihk-0007Ca-My for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:38742) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqihk-0007C8-H1 for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:44 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A593520396; Wed, 22 Mar 2017 16:01:37 +0000 (UTC) Received: from redhat.com (pool-98-118-0-53.bstnma.fios.verizon.net [98.118.0.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D62CF20373; Wed, 22 Mar 2017 16:01:35 +0000 (UTC) Date: Wed, 22 Mar 2017 18:01:34 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1490198476-12244-2-git-send-email-mst@redhat.com> References: <1490198476-12244-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490198476-12244-1-git-send-email-mst@redhat.com> X-Mailer: git-send-email 2.8.0.287.g0deeb61 X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL 1/4] virtio: Fix error handling in virtio_bus_device_plugged X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Cornelia Huck , Peter Maydell , Andrew Jones , Fam Zheng , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng For one thing we shouldn't continue if an error happened, for the other two steps failing can cause an abort() in error_setg because we reuse the same errp blindly. Add error handling checks to fix both issues. Signed-off-by: Fam Zheng Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Reviewed-by: Andrew Jones Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/virtio/virtio-bus.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c index a886011..3042232 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "hw/hw.h" #include "qemu/error-report.h" +#include "qapi/error.h" #include "hw/qdev.h" #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio.h" @@ -48,20 +49,33 @@ void virtio_bus_device_plugged(VirtIODevice *vdev, Erro= r **errp) VirtioBusClass *klass =3D VIRTIO_BUS_GET_CLASS(bus); VirtioDeviceClass *vdc =3D VIRTIO_DEVICE_GET_CLASS(vdev); bool has_iommu =3D virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFO= RM); + Error *local_err =3D NULL; =20 DPRINTF("%s: plug device.\n", qbus->name); =20 if (klass->pre_plugged !=3D NULL) { - klass->pre_plugged(qbus->parent, errp); + klass->pre_plugged(qbus->parent, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } } =20 /* Get the features of the plugged device. */ assert(vdc->get_features !=3D NULL); vdev->host_features =3D vdc->get_features(vdev, vdev->host_features, - errp); + &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } =20 if (klass->device_plugged !=3D NULL) { - klass->device_plugged(qbus->parent, errp); + klass->device_plugged(qbus->parent, &local_err); + } + if (local_err) { + error_propagate(errp, local_err); + return; } =20 if (klass->get_dma_as !=3D NULL && has_iommu) { --=20 MST From nobody Sat Apr 27 11:49:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490199166198319.16998790448304; Wed, 22 Mar 2017 09:12:46 -0700 (PDT) Received: from localhost ([::1]:51995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqisO-0003pk-RA for importer@patchew.org; Wed, 22 Mar 2017 12:12:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqihv-00032Q-OJ for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqihn-0007De-CF for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:51 -0400 Received: from mail.kernel.org ([198.145.29.136]:38796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqihn-0007DJ-5N; Wed, 22 Mar 2017 12:01:47 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A829203AE; Wed, 22 Mar 2017 16:01:40 +0000 (UTC) Received: from redhat.com (pool-98-118-0-53.bstnma.fios.verizon.net [98.118.0.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B751B20251; Wed, 22 Mar 2017 16:01:38 +0000 (UTC) Date: Wed, 22 Mar 2017 18:01:37 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1490198476-12244-3-git-send-email-mst@redhat.com> References: <1490198476-12244-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490198476-12244-1-git-send-email-mst@redhat.com> X-Mailer: git-send-email 2.8.0.287.g0deeb61 X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL 2/4] virtio: always use handle_aio_output if registered X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-stable@nongnu.org, Stefan Hajnoczi , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Commit ad07cd6 ("virtio-scsi: always use dataplane path if ioeventfd is active", 2016-10-30) and 9ffe337 ("virtio-blk: always use dataplane path if ioeventfd is active", 2016-10-30) broke the virtio 1.0 indirect access registers. The indirect access registers bypass the ioeventfd, so that virtio-blk and virtio-scsi now repeatedly try to initialize dataplane instead of triggering the guest->host EventNotifier. Detect the situation by checking vq->handle_aio_output; if it is not NULL, trigger the EventNotifier, which is how the device expects to get notifications and in fact the only thread-safe manner to deliver them. Fixes: ad07cd6 Fixes: 9ffe337 Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 82b6060..03592c5 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1528,7 +1528,18 @@ static void virtio_queue_notify_vq(VirtQueue *vq) =20 void virtio_queue_notify(VirtIODevice *vdev, int n) { - virtio_queue_notify_vq(&vdev->vq[n]); + VirtQueue *vq =3D &vdev->vq[n]; + + if (unlikely(!vq->vring.desc || vdev->broken)) { + return; + } + + trace_virtio_queue_notify(vdev, vq - vdev->vq, vq); + if (vq->handle_aio_output) { + event_notifier_set(&vq->host_notifier); + } else if (vq->handle_output) { + vq->handle_output(vdev, vq); + } } =20 uint16_t virtio_queue_vector(VirtIODevice *vdev, int n) --=20 MST From nobody Sat Apr 27 11:49:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490199324915353.95861183972374; Wed, 22 Mar 2017 09:15:24 -0700 (PDT) Received: from localhost ([::1]:52031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqiux-00067j-HX for importer@patchew.org; Wed, 22 Mar 2017 12:15:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqihm-0002vk-Hd for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqihl-0007Ct-DI for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:46 -0400 Received: from mail.kernel.org ([198.145.29.136]:38758) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqihl-0007CS-3Z for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:45 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1EEAB2025A; Wed, 22 Mar 2017 16:01:43 +0000 (UTC) Received: from redhat.com (pool-98-118-0-53.bstnma.fios.verizon.net [98.118.0.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6AC3D20220; Wed, 22 Mar 2017 16:01:41 +0000 (UTC) Date: Wed, 22 Mar 2017 18:01:40 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1490198476-12244-4-git-send-email-mst@redhat.com> References: <1490198476-12244-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490198476-12244-1-git-send-email-mst@redhat.com> X-Mailer: git-send-email 2.8.0.287.g0deeb61 X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini , Laszlo Ersek , Ben Warren , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laszlo Ersek The WRITE_POINTER linker/loader command that underlies VMGENID depends on commit baf2d5bfbac0 ("fw-cfg: support writeable blobs", 2017-01-12), which in turn depends on fw_cfg DMA. DMA for fw_cfg is enabled in 2.5+ machine types only (see commit e6915b5f3a87, "fw_cfg: unbreak migration compatibility for 2.4 and earlier machines", 2016-02-18). Cc: "Michael S. Tsirkin" Cc: Ben Warren Cc: Igor Mammedov Cc: Paolo Bonzini Signed-off-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/vmgenid.h | 1 + include/hw/compat.h | 4 ++++ hw/acpi/vmgenid.c | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index db7fa0e..8578476 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -21,6 +21,7 @@ typedef struct VmGenIdState { DeviceClass parent_obj; QemuUUID guid; /* The 128-bit GUID seen by the guest */ uint8_t vmgenid_addr_le[8]; /* Address of the GUID (little-endian) */ + bool write_pointer_available; } VmGenIdState; =20 static inline Object *find_vmgenid_dev(void) diff --git a/include/hw/compat.h b/include/hw/compat.h index fc8c3e0..5d5be91 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -131,6 +131,10 @@ .driver =3D "fw_cfg_io",\ .property =3D "dma_enabled",\ .value =3D "off",\ + },{\ + .driver =3D "vmgenid",\ + .property =3D "x-write-pointer-available",\ + .value =3D "off",\ }, =20 #define HW_COMPAT_2_3 \ diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index 7a3ad17..c3ddcc8 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -205,9 +205,22 @@ static void vmgenid_handle_reset(void *opaque) memset(vms->vmgenid_addr_le, 0, ARRAY_SIZE(vms->vmgenid_addr_le)); } =20 +static Property vmgenid_properties[] =3D { + DEFINE_PROP_BOOL("x-write-pointer-available", VmGenIdState, + write_pointer_available, true), + DEFINE_PROP_END_OF_LIST(), +}; + static void vmgenid_realize(DeviceState *dev, Error **errp) { VmGenIdState *vms =3D VMGENID(dev); + + if (!vms->write_pointer_available) { + error_setg(errp, "%s requires DMA write support in fw_cfg, " + "which this machine type does not provide", VMGENID_DEV= ICE); + return; + } + qemu_register_reset(vmgenid_handle_reset, vms); } =20 @@ -218,6 +231,7 @@ static void vmgenid_device_class_init(ObjectClass *klas= s, void *data) dc->vmsd =3D &vmstate_vmgenid; dc->realize =3D vmgenid_realize; dc->hotpluggable =3D false; + dc->props =3D vmgenid_properties; =20 object_class_property_add_str(klass, VMGENID_GUID, NULL, vmgenid_set_guid, NULL); --=20 MST From nobody Sat Apr 27 11:49:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490199090493161.87030342279297; Wed, 22 Mar 2017 09:11:30 -0700 (PDT) Received: from localhost ([::1]:51991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqirB-0002lg-4z for importer@patchew.org; Wed, 22 Mar 2017 12:11:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqihv-00032R-On for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqiho-0007EB-NJ for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:51 -0400 Received: from mail.kernel.org ([198.145.29.136]:38824) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqiho-0007Dq-HE for qemu-devel@nongnu.org; Wed, 22 Mar 2017 12:01:48 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CF332011D; Wed, 22 Mar 2017 16:01:46 +0000 (UTC) Received: from redhat.com (pool-98-118-0-53.bstnma.fios.verizon.net [98.118.0.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E08220220; Wed, 22 Mar 2017 16:01:44 +0000 (UTC) Date: Wed, 22 Mar 2017 18:01:43 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1490198476-12244-5-git-send-email-mst@redhat.com> References: <1490198476-12244-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1490198476-12244-1-git-send-email-mst@redhat.com> X-Mailer: git-send-email 2.8.0.287.g0deeb61 X-Mutt-Fcc: =sent X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 198.145.29.136 Subject: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini , Laszlo Ersek , Ben Warren , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Laszlo Ersek A system with multiple VMGENID devices is undefined in the VMGENID spec by omission. Cc: "Michael S. Tsirkin" Cc: Ben Warren Cc: Igor Mammedov Cc: Paolo Bonzini Signed-off-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Binary file /tmp/tmp.IaAwzHwwsQ matches --- include/hw/acpi/vmgenid.h | 1 + hw/acpi/vmgenid.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h index 8578476..7beb959 100644 --- a/include/hw/acpi/vmgenid.h +++ b/include/hw/acpi/vmgenid.h @@ -24,6 +24,7 @@ typedef struct VmGenIdState { bool write_pointer_available; } VmGenIdState; =20 +/* returns NULL unless there is exactly one device */ static inline Object *find_vmgenid_dev(void) { return object_resolve_path_type("", VMGENID_DEVICE, NULL); diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index c3ddcc8..a32b847 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -221,6 +221,14 @@ static void vmgenid_realize(DeviceState *dev, Error **= errp) return; } =20 + /* Given that this function is executing, there is at least one VMGENID + * device. Check if there are several. + */ + if (!find_vmgenid_dev()) { + error_setg(errp, "at most one %s device is permitted", VMGENID_DEV= ICE); + return; + } + qemu_register_reset(vmgenid_handle_reset, vms); } =20 --=20 MST