Usage: vga="none" With upstream qemu it was impossible to disable emulated vga, even with -nographic qemu parameter setted with nographic xl paramter. Changes from v1: - libxl_dm.c: if vga is none: - add -vga none paramter - do not add -videoram parameter. Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> --- docs/man/xl.cfg.pod.5 | 2 +- tools/libxl/libxl_create.c | 4 ++++ tools/libxl/libxl_dm.c | 8 +++++++- tools/libxl/libxl_types.idl | 1 + tools/libxl/xl_cmdimpl.c | 2 ++ 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index 3dedd61..402a414 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -1050,7 +1050,7 @@ This option is deprecated, use vga="stdvga" instead. =item B<vga="STRING"> -Selects the emulated video card (stdvga|cirrus). +Selects the emulated video card (none|stdvga|cirrus). The default is cirrus. =item B<vnc=BOOLEAN> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 2bb33e9..a9735d0 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -222,6 +222,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, switch (b_info->device_model_version) { case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: switch (b_info->u.hvm.vga.kind) { + case LIBXL_VGA_INTERFACE_TYPE_NONE: + break; case LIBXL_VGA_INTERFACE_TYPE_STD: if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) b_info->video_memkb = 8 * 1024; @@ -242,6 +244,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: default: switch (b_info->u.hvm.vga.kind) { + case LIBXL_VGA_INTERFACE_TYPE_NONE: + break; case LIBXL_VGA_INTERFACE_TYPE_STD: if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) b_info->video_memkb = 16 * 1024; diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 7be0a50..ce63c9a 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -187,7 +187,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, flexarray_append(dm_args, "-nographic"); } - if (b_info->video_memkb) { + if (b_info->video_memkb + && b_info->u.hvm.vga.kind != LIBXL_VGA_INTERFACE_TYPE_NONE) { flexarray_vappend(dm_args, "-videoram", libxl__sprintf(gc, "%d", libxl__sizekb_to_mb(b_info->video_memkb)), @@ -200,6 +201,9 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, break; case LIBXL_VGA_INTERFACE_TYPE_CIRRUS: break; + case LIBXL_VGA_INTERFACE_TYPE_NONE: + flexarray_append_pair(dm_args, "-vga", "none"); + break; } if (b_info->u.hvm.boot) { @@ -498,6 +502,8 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, GCSPRINTF("vga.vram_size_mb=%d", libxl__sizekb_to_mb(b_info->video_memkb))); break; + case LIBXL_VGA_INTERFACE_TYPE_NONE: + break; } if (b_info->u.hvm.boot) { diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index 44c1891..22a2528 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -153,6 +153,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [ libxl_vga_interface_type = Enumeration("vga_interface_type", [ (1, "CIRRUS"), (2, "STD"), + (3, "NONE"), ], init_val = 1) libxl_vendor_device = Enumeration("vendor_device", [ diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index ddb80d6..c823516 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1497,6 +1497,8 @@ skip_vfb: b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD; } else if (!strcmp(buf, "cirrus")) { b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS; + } else if (!strcmp(buf, "none")) { + b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE; } else { fprintf(stderr, "Unknown vga \"%s\" specified\n", buf); exit(1); -- 1.7.9.5
Fabio Fantoni
2013-Nov-19 14:57 UTC
[PATCH v2 2/2] libxl: Fix nographic with upstream qemu
Fix xl nographic parameter with upstream qemu using vga none instead of -nographic qemu parameter not working anymore and deprecated. Changes from v1: - libxl_create.c: - add vga=none if nographic=1 only with upstream qemu - move setdefault of nographic up, otherwise xl create will fail if nographic xl paramter is not set Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> --- tools/libxl/libxl_create.c | 8 ++++++-- tools/libxl/libxl_dm.c | 8 -------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index a9735d0..79c0709 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -216,6 +216,12 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT) b_info->shadow_memkb = 0; + libxl_defbool_setdefault(&b_info->u.hvm.nographic, false); + + if (libxl_defbool_val(b_info->u.hvm.nographic) && + b_info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) + b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE; + if (!b_info->u.hvm.vga.kind) b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS; @@ -326,8 +332,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, false); } - libxl_defbool_setdefault(&b_info->u.hvm.nographic, false); - libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false); break; diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index ce63c9a..7f97d9e 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -472,10 +472,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL); } - if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) { - flexarray_append(dm_args, "-nographic"); - } - if (libxl_defbool_val(b_info->u.hvm.spice.enable)) { const libxl_spice_info *spice = &b_info->u.hvm.spice; char *spiceoptions = dm_spice_options(gc, spice); @@ -619,10 +615,6 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) { flexarray_append(dm_args, "-gfx_passthru"); } - } else { - if (!sdl && !vnc) { - flexarray_append(dm_args, "-nographic"); - } } if (state->saved_state) { -- 1.7.9.5
On Tue, Nov 19, 2013 at 03:57:08PM +0100, Fabio Fantoni wrote:> Usage: > vga="none" > > With upstream qemu it was impossible to disable emulated vga, > even with -nographic qemu parameter setted with nographic xl > paramter. > > Changes from v1: > - libxl_dm.c: > if vga is none: > - add -vga none paramter > - do not add -videoram parameter. > > Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz> > --- > docs/man/xl.cfg.pod.5 | 2 +- > tools/libxl/libxl_create.c | 4 ++++ > tools/libxl/libxl_dm.c | 8 +++++++- > tools/libxl/libxl_types.idl | 1 + > tools/libxl/xl_cmdimpl.c | 2 ++ > 5 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 > index 3dedd61..402a414 100644 > --- a/docs/man/xl.cfg.pod.5 > +++ b/docs/man/xl.cfg.pod.5 > @@ -1050,7 +1050,7 @@ This option is deprecated, use vga="stdvga" instead. > > =item B<vga="STRING"> > > -Selects the emulated video card (stdvga|cirrus). > +Selects the emulated video card (none|stdvga|cirrus). > The default is cirrus. > > =item B<vnc=BOOLEAN> > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c > index 2bb33e9..a9735d0 100644 > --- a/tools/libxl/libxl_create.c > +++ b/tools/libxl/libxl_create.c > @@ -222,6 +222,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, > switch (b_info->device_model_version) { > case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL: > switch (b_info->u.hvm.vga.kind) { > + case LIBXL_VGA_INTERFACE_TYPE_NONE: > + break; > case LIBXL_VGA_INTERFACE_TYPE_STD: > if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > b_info->video_memkb = 8 * 1024; > @@ -242,6 +244,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc, > case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN: > default: > switch (b_info->u.hvm.vga.kind) { > + case LIBXL_VGA_INTERFACE_TYPE_NONE: > + break; > case LIBXL_VGA_INTERFACE_TYPE_STD: > if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) > b_info->video_memkb = 16 * 1024;I believe you need to set the video_memkb here to 0 in both cases, otherwise we might end up with -1 later.> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 7be0a50..ce63c9a 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -187,7 +187,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc, > flexarray_append(dm_args, "-nographic"); > } > > - if (b_info->video_memkb) { > + if (b_info->video_memkb > + && b_info->u.hvm.vga.kind != LIBXL_VGA_INTERFACE_TYPE_NONE) { > flexarray_vappend(dm_args, "-videoram", > libxl__sprintf(gc, "%d", > libxl__sizekb_to_mb(b_info->video_memkb)),Once video_memkb is 0, then this change will no be necessary. -- Anthony PERARD
Anthony PERARD
2013-Nov-25 18:48 UTC
Re: [PATCH v2 2/2] libxl: Fix nographic with upstream qemu
On Tue, Nov 19, 2013 at 03:57:09PM +0100, Fabio Fantoni wrote:> Fix xl nographic parameter with upstream qemu using vga none > instead of -nographic qemu parameter not working anymore and > deprecated. > > Changes from v1: > - libxl_create.c: > - add vga=none if nographic=1 only with upstream qemu > - move setdefault of nographic up, otherwise xl create will > fail if nographic xl paramter is not setCould you tell me where it is said that -nographic is deprecated? Also, I''ve did few tests, and it look like nographic=1 still works well. In QEMU, "-vga none" and "-nographic" are two different things. The first parameter disable the graphic emulation, which mean you can have a guest without graphic card (lspci will show that). The second one is to disable any graphic output (sdl, vnc, ...). The only issue might be the documentation. Regards, -- Anthony PERARD
Fabio Fantoni
2013-Nov-25 19:28 UTC
Re: [PATCH v2 2/2] libxl: Fix nographic with upstream qemu
2013/11/25 Anthony PERARD <anthony.perard@citrix.com>> On Tue, Nov 19, 2013 at 03:57:09PM +0100, Fabio Fantoni wrote: > > Fix xl nographic parameter with upstream qemu using vga none > > instead of -nographic qemu parameter not working anymore and > > deprecated. > > > > Changes from v1: > > - libxl_create.c: > > - add vga=none if nographic=1 only with upstream qemu > > - move setdefault of nographic up, otherwise xl create will > > fail if nographic xl paramter is not set > > Could you tell me where it is said that -nographic is deprecated? >On one old qemu-devel post if I remember good, I not found it now with fast search.> > Also, I''ve did few tests, and it look like nographic=1 still works well. >When I did a tests time ago with upstream qemu gave always cirrus vga with hvm domUs, also with vga and stdvga not setted and nographic on. Tried also removing my patches about -nodefaults but same result. When I did this patches I found that xl setted cirrus in any case and also with -nographic with upstream qemu not override -vga or -device.> > In QEMU, "-vga none" and "-nographic" are two different things. The > first parameter disable the graphic emulation, which mean you can have a > guest without graphic card (lspci will show that). The second one is to > disable any graphic output (sdl, vnc, ...). > > The only issue might be the documentation. >Sorry, about qemu traditional I haven''t well documented, but on this patch I setted nographic equivalent to vga none only with upstream qemu, so the qemu-trad remain correctly. Another note, I use spice with upstream qemu instead of vnc (because is largely better), probably -nographic not disable it. Sumarizing, previous patch about vga none after new version following your advice can be useful in any case. About nographic instead I am doubtful about how to proceed, I think, however that an improvements and/or more documentations are needed. Ideas or tips about nographic? Thanks for any reply and sorry for my bad english.> > Regards, > > -- > Anthony PERARD >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Sander Eikelenboom
2013-Nov-25 19:39 UTC
Re: [PATCH v2 2/2] libxl: Fix nographic with upstream qemu
Monday, November 25, 2013, 8:28:27 PM, you wrote:> 2013/11/25 Anthony PERARD <anthony.perard@citrix.com>>> On Tue, Nov 19, 2013 at 03:57:09PM +0100, Fabio Fantoni wrote: >> > Fix xl nographic parameter with upstream qemu using vga none >> > instead of -nographic qemu parameter not working anymore and >> > deprecated. >> > >> > Changes from v1: >> > - libxl_create.c: >> > - add vga=none if nographic=1 only with upstream qemu >> > - move setdefault of nographic up, otherwise xl create will >> > fail if nographic xl paramter is not set >> >> Could you tell me where it is said that -nographic is deprecated? >>> On one old qemu-devel post if I remember good, I not found it now with fast > search.this one of mine: http://osdir.com/ml/xen-development/2013-10/msg00134.html which refers to a post on qemu-devel: http://comments.gmane.org/gmane.comp.emulators.qemu/172385 -- Sander>> >> Also, I''ve did few tests, and it look like nographic=1 still works well. >>> When I did a tests time ago with upstream qemu gave always cirrus vga with > hvm domUs, also with vga and stdvga not setted and nographic on. > Tried also removing my patches about -nodefaults but same result. > When I did this patches I found that xl setted cirrus in any case and also > with -nographic with upstream qemu not override -vga or -device.>> >> In QEMU, "-vga none" and "-nographic" are two different things. The >> first parameter disable the graphic emulation, which mean you can have a >> guest without graphic card (lspci will show that). The second one is to >> disable any graphic output (sdl, vnc, ...). >> >> The only issue might be the documentation. >>> Sorry, about qemu traditional I haven''t well documented, but on this patch > I setted nographic equivalent to vga none only with upstream qemu, so the > qemu-trad remain correctly. > Another note, I use spice with upstream qemu instead of vnc (because is > largely better), probably -nographic not disable it.> Sumarizing, previous patch about vga none after new version following your > advice can be useful in any case. > About nographic instead I am doubtful about how to proceed, I think, > however that an improvements and/or more documentations are needed. > Ideas or tips about nographic?> Thanks for any reply and sorry for my bad english.>> >> Regards, >> >> -- >> Anthony PERARD >>
Anthony PERARD
2013-Nov-26 11:53 UTC
Re: [PATCH v2 2/2] libxl: Fix nographic with upstream qemu
On Mon, Nov 25, 2013 at 08:39:22PM +0100, Sander Eikelenboom wrote:> > Monday, November 25, 2013, 8:28:27 PM, you wrote: > > > 2013/11/25 Anthony PERARD <anthony.perard@citrix.com> > > >> On Tue, Nov 19, 2013 at 03:57:09PM +0100, Fabio Fantoni wrote: > >> > Fix xl nographic parameter with upstream qemu using vga none > >> > instead of -nographic qemu parameter not working anymore and > >> > deprecated. > >> > > >> > Changes from v1: > >> > - libxl_create.c: > >> > - add vga=none if nographic=1 only with upstream qemu > >> > - move setdefault of nographic up, otherwise xl create will > >> > fail if nographic xl paramter is not set > >> > >> Could you tell me where it is said that -nographic is deprecated? > >> > > > On one old qemu-devel post if I remember good, I not found it now with fast > > search. > > this one of mine: > http://osdir.com/ml/xen-development/2013-10/msg00134.html > > which refers to a post on qemu-devel: > http://comments.gmane.org/gmane.comp.emulators.qemu/172385Thanks for the pointers.> >> > >> Also, I''ve did few tests, and it look like nographic=1 still works well. > >> > > > When I did a tests time ago with upstream qemu gave always cirrus vga with > > hvm domUs, also with vga and stdvga not setted and nographic on. > > Tried also removing my patches about -nodefaults but same result. > > When I did this patches I found that xl setted cirrus in any case and also > > with -nographic with upstream qemu not override -vga or -device. > > > >> > >> In QEMU, "-vga none" and "-nographic" are two different things. The > >> first parameter disable the graphic emulation, which mean you can have a > >> guest without graphic card (lspci will show that). The second one is to > >> disable any graphic output (sdl, vnc, ...). > >> > >> The only issue might be the documentation. > >> > > > Sorry, about qemu traditional I haven''t well documented, but on this patch > > I setted nographic equivalent to vga none only with upstream qemu, so the > > qemu-trad remain correctly. > > Another note, I use spice with upstream qemu instead of vnc (because is > > largely better), probably -nographic not disable it. > > > Sumarizing, previous patch about vga none after new version following your > > advice can be useful in any case. > > About nographic instead I am doubtful about how to proceed, I think, > > however that an improvements and/or more documentations are needed. > > Ideas or tips about nographic?After reading those threads about nographic deprecation, it is said that it is better to use ''-display none'' instead of ''-nographic''. So ''-display none'' just mean you get no VNC, no SDL window, no SPICE, nothing, but you can still get a graphic card in the guest, with no way to display its output. I suppose ''nographic'' xl options should keep the same effect which is no graphic output. So if you want a guest without graphic card, then your new ''vga=none'' will be for you. -- Anthony PERARD
Sander Eikelenboom
2013-Nov-26 12:30 UTC
Re: [PATCH v2 2/2] libxl: Fix nographic with upstream qemu
Tuesday, November 26, 2013, 12:53:09 PM, you wrote:> On Mon, Nov 25, 2013 at 08:39:22PM +0100, Sander Eikelenboom wrote: >> >> Monday, November 25, 2013, 8:28:27 PM, you wrote: >> >> > 2013/11/25 Anthony PERARD <anthony.perard@citrix.com> >> >> >> On Tue, Nov 19, 2013 at 03:57:09PM +0100, Fabio Fantoni wrote: >> >> > Fix xl nographic parameter with upstream qemu using vga none >> >> > instead of -nographic qemu parameter not working anymore and >> >> > deprecated. >> >> > >> >> > Changes from v1: >> >> > - libxl_create.c: >> >> > - add vga=none if nographic=1 only with upstream qemu >> >> > - move setdefault of nographic up, otherwise xl create will >> >> > fail if nographic xl paramter is not set >> >> >> >> Could you tell me where it is said that -nographic is deprecated? >> >> >> >> > On one old qemu-devel post if I remember good, I not found it now with fast >> > search. >> >> this one of mine: >> http://osdir.com/ml/xen-development/2013-10/msg00134.html >> >> which refers to a post on qemu-devel: >> http://comments.gmane.org/gmane.comp.emulators.qemu/172385> Thanks for the pointers.>> >> >> >> Also, I''ve did few tests, and it look like nographic=1 still works well. >> >> >> >> > When I did a tests time ago with upstream qemu gave always cirrus vga with >> > hvm domUs, also with vga and stdvga not setted and nographic on. >> > Tried also removing my patches about -nodefaults but same result. >> > When I did this patches I found that xl setted cirrus in any case and also >> > with -nographic with upstream qemu not override -vga or -device. >> >> >> >> >> >> In QEMU, "-vga none" and "-nographic" are two different things. The >> >> first parameter disable the graphic emulation, which mean you can have a >> >> guest without graphic card (lspci will show that). The second one is to >> >> disable any graphic output (sdl, vnc, ...). >> >> >> >> The only issue might be the documentation. >> >> >> >> > Sorry, about qemu traditional I haven''t well documented, but on this patch >> > I setted nographic equivalent to vga none only with upstream qemu, so the >> > qemu-trad remain correctly. >> > Another note, I use spice with upstream qemu instead of vnc (because is >> > largely better), probably -nographic not disable it. >> >> > Sumarizing, previous patch about vga none after new version following your >> > advice can be useful in any case. >> > About nographic instead I am doubtful about how to proceed, I think, >> > however that an improvements and/or more documentations are needed. >> > Ideas or tips about nographic?> After reading those threads about nographic deprecation, it is said that > it is better to use ''-display none'' instead of ''-nographic''. > So ''-display none'' just mean you get no VNC, no SDL window, no SPICE, > nothing, but you can still get a graphic card in the guest, with no way > to display its output.> I suppose ''nographic'' xl options should keep the same effect which is no > graphic output. So if you want a guest without graphic card, then your > new ''vga=none'' will be for you.Wouldn''t it be more natural to do just vnc=0 sdl=0 vga=none if i want no graphics? Instead of making a "meta-option" which overrules other available options ? Would simplify the parsing for libxl as well. -- Sander