From 9b13ef9f4c5be62bf405ab4291e090631089707f Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sat, 5 Feb 2011 21:30:42 +0000 Subject: serial: make optional Ignore failure with serial device creation. Signed-off-by: Blue Swirl --- hw/pc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hw') 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); if (qdev_init(&dev->qdev) < 0) { -- cgit v1.1