Lines 335-340
xenParseSxprDisks(virDomainDefPtr def,
|
Link Here
|
---|
|
335 |
{ |
335 |
{ |
336 |
const struct sexpr *cur, *node; |
336 |
const struct sexpr *cur, *node; |
337 |
virDomainDiskDefPtr disk = NULL; |
337 |
virDomainDiskDefPtr disk = NULL; |
|
|
338 |
int bootIndex = 0; |
338 |
|
339 |
|
339 |
for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) { |
340 |
for (cur = root; cur->kind == SEXPR_CONS; cur = cur->u.s.cdr) { |
340 |
node = cur->u.s.car; |
341 |
node = cur->u.s.car; |
Lines 494-509
xenParseSxprDisks(virDomainDefPtr def,
|
Link Here
|
---|
|
494 |
strchr(mode, '!')) |
495 |
strchr(mode, '!')) |
495 |
disk->shared = 1; |
496 |
disk->shared = 1; |
496 |
|
497 |
|
|
|
498 |
if (STREQ_NULLABLE(bootable, "1")) |
499 |
disk->bootIndex = ++bootIndex; |
500 |
|
497 |
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0) |
501 |
if (VIR_REALLOC_N(def->disks, def->ndisks+1) < 0) |
498 |
goto no_memory; |
502 |
goto no_memory; |
499 |
|
503 |
|
500 |
/* re-order disks if there is a bootable device */ |
504 |
def->disks[def->ndisks++] = disk; |
501 |
if (STREQ_NULLABLE(bootable, "1")) { |
|
|
502 |
def->disks[def->ndisks++] = def->disks[0]; |
503 |
def->disks[0] = disk; |
504 |
} else { |
505 |
def->disks[def->ndisks++] = disk; |
506 |
} |
507 |
disk = NULL; |
505 |
disk = NULL; |
508 |
} |
506 |
} |
509 |
} |
507 |
} |
Lines 2043-2048
xenFormatSxpr(virConnectPtr conn,
|
Link Here
|
---|
|
2043 |
const char *tmp; |
2041 |
const char *tmp; |
2044 |
char *bufout; |
2042 |
char *bufout; |
2045 |
int hvm = 0, i; |
2043 |
int hvm = 0, i; |
|
|
2044 |
virDomainDiskDefPtr *disks = NULL; |
2046 |
|
2045 |
|
2047 |
VIR_DEBUG("Formatting domain sexpr"); |
2046 |
VIR_DEBUG("Formatting domain sexpr"); |
2048 |
|
2047 |
|
Lines 2315-2324
xenFormatSxpr(virConnectPtr conn,
|
Link Here
|
---|
|
2315 |
} |
2314 |
} |
2316 |
} |
2315 |
} |
2317 |
|
2316 |
|
|
|
2317 |
/* Sort bootable disks in ascending order by bootIndex, other disks behind */ |
2318 |
if (VIR_ALLOC_N(disks, def->ndisks) < 0) |
2319 |
goto error; |
2320 |
for (i = 0; i < def->ndisks; i++) { |
2321 |
if (def->disks[i]->bootIndex) { |
2322 |
int j; |
2323 |
/* move back later disks */ |
2324 |
for (j = i; |
2325 |
j > 0 && (disks[j - 1]->bootIndex == 0 || |
2326 |
disks[j - 1]->bootIndex > def->disks[i]->bootIndex); |
2327 |
j--) |
2328 |
disks[j] = disks[j - 1]; |
2329 |
disks[j] = def->disks[i]; |
2330 |
} else { |
2331 |
/* append disks without explicit bootIndex to tail */ |
2332 |
disks[i] = def->disks[i]; |
2333 |
} |
2334 |
} |
2335 |
|
2318 |
for (i = 0 ; i < def->ndisks ; i++) |
2336 |
for (i = 0 ; i < def->ndisks ; i++) |
2319 |
if (xenFormatSxprDisk(def->disks[i], |
2337 |
if (xenFormatSxprDisk(disks[i], |
2320 |
&buf, hvm, xendConfigVersion, 0, -1) < 0) |
2338 |
&buf, hvm, xendConfigVersion, 0, |
|
|
2339 |
i == 0 || disks[i]->bootIndex > 0) < 0) |
2321 |
goto error; |
2340 |
goto error; |
|
|
2341 |
VIR_FREE(disks); |
2322 |
|
2342 |
|
2323 |
for (i = 0 ; i < def->nnets ; i++) |
2343 |
for (i = 0 ; i < def->nnets ; i++) |
2324 |
if (xenFormatSxprNet(conn, def->nets[i], |
2344 |
if (xenFormatSxprNet(conn, def->nets[i], |
Lines 2349-2354
xenFormatSxpr(virConnectPtr conn,
|
Link Here
|
---|
|
2349 |
return bufout; |
2369 |
return bufout; |
2350 |
|
2370 |
|
2351 |
error: |
2371 |
error: |
|
|
2372 |
VIR_FREE(disks); |
2352 |
virBufferFreeAndReset(&buf); |
2373 |
virBufferFreeAndReset(&buf); |
2353 |
return NULL; |
2374 |
return NULL; |
2354 |
} |
2375 |
} |
2355 |
- |
|
|
2356 |
-- |
2357 |
-- |
2358 |
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 1 + |
2376 |
tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml | 1 + |
2359 |
.../sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml | 1 + |
2377 |
.../sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml | 1 + |
2360 |
tests/xencapsdata/xen-i686-pae-hvm.xml | 1 + |
2378 |
tests/xencapsdata/xen-i686-pae-hvm.xml | 1 + |
2361 |
tests/xencapsdata/xen-i686-pae.xml | 1 + |
2379 |
tests/xencapsdata/xen-i686-pae.xml | 1 + |
2362 |
tests/xencapsdata/xen-i686.xml | 1 + |
2380 |
tests/xencapsdata/xen-i686.xml | 1 + |
2363 |
tests/xencapsdata/xen-ia64-be-hvm.xml | 1 + |
2381 |
tests/xencapsdata/xen-ia64-be-hvm.xml | 1 + |
2364 |
tests/xencapsdata/xen-ia64-be.xml | 1 + |
2382 |
tests/xencapsdata/xen-ia64-be.xml | 1 + |
2365 |
tests/xencapsdata/xen-ia64-hvm.xml | 3 +++ |
2383 |
tests/xencapsdata/xen-ia64-hvm.xml | 3 +++ |
2366 |
tests/xencapsdata/xen-ia64.xml | 3 +++ |
2384 |
tests/xencapsdata/xen-ia64.xml | 3 +++ |
2367 |
tests/xencapsdata/xen-ppc64.xml | 3 +++ |
2385 |
tests/xencapsdata/xen-ppc64.xml | 3 +++ |
2368 |
tests/xencapsdata/xen-x86_64-hvm.xml | 3 +++ |
2386 |
tests/xencapsdata/xen-x86_64-hvm.xml | 3 +++ |
2369 |
tests/xencapsdata/xen-x86_64.xml | 3 +++ |
2387 |
tests/xencapsdata/xen-x86_64.xml | 3 +++ |
2370 |
tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr | 2 +- |
2388 |
tests/xml2sexprdata/xml2sexpr-boot-grub.sexpr | 2 +- |
2371 |
tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr | 2 +- |
2389 |
tests/xml2sexprdata/xml2sexpr-bridge-ipaddr.sexpr | 2 +- |
2372 |
tests/xml2sexprdata/xml2sexpr-curmem.sexpr | 2 +- |
2390 |
tests/xml2sexprdata/xml2sexpr-curmem.sexpr | 2 +- |
2373 |
.../xml2sexpr-disk-block-shareable.sexpr | 2 +- |
2391 |
.../xml2sexpr-disk-block-shareable.sexpr | 2 +- |
2374 |
tests/xml2sexprdata/xml2sexpr-disk-block.sexpr | 2 +- |
2392 |
tests/xml2sexprdata/xml2sexpr-disk-block.sexpr | 2 +- |
2375 |
.../xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr | 2 +- |
2393 |
.../xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr | 2 +- |
2376 |
.../xml2sexpr-disk-drv-blktap-qcow.sexpr | 2 +- |
2394 |
.../xml2sexpr-disk-drv-blktap-qcow.sexpr | 2 +- |
2377 |
.../xml2sexpr-disk-drv-blktap-raw.sexpr | 2 +- |
2395 |
.../xml2sexpr-disk-drv-blktap-raw.sexpr | 2 +- |
2378 |
.../xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr | 2 +- |
2396 |
.../xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr | 2 +- |
2379 |
.../xml2sexpr-disk-drv-blktap2-raw.sexpr | 2 +- |
2397 |
.../xml2sexpr-disk-drv-blktap2-raw.sexpr | 2 +- |
2380 |
.../xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr | 2 +- |
2398 |
.../xml2sexprdata/xml2sexpr-disk-drv-blktap2.sexpr | 2 +- |
2381 |
tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr | 2 +- |
2399 |
tests/xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr | 2 +- |
2382 |
tests/xml2sexprdata/xml2sexpr-disk-file.sexpr | 2 +- |
2400 |
tests/xml2sexprdata/xml2sexpr-disk-file.sexpr | 2 +- |
2383 |
tests/xml2sexprdata/xml2sexpr-escape.sexpr | 2 +- |
2401 |
tests/xml2sexprdata/xml2sexpr-escape.sexpr | 2 +- |
2384 |
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 2 +- |
2402 |
tests/xml2sexprdata/xml2sexpr-fv-force-hpet.sexpr | 2 +- |
2385 |
.../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 2 +- |
2403 |
.../xml2sexprdata/xml2sexpr-fv-force-nohpet.sexpr | 2 +- |
2386 |
tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 2 +- |
2404 |
tests/xml2sexprdata/xml2sexpr-fv-kernel.sexpr | 2 +- |
2387 |
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 2 +- |
2405 |
tests/xml2sexprdata/xml2sexpr-fv-localtime.sexpr | 2 +- |
2388 |
tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr | 2 +- |
2406 |
tests/xml2sexprdata/xml2sexpr-fv-net-ioemu.sexpr | 2 +- |
2389 |
.../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr | 2 +- |
2407 |
.../xml2sexprdata/xml2sexpr-fv-net-netfront.sexpr | 2 +- |
2390 |
.../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 2 +- |
2408 |
.../xml2sexprdata/xml2sexpr-fv-parallel-tcp.sexpr | 2 +- |
2391 |
.../xml2sexpr-fv-serial-dev-2-ports.sexpr | 2 +- |
2409 |
.../xml2sexpr-fv-serial-dev-2-ports.sexpr | 2 +- |
2392 |
.../xml2sexpr-fv-serial-dev-2nd-port.sexpr | 2 +- |
2410 |
.../xml2sexpr-fv-serial-dev-2nd-port.sexpr | 2 +- |
2393 |
tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 2 +- |
2411 |
tests/xml2sexprdata/xml2sexpr-fv-serial-file.sexpr | 2 +- |
2394 |
tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 2 +- |
2412 |
tests/xml2sexprdata/xml2sexpr-fv-serial-null.sexpr | 2 +- |
2395 |
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 2 +- |
2413 |
tests/xml2sexprdata/xml2sexpr-fv-serial-pipe.sexpr | 2 +- |
2396 |
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 2 +- |
2414 |
tests/xml2sexprdata/xml2sexpr-fv-serial-pty.sexpr | 2 +- |
2397 |
.../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 2 +- |
2415 |
.../xml2sexprdata/xml2sexpr-fv-serial-stdio.sexpr | 2 +- |
2398 |
.../xml2sexpr-fv-serial-tcp-telnet.sexpr | 2 +- |
2416 |
.../xml2sexpr-fv-serial-tcp-telnet.sexpr | 2 +- |
2399 |
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 2 +- |
2417 |
tests/xml2sexprdata/xml2sexpr-fv-serial-tcp.sexpr | 2 +- |
2400 |
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 2 +- |
2418 |
tests/xml2sexprdata/xml2sexpr-fv-serial-udp.sexpr | 2 +- |
2401 |
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 2 +- |
2419 |
tests/xml2sexprdata/xml2sexpr-fv-serial-unix.sexpr | 2 +- |
2402 |
tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 2 +- |
2420 |
tests/xml2sexprdata/xml2sexpr-fv-sound.sexpr | 2 +- |
2403 |
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 2 +- |
2421 |
tests/xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr | 2 +- |
2404 |
tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr | 2 +- |
2422 |
tests/xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr | 2 +- |
2405 |
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 2 +- |
2423 |
tests/xml2sexprdata/xml2sexpr-fv-utc.sexpr | 2 +- |
2406 |
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 4 ++-- |
2424 |
tests/xml2sexprdata/xml2sexpr-fv-v2.sexpr | 4 ++-- |
2407 |
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 4 ++-- |
2425 |
tests/xml2sexprdata/xml2sexpr-fv-vncunused.sexpr | 4 ++-- |
2408 |
tests/xml2sexprdata/xml2sexpr-fv.sexpr | 2 +- |
2426 |
tests/xml2sexprdata/xml2sexpr-fv.sexpr | 2 +- |
2409 |
tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr | 2 +- |
2427 |
tests/xml2sexprdata/xml2sexpr-net-bridged.sexpr | 2 +- |
2410 |
tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 2 +- |
2428 |
tests/xml2sexprdata/xml2sexpr-net-e1000.sexpr | 2 +- |
2411 |
tests/xml2sexprdata/xml2sexpr-net-routed.sexpr | 2 +- |
2429 |
tests/xml2sexprdata/xml2sexpr-net-routed.sexpr | 2 +- |
2412 |
.../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 4 ++-- |
2430 |
.../xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr | 4 ++-- |
2413 |
tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr | 2 +- |
2431 |
tests/xml2sexprdata/xml2sexpr-pci-devs.sexpr | 2 +- |
2414 |
.../xml2sexpr-pv-bootloader-cmdline.sexpr | 2 +- |
2432 |
.../xml2sexpr-pv-bootloader-cmdline.sexpr | 2 +- |
2415 |
tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr | 2 +- |
2433 |
tests/xml2sexprdata/xml2sexpr-pv-bootloader.sexpr | 2 +- |
2416 |
tests/xml2sexprdata/xml2sexpr-pv-localtime.sexpr | 2 +- |
2434 |
tests/xml2sexprdata/xml2sexpr-pv-localtime.sexpr | 2 +- |
2417 |
tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr | 2 +- |
2435 |
tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr | 2 +- |
2418 |
.../xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr | 2 +- |
2436 |
.../xml2sexprdata/xml2sexpr-pv-vfb-new-auto.sexpr | 2 +- |
2419 |
tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr | 2 +- |
2437 |
tests/xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr | 2 +- |
2420 |
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr | 2 +- |
2438 |
tests/xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr | 2 +- |
2421 |
tests/xml2sexprdata/xml2sexpr-pv.sexpr | 2 +- |
2439 |
tests/xml2sexprdata/xml2sexpr-pv.sexpr | 2 +- |
2422 |
64 files changed, 77 insertions(+), 55 deletions(-) |
2440 |
64 files changed, 77 insertions(+), 55 deletions(-) |