]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
Do not ignore error, if open file failed (-serial /dev/tty)
authorEvgeniy Dushistov <dushistov@mail.ru>
Thu, 28 Jan 2010 18:44:46 +0000 (21:44 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 10 Feb 2010 17:56:56 +0000 (11:56 -0600)
In case, when qemu is executed with option like
-serial /dev/ttyS0, report if there are problems with
opening of devices. At now errors are silently ignoring.

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char.c

index 800ee6c503b6e7cf4479f4ed7d04ce9008fff567..75dbf66858561c51bc4ea134a49bf0d0cb1d73da 100644 (file)
@@ -1180,6 +1180,9 @@ static CharDriverState *qemu_chr_open_tty(QemuOpts *opts)
     int fd;
 
     TFR(fd = open(filename, O_RDWR | O_NONBLOCK));
+    if (fd < 0) {
+        return NULL;
+    }
     tty_serial_init(fd, 115200, 'N', 8, 1);
     chr = qemu_chr_open_fd(fd, fd);
     if (!chr) {