-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkvm-Do-not-ignore-error-if-open-file-failed-serial-dev-t.patch
52 lines (44 loc) · 1.73 KB
/
kvm-Do-not-ignore-error-if-open-file-failed-serial-dev-t.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From fc971c84325434725b2580a7e7397b007ce7a936 Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <[email protected]>
Date: Mon, 1 Mar 2010 20:52:11 -0300
Subject: [PATCH 08/20] Do not ignore error, if open file failed (-serial /dev/tty)
RH-Author: Marcelo Tosatti <[email protected]>
Message-id: <39ce3091968908df84a120c94b84d77945b0f885.1267476474.git.mtosatti@redhat.com>
Patchwork-id: 7355
O-Subject: [PATCH 09/21] Do not ignore error,
if open file failed (-serial /dev/tty)
Bugzilla: 569613
RH-Acked-by: Markus Armbruster <[email protected]>
RH-Acked-by: Luiz Capitulino <[email protected]>
RH-Acked-by: Gleb Natapov <[email protected]>
RH-Acked-by: Glauber Costa <[email protected]>
From: Evgeniy Dushistov <[email protected]>
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 <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
(cherry picked from commit afc535acb579a7808d9ff170088c839a29c61dc9)
(cherry picked from commit 02510b24368f76b5e8eb3edbca880d177869f265)
---
qemu-char.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
Signed-off-by: Eduardo Habkost <[email protected]>
---
qemu-char.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index b13f8d4..5a1b535 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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) {
--
1.7.0.3