Skip to contentSkip to conversation

libxl: fix bootloader args setting

PATCH In review Zhigang Wang 3 participants 3 messages Feb 3, 2012 – Feb 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: fix bootloader args setting

# HG changeset patch
# User Zhigang Wang <[email protected]> # Date 1328294351 18000
# Node ID 9ae3b2b7b494ab8fbc54aa923101dc48132c6c6e # Parent e2722b24dc0962de37215320b05d1bb7c4c42864
libxl: fix bootloader args setting

tools/libxl/libxl_bootloader.c +5 -3
diff -r e2722b24dc09 -r 9ae3b2b7b494 tools/libxl/libxl_bootloader.c
@@ -49,9 +49,11 @@ static char **make_bootloader_args(libxl
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *p = info->u.pv.bootloader_args[0];
-        while (*(p++))
-            flexarray_set(args, nr++, p);
+        char **p = info->u.pv.bootloader_args;
+        while (*p) {
+            flexarray_set(args, nr++, *p);
+            p++;
+        }
     }
 
     flexarray_set(args, nr++, disk);
#1 lore raw

Sorry to send duplicate patches. The first mail took a few hours to show up in this mailing list. So I thought it didn't work. Will wait longer next time ...

Zhigang

Quoted 28 lines · Zhigang Wang

# HG changeset patch
# User Zhigang Wang <[email protected]> # Date 1328294351 18000
# Node ID 9ae3b2b7b494ab8fbc54aa923101dc48132c6c6e # Parent  e2722b24dc0962de37215320b05d1bb7c4c42864
libxl: fix bootloader args setting

diff -r e2722b24dc09 -r 9ae3b2b7b494 tools/libxl/libxl_bootloader.c

tools/libxl/libxl_bootloader.c    Fri Feb 03 13:39:11 2012 -0500 renamed from tools/libxl/libxl_bootloader.c    Thu Jan 26 17:43:31 2012 +0000 +5 -3
@@ -49,9 +49,11 @@ static char **make_bootloader_args(libxl
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *p = info->u.pv.bootloader_args[0];
-        while (*(p++))
-            flexarray_set(args, nr++, p);
+        char **p = info->u.pv.bootloader_args;
+        while (*p) {
+            flexarray_set(args, nr++, *p);
+            p++;
+        }
     }
 
     flexarray_set(args, nr++, disk);
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to Zhigang Wang
Quoted 6 lines · Zhigang Wang

# HG changeset patch
# User Zhigang Wang <[email protected]> # Date 1328294351 18000
# Node ID 9ae3b2b7b494ab8fbc54aa923101dc48132c6c6e # Parent e2722b24dc0962de37215320b05d1bb7c4c42864
libxl: fix bootloader args setting

This looks correct but please could you expand your commit message to explain what the actual issue you are fixing is e.g. such that someone reading through the logs in the future can tell that this is a fix they might want for the issue they are seeing

Ian.

Quoted 26 lines

diff -r e2722b24dc09 -r 9ae3b2b7b494 tools/libxl/libxl_bootloader.c

tools/libxl/libxl_bootloader.c +5 -3
@@ -49,9 +49,11 @@ static char **make_bootloader_args(libxl
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *p = info->u.pv.bootloader_args[0];
-        while (*(p++))
-            flexarray_set(args, nr++, p);
+        char **p = info->u.pv.bootloader_args;
+        while (*p) {
+            flexarray_set(args, nr++, *p);
+            p++;
+        }
     }
 
     flexarray_set(args, nr++, disk);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel