[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, master, updated. debian/0.7.5-5-4-g959640d

Guido Günther agx at sigxcpu.org
Sun Jan 31 17:22:39 UTC 2010


The following commit has been merged in the master branch:
commit 959640daf2a9c886606c3aabfbe574f3b8ae5f64
Author: Guido Günther <agx at sigxcpu.org>
Date:   Sun Jan 31 18:00:34 2010 +0100

    New patch 0011-Fix-parsing-of-info-chardev-line-endings.patch
    
    Fix parsing of 'info chardev' line endings
    Thanks: Matthew Booth
    
    Closes: #567818

diff --git a/debian/patches/0011-Fix-parsing-of-info-chardev-line-endings.patch b/debian/patches/0011-Fix-parsing-of-info-chardev-line-endings.patch
new file mode 100644
index 0000000..445a18f
--- /dev/null
+++ b/debian/patches/0011-Fix-parsing-of-info-chardev-line-endings.patch
@@ -0,0 +1,76 @@
+From: Matthew Booth <mbooth at redhat.com>
+Date: Wed, 6 Jan 2010 17:09:04 +0100
+Subject: [PATCH] Fix parsing of 'info chardev' line endings
+
+This change makes the 'info chardev' parser ignore any trailing
+whitespace on a line. This fixes a specific problem handling a '\r\n'
+line ending.
+
+* src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in
+  'info chardev' output.
+---
+ src/qemu/qemu_monitor_text.c |   26 +++++++++++++++++---------
+ 1 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
+index ab361c6..5b9ced2 100644
+--- a/src/qemu/qemu_monitor_text.c
++++ b/src/qemu/qemu_monitor_text.c
+@@ -1705,15 +1705,26 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
+         goto cleanup;
+     }
+ 
+-    char *pos = reply;                  /* The current start of searching */
+-    char *end = pos + strlen(reply);    /* The end of the reply string */
++    char *pos;                          /* The current start of searching */
++    char *next = reply;                 /* The start of the next line */
+     char *eol;                   /* The character which ends the current line */
++    char *end = reply + strlen(reply);  /* The end of the reply string */
++
++    while (next) {
++        pos = next;
+ 
+-    while (pos < end) {
+         /* Split the output into lines */
+         eol = memchr(pos, '\n', end - pos);
+-        if (eol == NULL)
++        if (eol == NULL) {
+             eol = end;
++            next = NULL;
++        } else {
++            next = eol + 1;
++        }
++
++        /* Ignore all whitespace immediately before eol */
++        while (eol > pos && c_isspace(*(eol-1)))
++            eol -= 1;
+ 
+         /* Look for 'filename=pty:' */
+ #define NEEDLE "filename=pty:"
+@@ -1721,13 +1732,13 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
+ 
+         /* If it's not there we can ignore this line */
+         if (!needle)
+-            goto next;
++            continue;
+ 
+         /* id is everthing from the beginning of the line to the ':'
+          * find ':' and turn it into a terminator */
+         char *colon = memchr(pos, ':', needle - pos);
+         if (colon == NULL)
+-            goto next;
++            continue;
+         *colon = '\0';
+         char *id = pos;
+ 
+@@ -1747,9 +1758,6 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
+             goto cleanup;
+         }
+ #undef NEEDLE
+-
+-    next:
+-        pos = eol + 1;
+     }
+ 
+     ret = 0;
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 4f73fb1..4378e8b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
 0008-qemu-Use-log-output-for-pty-assignment-if-info-chard.patch
 0009-Fix-QEMU-driver-custom-domain-status-XML-extensions.patch
 0010-Don-t-free-an-uninitalized-pointer-in-update_driver_.patch
+0011-Fix-parsing-of-info-chardev-line-endings.patch

-- 
Libvirt Debian packaging



More information about the Pkg-libvirt-commits mailing list