[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC 5/6] libxl: Handle Linux stubdomain specifique QEMU option.



On 19/04/13 10:31, Ian Campbell wrote:
> On Wed, 2013-04-17 at 20:09 +0100, Anthony PERARD wrote:
>> @@ -372,14 +375,17 @@ static char ** 
>> libxl__build_device_model_args_new(libxl__gc *gc,
>>                        "-xen-domid",
>>                        libxl__sprintf(gc, "%d", guest_domid), NULL);
>>  
>> -    flexarray_append(dm_args, "-chardev");
>> -    flexarray_append(dm_args,
>> -                     libxl__sprintf(gc, "socket,id=libxl-cmd,"
>> -                                    "path=%s/qmp-libxl-%d,server,nowait",
>> -                                    libxl__run_dir_path(), guest_domid));
>> +    /* There is currently no way to access the QMP socket in the stubdom */
> 
> This rules out a bunch of interesting/useful functionality doesn't it?

Yes, it does. Anything that it's hotplug (even cd-rom). So I'll have to
find a way to the socket from dom0.

>> +    if (!libxl_defbool_val(b_info->device_model_stubdomain)) {
>> +        flexarray_append(dm_args, "-chardev");
>> +        flexarray_append(dm_args,
>> +                         libxl__sprintf(gc, "socket,id=libxl-cmd,"
>> +                                        
>> "path=%s/qmp-libxl-%d,server,nowait",
>> +                                        libxl__run_dir_path(), 
>> guest_domid));
>>  
>> -    flexarray_append(dm_args, "-mon");
>> -    flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>> +        flexarray_append(dm_args, "-mon");
>> +        flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
>> +    }
>>  
>>      if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
>>          flexarray_append(dm_args, "-xen-attach");
> 
>> @@ -733,7 +748,7 @@ static int 
>> libxl__vfb_and_vkb_from_hvm_guest_config(libxl__gc *gc,
>>  
>>  static int libxl__write_stub_dmargs(libxl__gc *gc,
>>                                      int dm_domid, int guest_domid,
>> -                                    char **args)
>> +                                    char **args, bool linux_stubdom)
>>  {
>>      libxl_ctx *ctx = libxl__gc_owner(gc);
>>      int i;
>> @@ -761,10 +776,28 @@ static int libxl__write_stub_dmargs(libxl__gc *gc,
>>      i = 1;
>>      dmargs[0] = '\0';
>>      while (args[i] != NULL) {
>> -        if (strcmp(args[i], "-sdl") && strcmp(args[i], "-M") && 
>> strcmp(args[i], "xenfv")) {
>> -            strcat(dmargs, " ");
>> -            strcat(dmargs, args[i]);
>> +        if (!linux_stubdom) {
>> +            if (!(strcmp(args[i], "-sdl") && strcmp(args[i], "-M") && 
>> strcmp(args[i], "xenfv"))) {
>> +                i++;
>> +                continue;
>> +            }
>> +        } else {
>> +            if (!strcmp(args[i], "-sdl")) {
>> +                i++;
>> +                continue;
>> +            }
>> +            if (!strcmp(args[i], "-incoming")
>> +                || !strcmp(args[i], "-vnc")
>> +                || !strcmp(args[i], "-vga")) {
>> +                i += 2;
>> +                continue;
>> +            }
>> +            if (!strcmp(args[i], "-serial")) {
>> +                args[i+1] = "/dev/hvc1";
>> +            }
> 
> Is this all temporary until the various features are supported?

Yes. Well, a better way to handle that would be to alter the domain
build_config were all the options the user wants are present.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.