Skip to contentSkip to conversation

xenconfig: fix boot device parsing

PATCH Ian Campbell 2 participants 2 messages Dec 15, 2014 1 message not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 2 lines · Wei Liu

The original code always checked *boot which was in effect boot[0]. It should use boot[i].

In the future, when you do the investigation, just reference the commit id that caused the regression. In this case it seems to be commit id '547bd71a' (7/25/08 - quite a while ago)!

I'll work on getting this pushed shortly -

John

Quoted 20 lines
---
 src/xenconfig/xen_common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/xenconfig/xen_common.c +1 -1
index 7f4ec89..48431a7 100644
@@ -1071,7 +1071,7 @@ xenParseOS(virConfPtr conf, virDomainDefPtr def)
             return -1;
 
         for (i = 0; i < VIR_DOMAIN_BOOT_LAST && boot[i]; i++) {
-            switch (*boot) {
+            switch (boot[i]) {
             case 'a':
                 def->os.bootDevs[i] = VIR_DOMAIN_BOOT_FLOPPY;
                 break;