[Pkg-libvirt-commits] [libguestfs] 250/266: p2v: Fix p2v.disks (etc) parsing on kernel command line.

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:42:52 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit b16e98ba140d55a3341fcd4a0bca946bca6d3643
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Sep 1 17:14:17 2014 +0100

    p2v: Fix p2v.disks (etc) parsing on kernel command line.
    
    The parsing of p2v.disks, p2v.removable and p2v.interfaces did not
    correctly end at the first space, and therefore any other parameters
    that happened to be on the command line afterwards would be consumed
    as a list of disks or interfaces.
---
 p2v/kernel.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/p2v/kernel.c b/p2v/kernel.c
index 202c265..1148945 100644
--- a/p2v/kernel.c
+++ b/p2v/kernel.c
@@ -130,26 +130,35 @@ kernel_configuration (struct config *config, const char *cmdline)
 
   r = strstr (cmdline, "p2v.disks=");
   if (r) {
+    CLEANUP_FREE char *t;
+
     r += 5+5;
     len = strcspn (r, " ");
+    t = strndup (r, len);
     guestfs___free_string_list (config->disks);
-    config->disks = guestfs___split_string (',', r);
+    config->disks = guestfs___split_string (',', t);
   }
 
   r = strstr (cmdline, "p2v.removable=");
   if (r) {
+    CLEANUP_FREE char *t;
+
     r += 5+9;
     len = strcspn (r, " ");
+    t = strndup (r, len);
     guestfs___free_string_list (config->removable);
-    config->removable = guestfs___split_string (',', r);
+    config->removable = guestfs___split_string (',', t);
   }
 
   r = strstr (cmdline, "p2v.interfaces=");
   if (r) {
+    CLEANUP_FREE char *t;
+
     r += 5+10;
     len = strcspn (r, " ");
+    t = strndup (r, len);
     guestfs___free_string_list (config->interfaces);
-    config->interfaces = guestfs___split_string (',', r);
+    config->interfaces = guestfs___split_string (',', t);
   }
 
   if (start_conversion (config, notify_ui_callback) == -1) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list