2011-05-04 23:55:21 +02:00
|
|
|
Index: libvirt-0.9.1/src/xenxs/xen_sxpr.c
|
2010-03-22 17:06:05 +01:00
|
|
|
===================================================================
|
2011-05-04 23:55:21 +02:00
|
|
|
--- libvirt-0.9.1.orig/src/xenxs/xen_sxpr.c
|
|
|
|
+++ libvirt-0.9.1/src/xenxs/xen_sxpr.c
|
|
|
|
@@ -342,20 +342,24 @@ xenParseSxprDisks(virDomainDefPtr def,
|
2010-03-22 17:06:05 +01:00
|
|
|
const char *src = NULL;
|
|
|
|
const char *dst = NULL;
|
|
|
|
const char *mode = NULL;
|
|
|
|
+ int bootable;
|
|
|
|
|
|
|
|
/* Again dealing with (vbd...) vs (tap ...) differences */
|
|
|
|
if (sexpr_lookup(node, "device/vbd")) {
|
|
|
|
src = sexpr_node(node, "device/vbd/uname");
|
|
|
|
dst = sexpr_node(node, "device/vbd/dev");
|
|
|
|
mode = sexpr_node(node, "device/vbd/mode");
|
|
|
|
+ bootable = sexpr_int(node, "device/vbd/bootable");
|
2010-10-02 00:46:48 +02:00
|
|
|
} else if (sexpr_lookup(node, "device/tap2")) {
|
2010-10-02 00:46:47 +02:00
|
|
|
src = sexpr_node(node, "device/tap2/uname");
|
|
|
|
dst = sexpr_node(node, "device/tap2/dev");
|
|
|
|
mode = sexpr_node(node, "device/tap2/mode");
|
|
|
|
+ bootable = sexpr_int(node, "device/tap2/bootable");
|
2010-10-02 00:46:48 +02:00
|
|
|
} else {
|
|
|
|
src = sexpr_node(node, "device/tap/uname");
|
|
|
|
dst = sexpr_node(node, "device/tap/dev");
|
|
|
|
mode = sexpr_node(node, "device/tap/mode");
|
|
|
|
+ bootable = sexpr_int(node, "device/tap/bootable");
|
2010-03-22 17:06:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (VIR_ALLOC(disk) < 0)
|
2011-05-04 23:55:21 +02:00
|
|
|
@@ -480,7 +484,13 @@ xenParseSxprDisks(virDomainDefPtr def,
|
2010-03-22 17:06:05 +01:00
|
|
|
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
|
|
|
|
goto no_memory;
|
2010-04-16 00:56:55 +02:00
|
|
|
|
2010-03-22 17:06:05 +01:00
|
|
|
- def->disks[def->ndisks++] = disk;
|
|
|
|
+ if (bootable == 1 && def->ndisks > 0) {
|
|
|
|
+ memmove(def->disks + 1, def->disks, sizeof(def->disks) * def->ndisks);
|
|
|
|
+ def->disks[0] = disk;
|
|
|
|
+ def->ndisks++;
|
|
|
|
+ } else
|
|
|
|
+ def->disks[def->ndisks++] = disk;
|
2011-03-31 22:22:32 +02:00
|
|
|
+
|
2010-03-22 17:06:05 +01:00
|
|
|
disk = NULL;
|
|
|
|
}
|
|
|
|
}
|