From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44323 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PofmU-0001Dt-M5 for qemu-devel@nongnu.org; Sun, 13 Feb 2011 12:30:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PofmT-0000Yo-FY for qemu-devel@nongnu.org; Sun, 13 Feb 2011 12:30:42 -0500 Received: from mail-yi0-f45.google.com ([209.85.218.45]:47305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PofmT-0000YL-An for qemu-devel@nongnu.org; Sun, 13 Feb 2011 12:30:41 -0500 Received: by yie21 with SMTP id 21so1932933yie.4 for ; Sun, 13 Feb 2011 09:30:39 -0800 (PST) Message-ID: <4D58153B.8010506@gmail.com> Date: Sun, 13 Feb 2011 10:30:35 -0700 From: David Ahern MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 02/10] parallel: make optional References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 02/12/11 15:40, Blue Swirl wrote: > Ignore failure with parallel device creation. > > Signed-off-by: Blue Swirl > --- > 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