Skip to content
Snippets Groups Projects
Commit f6e41aea authored by Guido Günther's avatar Guido Günther
Browse files

New patch 0008-qemu-Use-log-output-for-pty-assignment-if-info-chard.patch

qemu: Use log output for pty assignment if 'info chardev' is unavailable
Thanks: Matthias Bolte
parent d8e60e8b
No related branches found
No related tags found
No related merge requests found
From: Matthias Bolte <matthias.bolte@googlemail.com>
Date: Mon, 18 Jan 2010 21:04:50 +0100
Subject: [PATCH] qemu: Use log output for pty assignment if 'info chardev' is unavailable
qemudFindCharDevicePTYsMonitor reports an error if 'info chardev' didn't
provide information for a requested device, even if the log output parsing
had found the pty path for that device. This makes pty assignment fail for
older QEMU/KVM versions. For example KVM 72 on Debian doesn't support
'info chardev', so qemuMonitorTextGetPtyPaths cannot parse any useful
information and the hash for device-id-to-pty-path mapping stays empty.
Make qemudFindCharDevicePTYsMonitor report an error only if the log output
parsing and the 'info chardev' parsing failed to provide the pty path.
---
src/qemu/qemu_driver.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 7dfa78f..9e44b46 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1428,9 +1428,17 @@ qemudFindCharDevicePTYsMonitor(virConnectPtr conn,
\
const char *path = (const char *) virHashLookup(paths, id); \
if (path == NULL) { \
- qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,\
- _("no assigned pty for device %s"), id); \
- return -1; \
+ if (chr->data.file.path == NULL) { \
+ /* neither the log output nor 'info chardev' had a */ \
+ /* pty path for this chardev, report an error */ \
+ qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, \
+ _("no assigned pty for device %s"), id); \
+ return -1; \
+ } else { \
+ /* 'info chardev' had no pty path for this chardev, */\
+ /* but the log output had, so we're fine */ \
+ continue; \
+ } \
} \
\
chr->data.file.path = strdup(path); \
--
......@@ -5,3 +5,4 @@
0005-Also-look-for-dmi-information-in-sys-class.patch
0006-Terminate-nc-on-EOF.patch
0007-Implement-path-lookup-for-USB-by-vendor-product.patch
0008-qemu-Use-log-output-for-pty-assignment-if-info-chard.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment