debuggers.hg

changeset 22548:f57026cd5d19

libxl: Makes libxl be able to call Qemu upstream for XenPV guest.

In libxl_build_device_model_args_new:
- Adds -xen-attach options to the list of arguments to Qemu.
- Adds -vga xenfb options when vnc and sdl are not set.
- Remove disk list from the command line for XenPV as they will be
read from xenstore by Qemu.


Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
tools/libxl/libxl.c | 30 +++++++++++++++++++++---------
1 files changed, 21 insertions(+), 9 deletions(-)
author Anthony PERARD <anthony.perard@citrix.com>
date Mon Dec 13 17:59:45 2010 +0000 (2010-12-13)
parents cb75d32db0d6
children ab785e37499c
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Mon Dec 13 17:59:02 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Mon Dec 13 17:59:45 2010 +0000
     1.3 @@ -1261,6 +1261,10 @@ static char ** libxl_build_device_model_
     1.4      flexarray_set(dm_args, num++, "-xen-domid");
     1.5      flexarray_set(dm_args, num++, libxl__sprintf(gc, "%d", info->domid));
     1.6  
     1.7 +    if (info->type == XENPV) {
     1.8 +        flexarray_set(dm_args, num++, "-xen-attach");
     1.9 +    }
    1.10 +
    1.11      if (info->dom_name) {
    1.12          flexarray_set(dm_args, num++, "-name");
    1.13          flexarray_set(dm_args, num++, info->dom_name);
    1.14 @@ -1292,6 +1296,12 @@ static char ** libxl_build_device_model_
    1.15      if (info->sdl) {
    1.16          flexarray_set(dm_args, num++, "-sdl");
    1.17      }
    1.18 +
    1.19 +    if (info->type == XENPV && !info->nographic) {
    1.20 +        flexarray_set(dm_args, num++, "-vga");
    1.21 +        flexarray_set(dm_args, num++, "xenfb");
    1.22 +    }
    1.23 +
    1.24      if (info->keymap) {
    1.25          flexarray_set(dm_args, num++, "-k");
    1.26          flexarray_set(dm_args, num++, info->keymap);
    1.27 @@ -1374,16 +1384,18 @@ static char ** libxl_build_device_model_
    1.28      else
    1.29          flexarray_set(dm_args, num++, "xenfv");
    1.30  
    1.31 -    disks = libxl_device_disk_list(libxl__gc_owner(gc), info->domid, &nb);
    1.32 -    for (i; i < nb; i++) {
    1.33 -        if ( disks[i].is_cdrom ) {
    1.34 -            flexarray_set(dm_args, num++, "-cdrom");
    1.35 -            flexarray_set(dm_args, num++, libxl__strdup(gc, disks[i].physpath));
    1.36 -        } else {
    1.37 -            flexarray_set(dm_args, num++, libxl__sprintf(gc, "-%s", disks[i].virtpath));
    1.38 -            flexarray_set(dm_args, num++, libxl__strdup(gc, disks[i].physpath));
    1.39 +    if (info->type == XENFV) {
    1.40 +        disks = libxl_device_disk_list(libxl__gc_owner(gc), info->domid, &nb);
    1.41 +        for (i; i < nb; i++) {
    1.42 +            if (disks[i].is_cdrom) {
    1.43 +                flexarray_set(dm_args, num++, "-cdrom");
    1.44 +                flexarray_set(dm_args, num++, libxl__strdup(gc, disks[i].physpath));
    1.45 +            } else {
    1.46 +                flexarray_set(dm_args, num++, libxl__sprintf(gc, "-%s", disks[i].virtpath));
    1.47 +                flexarray_set(dm_args, num++, libxl__strdup(gc, disks[i].physpath));
    1.48 +            }
    1.49 +            libxl_device_disk_destroy(&disks[i]);
    1.50          }
    1.51 -        libxl_device_disk_destroy(&disks[i]);
    1.52      }
    1.53      free(disks);
    1.54      flexarray_set(dm_args, num++, NULL);