qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/10] parallel: make optional


From: David Ahern
Subject: Re: [Qemu-devel] [PATCH 02/10] parallel: make optional
Date: Sun, 13 Feb 2011 10:30:35 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc13 Thunderbird/3.1.7


On 02/12/11 15:40, Blue Swirl wrote:
> Ignore failure with parallel device creation.
> 
> Signed-off-by: Blue Swirl <address@hidden>
> ---
>  hw/pc.h |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pc.h b/hw/pc.h
> index 443ba34..f823b7d 100644
> --- a/hw/pc.h
> +++ b/hw/pc.h
> @@ -24,7 +24,10 @@ static inline bool parallel_init(int index,
> CharDriverState *chr)
>  {
>      ISADevice *dev;
> 
> -    dev = isa_create("isa-parallel");
> +    dev = isa_try_create("isa-parallel");
> +    if (!dev) {
> +        return false;
> +    }
>      qdev_prop_set_uint32(&dev->qdev, "index", index);
>      qdev_prop_set_chr(&dev->qdev, "chardev", chr);
>      if (qdev_init(&dev->qdev) < 0) {


How is this design supposed to be better than wrapping init functions in
#ifdef CONFIG_XXXX ... #endif?

If a hardware model is compiled out via the CONFIG options qemu should
fail to accept the command line parameters and not try to create the
device. Instead with this design it tries and fails to create the device
and yet continues on.

David



reply via email to

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