qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-stable] [PATCH] qdev-monitor: device_add crashes on non-device


From: Markus Armbruster
Subject: Re: [Qemu-stable] [PATCH] qdev-monitor: device_add crashes on non-device driver name, fix
Date: Wed, 18 Dec 2013 15:54:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Ping?

address@hidden writes:

> From: Markus Armbruster <address@hidden>
>
> Watch this:
>
>     $ upstream-qemu -nodefaults -S -display none -monitor stdio
>     QEMU 1.7.50 monitor - type 'help' for more information
>     (qemu) device_add rng-egd
>     /work/armbru/qemu/qdev-monitor.c:491:qdev_device_add: Object 0x2089b00 is 
> not an instance of type device
>     Aborted (core dumped)
>
> Crashes because "rng-egd" exists, but isn't a subtype of TYPE_DEVICE.
> Broken in commit 18b6dad.
>
> Cc: address@hidden
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  qdev-monitor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/qdev-monitor.c b/qdev-monitor.c
> index dc37a43..90a0cea 100644
> --- a/qdev-monitor.c
> +++ b/qdev-monitor.c
> @@ -477,7 +477,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
>          }
>      }
>  
> -    if (!oc) {
> +    if (!object_class_dynamic_cast(oc, TYPE_DEVICE)) {
>          qerror_report(QERR_INVALID_PARAMETER_VALUE, "driver", "device type");
>          return NULL;
>      }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]