Patchwork [06/10] serial: make optional

login
register
mail settings
Submitter Blue Swirl
Date Feb. 12, 2011, 10:42 p.m.
Message ID <AANLkTikmiPy75P+oqOa+x+c811=oTChMgOR=TCUO3Rw4@mail.gmail.com>
Download mbox | patch
Permalink /patch/82950/
State New
Headers show

Comments

Blue Swirl - Feb. 12, 2011, 10:42 p.m.
Ignore failure with serial device creation.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/pc.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

     if (qdev_init(&dev->qdev) < 0) {

Patch

diff --git a/hw/pc.h b/hw/pc.h
index 09f63f0..89b43ea 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -21,7 +21,10 @@  static inline bool serial_isa_init(int index,
CharDriverState *chr)
 {
     ISADevice *dev;

-    dev = isa_create("isa-serial");
+    dev = isa_try_create("isa-serial");
+    if (!dev) {
+        return false;
+    }
     qdev_prop_set_uint32(&dev->qdev, "index", index);
     qdev_prop_set_chr(&dev->qdev, "chardev", chr);