From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [RFC 5/6] libxl: Handle Linux stubdomain specifique QEMU option. Date: Mon, 22 Apr 2013 14:37:42 +0100 Message-ID: <51753D26.2020504@citrix.com> References: <1366225770-1705-1-git-send-email-anthony.perard@citrix.com> <1366225770-1705-6-git-send-email-anthony.perard@citrix.com> <1366363902.19111.78.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366363902.19111.78.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Xen Devel List-Id: xen-devel@lists.xenproject.org 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