libvirt/xend-disk-order.patch
James Fehlig a93eba1929 - Allocate buffer to hold xend content
bnc#609738
  xend-buff-size.patch
- Add upstream fixes to bitmap code that was introduced to fix
  bnc#594024
  bitmap-alloc.patch
  bitmap-fixes.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=55
2010-06-04 19:22:56 +00:00

44 lines
1.9 KiB
Diff

Index: libvirt-0.8.1/src/xen/xend_internal.c
===================================================================
--- libvirt-0.8.1.orig/src/xen/xend_internal.c
+++ libvirt-0.8.1/src/xen/xend_internal.c
@@ -1616,20 +1616,24 @@ xenDaemonParseSxprDisks(virDomainDefPtr
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");
} else if (sexpr_lookup(node, "device/tap")) {
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");
} else {
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");
}
if (VIR_ALLOC(disk) < 0)
@@ -1754,7 +1758,12 @@ xenDaemonParseSxprDisks(virDomainDefPtr
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0)
goto no_memory;
- 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;
disk = NULL;
}
}