]> git.ipfire.org Git - thirdparty/qemu.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>
Tue, 23 Feb 2010 20:07:57 +0000 (14:07 -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>
(cherry picked from commit afc535acb579a7808d9ff170088c839a29c61dc9)

qemu-char.c

index b13f8d4cf7e119564be6c2b017ae8f54db082c7b..5a1b535bdccd14c070a02d56fcdc446c785db902 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) {