* [Qemu-devel] [PULL 1/4] virtio: Fix error handling in virtio_bus_device_plugged
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
@ 2017-03-22 16:01 ` Michael S. Tsirkin
2017-03-22 16:01 ` [Qemu-devel] [PULL 2/4] virtio: always use handle_aio_output if registered Michael S. Tsirkin
` (4 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:01 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Fam Zheng, Cornelia Huck, Andrew Jones,
Philippe Mathieu-Daudé
From: Fam Zheng <famz@redhat.com>
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 <famz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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, Error **errp)
VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev);
bool has_iommu = virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM);
+ Error *local_err = NULL;
DPRINTF("%s: plug device.\n", qbus->name);
if (klass->pre_plugged != NULL) {
- klass->pre_plugged(qbus->parent, errp);
+ klass->pre_plugged(qbus->parent, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
}
/* Get the features of the plugged device. */
assert(vdc->get_features != NULL);
vdev->host_features = vdc->get_features(vdev, vdev->host_features,
- errp);
+ &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
+ }
if (klass->device_plugged != NULL) {
- klass->device_plugged(qbus->parent, errp);
+ klass->device_plugged(qbus->parent, &local_err);
+ }
+ if (local_err) {
+ error_propagate(errp, local_err);
+ return;
}
if (klass->get_dma_as != NULL && has_iommu) {
--
MST
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PULL 2/4] virtio: always use handle_aio_output if registered
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
2017-03-22 16:01 ` [Qemu-devel] [PULL 1/4] virtio: Fix error handling in virtio_bus_device_plugged Michael S. Tsirkin
@ 2017-03-22 16:01 ` Michael S. Tsirkin
2017-03-22 16:01 ` [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types Michael S. Tsirkin
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:01 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Paolo Bonzini, qemu-stable, Stefan Hajnoczi
From: Paolo Bonzini <pbonzini@redhat.com>
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 <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
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)
void virtio_queue_notify(VirtIODevice *vdev, int n)
{
- virtio_queue_notify_vq(&vdev->vq[n]);
+ VirtQueue *vq = &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);
+ }
}
uint16_t virtio_queue_vector(VirtIODevice *vdev, int n)
--
MST
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
2017-03-22 16:01 ` [Qemu-devel] [PULL 1/4] virtio: Fix error handling in virtio_bus_device_plugged Michael S. Tsirkin
2017-03-22 16:01 ` [Qemu-devel] [PULL 2/4] virtio: always use handle_aio_output if registered Michael S. Tsirkin
@ 2017-03-22 16:01 ` Michael S. Tsirkin
2017-03-22 16:19 ` Laszlo Ersek
2017-03-22 16:01 ` [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device Michael S. Tsirkin
` (2 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:01 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Laszlo Ersek, Ben Warren, Igor Mammedov,
Paolo Bonzini
From: Laszlo Ersek <lersek@redhat.com>
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" <mst@redhat.com>
Cc: Ben Warren <ben@skyportsystems.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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;
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 = "fw_cfg_io",\
.property = "dma_enabled",\
.value = "off",\
+ },{\
+ .driver = "vmgenid",\
+ .property = "x-write-pointer-available",\
+ .value = "off",\
},
#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));
}
+static Property vmgenid_properties[] = {
+ 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 = 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_DEVICE);
+ return;
+ }
+
qemu_register_reset(vmgenid_handle_reset, vms);
}
@@ -218,6 +231,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
dc->vmsd = &vmstate_vmgenid;
dc->realize = vmgenid_realize;
dc->hotpluggable = false;
+ dc->props = vmgenid_properties;
object_class_property_add_str(klass, VMGENID_GUID, NULL,
vmgenid_set_guid, NULL);
--
MST
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types
2017-03-22 16:01 ` [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types Michael S. Tsirkin
@ 2017-03-22 16:19 ` Laszlo Ersek
0 siblings, 0 replies; 11+ messages in thread
From: Laszlo Ersek @ 2017-03-22 16:19 UTC (permalink / raw)
To: Michael S. Tsirkin, qemu-devel
Cc: Peter Maydell, Ben Warren, Igor Mammedov, Paolo Bonzini
On 03/22/17 17:01, Michael S. Tsirkin wrote:
> From: Laszlo Ersek <lersek@redhat.com>
>
> 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" <mst@redhat.com>
> Cc: Ben Warren <ben@skyportsystems.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Can you please add the feedback tags from Ben and Igor?
http://mid.mail-archive.com/20170321131306.332253d2@nial.brq.redhat.com
http://mid.mail-archive.com/71BEDF9C-3FA5-4F2B-8763-5169B729103B@skyportsystems.com
Thanks,
Laszlo
> ---
> 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;
>
> 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 = "fw_cfg_io",\
> .property = "dma_enabled",\
> .value = "off",\
> + },{\
> + .driver = "vmgenid",\
> + .property = "x-write-pointer-available",\
> + .value = "off",\
> },
>
> #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));
> }
>
> +static Property vmgenid_properties[] = {
> + 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 = 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_DEVICE);
> + return;
> + }
> +
> qemu_register_reset(vmgenid_handle_reset, vms);
> }
>
> @@ -218,6 +231,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
> dc->vmsd = &vmstate_vmgenid;
> dc->realize = vmgenid_realize;
> dc->hotpluggable = false;
> + dc->props = vmgenid_properties;
>
> object_class_property_add_str(klass, VMGENID_GUID, NULL,
> vmgenid_set_guid, NULL);
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
` (2 preceding siblings ...)
2017-03-22 16:01 ` [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types Michael S. Tsirkin
@ 2017-03-22 16:01 ` Michael S. Tsirkin
2017-03-22 16:21 ` Laszlo Ersek
2017-03-22 16:28 ` [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
2017-03-23 11:39 ` Peter Maydell
5 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:01 UTC (permalink / raw)
To: qemu-devel
Cc: Peter Maydell, Laszlo Ersek, Ben Warren, Igor Mammedov,
Paolo Bonzini
From: Laszlo Ersek <lersek@redhat.com>
A system with multiple VMGENID devices is undefined in the VMGENID spec by
omission.
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ben Warren <ben@skyportsystems.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
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;
+/* 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;
}
+ /* 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_DEVICE);
+ return;
+ }
+
qemu_register_reset(vmgenid_handle_reset, vms);
}
--
MST
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device
2017-03-22 16:01 ` [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device Michael S. Tsirkin
@ 2017-03-22 16:21 ` Laszlo Ersek
2017-03-22 16:31 ` Michael S. Tsirkin
0 siblings, 1 reply; 11+ messages in thread
From: Laszlo Ersek @ 2017-03-22 16:21 UTC (permalink / raw)
To: Michael S. Tsirkin, qemu-devel
Cc: Peter Maydell, Ben Warren, Igor Mammedov, Paolo Bonzini
On 03/22/17 17:01, Michael S. Tsirkin wrote:
> From: Laszlo Ersek <lersek@redhat.com>
>
> A system with multiple VMGENID devices is undefined in the VMGENID spec by
> omission.
>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ben Warren <ben@skyportsystems.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Can you please add the feedback tags from Igor and Ben?
http://mid.mail-archive.com/23205322-903E-42E2-99D7-ED8351E62694@skyportsystems.com
http://mid.mail-archive.com/20170321131414.08cc6bfa@nial.brq.redhat.com
> Binary file /tmp/tmp.IaAwzHwwsQ matches
I'm not sure what this means.
Thanks,
Laszlo
> ---
> 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;
>
> +/* 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;
> }
>
> + /* 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_DEVICE);
> + return;
> + }
> +
> qemu_register_reset(vmgenid_handle_reset, vms);
> }
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device
2017-03-22 16:21 ` Laszlo Ersek
@ 2017-03-22 16:31 ` Michael S. Tsirkin
0 siblings, 0 replies; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:31 UTC (permalink / raw)
To: Laszlo Ersek
Cc: qemu-devel, Peter Maydell, Ben Warren, Igor Mammedov,
Paolo Bonzini
On Wed, Mar 22, 2017 at 05:21:32PM +0100, Laszlo Ersek wrote:
> On 03/22/17 17:01, Michael S. Tsirkin wrote:
> > From: Laszlo Ersek <lersek@redhat.com>
> >
> > A system with multiple VMGENID devices is undefined in the VMGENID spec by
> > omission.
> >
> > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > Cc: Ben Warren <ben@skyportsystems.com>
> > Cc: Igor Mammedov <imammedo@redhat.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> Can you please add the feedback tags from Igor and Ben?
>
> http://mid.mail-archive.com/23205322-903E-42E2-99D7-ED8351E62694@skyportsystems.com
> http://mid.mail-archive.com/20170321131414.08cc6bfa@nial.brq.redhat.com
>
> > Binary file /tmp/tmp.IaAwzHwwsQ matches
>
> I'm not sure what this means.
>
> Thanks,
> Laszlo
Fixed, thanks for paying attention.
> > ---
> > 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;
> >
> > +/* 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;
> > }
> >
> > + /* 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_DEVICE);
> > + return;
> > + }
> > +
> > qemu_register_reset(vmgenid_handle_reset, vms);
> > }
> >
> >
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] virtio, pc: fixes
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
` (3 preceding siblings ...)
2017-03-22 16:01 ` [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device Michael S. Tsirkin
@ 2017-03-22 16:28 ` Michael S. Tsirkin
2017-03-22 16:30 ` Michael S. Tsirkin
2017-03-23 11:39 ` Peter Maydell
5 siblings, 1 reply; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell
On Wed, Mar 22, 2017 at 06:01:31PM +0200, Michael S. Tsirkin wrote:
> The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:
>
> Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to 807211b76603b094c46a0cd95a3c785f47f3ab73:
>
> hw/acpi/vmgenid: prevent more than one vmgenid device (2017-03-22 17:56:00 +0200)
I tweaked commit log on two patches at submitter's request.
Pushed 160f57134960e6356257e54408f6bce382aac5f6 - same tree.
> ----------------------------------------------------------------
> virtio, pc: fixes
>
> virtio and misc fixes for 2.9.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> ----------------------------------------------------------------
> Fam Zheng (1):
> virtio: Fix error handling in virtio_bus_device_plugged
>
> Laszlo Ersek (2):
> hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types
> hw/acpi/vmgenid: prevent more than one vmgenid device
>
> Paolo Bonzini (1):
> virtio: always use handle_aio_output if registered
>
> include/hw/acpi/vmgenid.h | 2 ++
> include/hw/compat.h | 4 ++++
> hw/acpi/vmgenid.c | 22 ++++++++++++++++++++++
> hw/virtio/virtio-bus.c | 20 +++++++++++++++++---
> hw/virtio/virtio.c | 13 ++++++++++++-
> 5 files changed, 57 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] virtio, pc: fixes
2017-03-22 16:28 ` [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
@ 2017-03-22 16:30 ` Michael S. Tsirkin
0 siblings, 0 replies; 11+ messages in thread
From: Michael S. Tsirkin @ 2017-03-22 16:30 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell
On Wed, Mar 22, 2017 at 06:28:49PM +0200, Michael S. Tsirkin wrote:
> On Wed, Mar 22, 2017 at 06:01:31PM +0200, Michael S. Tsirkin wrote:
> > The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:
> >
> > Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> >
> > for you to fetch changes up to 807211b76603b094c46a0cd95a3c785f47f3ab73:
> >
> > hw/acpi/vmgenid: prevent more than one vmgenid device (2017-03-22 17:56:00 +0200)
>
> I tweaked commit log on two patches at submitter's request.
> Pushed 160f57134960e6356257e54408f6bce382aac5f6 - same tree.
It's really f92063028a0ea9e15d8f962644bce76c0e8aa7d1
sorry about the noise.
> > ----------------------------------------------------------------
> > virtio, pc: fixes
> >
> > virtio and misc fixes for 2.9.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> >
> > ----------------------------------------------------------------
> > Fam Zheng (1):
> > virtio: Fix error handling in virtio_bus_device_plugged
> >
> > Laszlo Ersek (2):
> > hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types
> > hw/acpi/vmgenid: prevent more than one vmgenid device
> >
> > Paolo Bonzini (1):
> > virtio: always use handle_aio_output if registered
> >
> > include/hw/acpi/vmgenid.h | 2 ++
> > include/hw/compat.h | 4 ++++
> > hw/acpi/vmgenid.c | 22 ++++++++++++++++++++++
> > hw/virtio/virtio-bus.c | 20 +++++++++++++++++---
> > hw/virtio/virtio.c | 13 ++++++++++++-
> > 5 files changed, 57 insertions(+), 4 deletions(-)
> >
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Qemu-devel] [PULL 0/4] virtio, pc: fixes
2017-03-22 16:01 [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
` (4 preceding siblings ...)
2017-03-22 16:28 ` [Qemu-devel] [PULL 0/4] virtio, pc: fixes Michael S. Tsirkin
@ 2017-03-23 11:39 ` Peter Maydell
5 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2017-03-23 11:39 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: QEMU Developers
On 22 March 2017 at 16:01, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit 55a19ad8b2d0797e3a8fe90ab99a9bb713824059:
>
> Update version for v2.9.0-rc1 release (2017-03-21 17:13:29 +0000)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to 807211b76603b094c46a0cd95a3c785f47f3ab73:
>
> hw/acpi/vmgenid: prevent more than one vmgenid device (2017-03-22 17:56:00 +0200)
>
> ----------------------------------------------------------------
> virtio, pc: fixes
>
> virtio and misc fixes for 2.9.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 11+ messages in thread