[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgen
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device |
Date: |
Wed, 22 Mar 2017 17:21:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 03/22/17 17:01, Michael S. Tsirkin wrote:
> From: Laszlo Ersek <address@hidden>
>
> A system with multiple VMGENID devices is undefined in the VMGENID spec by
> omission.
>
> Cc: "Michael S. Tsirkin" <address@hidden>
> Cc: Ben Warren <address@hidden>
> Cc: Igor Mammedov <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Laszlo Ersek <address@hidden>
> Reviewed-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
Can you please add the feedback tags from Igor and Ben?
http://mid.mail-archive.com/address@hidden
http://mid.mail-archive.com/address@hidden
> 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);
> }
>
>
- [Qemu-devel] [PULL 0/4] virtio, pc: fixes, Michael S. Tsirkin, 2017/03/22
- [Qemu-devel] [PULL 3/4] hw/acpi/vmgenid: prevent device realization on pre-2.5 machine types, Michael S. Tsirkin, 2017/03/22
- [Qemu-devel] [PULL 1/4] virtio: Fix error handling in virtio_bus_device_plugged, Michael S. Tsirkin, 2017/03/22
- [Qemu-devel] [PULL 2/4] virtio: always use handle_aio_output if registered, Michael S. Tsirkin, 2017/03/22
- [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device, Michael S. Tsirkin, 2017/03/22
- Re: [Qemu-devel] [PULL 4/4] hw/acpi/vmgenid: prevent more than one vmgenid device,
Laszlo Ersek <=
- Re: [Qemu-devel] [PULL 0/4] virtio, pc: fixes, Michael S. Tsirkin, 2017/03/22
- Re: [Qemu-devel] [PULL 0/4] virtio, pc: fixes, Peter Maydell, 2017/03/23