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

Re: [Xen-devel] [PATCH v3 2/5] libxl: introduce LIBXL_VGA_INTERFACE_TYPE_UNDEF



On Wed, 2016-01-20 at 12:57 +0100, Roger Pau Monne wrote:
> And use it as the default value for the VGA kind. This allows libxl to
> set
> it to the default value later on when the domain type is known. For HVM
> guests the default value is LIBXL_VGA_INTERFACE_TYPE_CIRRUS while for
> HVMlite the default value is LIBXL_VGA_INTERFACE_TYPE_NONE.

Most enums in lixl_type.idl call this value "UNKNOWN" rather than "UNDEF".
We should be consistent.

You will also need to add the usual #define LIBXL_HAVE to libxl.h.

Everything else looks ok to me.

> 
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> ---
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Âtools/libxl/libxl_create.cÂÂ| 8 ++++++--
> Âtools/libxl/libxl_dm.cÂÂÂÂÂÂ| 6 ++++++
> Âtools/libxl/libxl_types.idl | 3 ++-
> Â3 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index e491d83..61a4001 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -206,8 +206,12 @@ int libxl__domain_build_info_setdefault(libxl__gc
> *gc,
> ÂÂÂÂÂÂÂÂÂif (b_info->u.hvm.mmio_hole_memkb == LIBXL_MEMKB_DEFAULT)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂb_info->u.hvm.mmio_hole_memkb = 0;
> Â
> -ÂÂÂÂÂÂÂÂif (!b_info->u.hvm.vga.kind)
> -ÂÂÂÂÂÂÂÂÂÂÂÂb_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
> +ÂÂÂÂÂÂÂÂif (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_UNDEF) {
> +ÂÂÂÂÂÂÂÂÂÂÂÂif (b_info->device_model_version ==
> LIBXL_DEVICE_MODEL_VERSION_NONE)
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂb_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE;
> +ÂÂÂÂÂÂÂÂÂÂÂÂelse
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂb_info->u.hvm.vga.kind =
> LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
> +ÂÂÂÂÂÂÂÂ}
> Â
> ÂÂÂÂÂÂÂÂÂif (!b_info->u.hvm.hdtype)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂb_info->u.hvm.hdtype = LIBXL_HDTYPE_IDE;
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index a088d71..9aa0cc8 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -531,6 +531,9 @@ static int
> libxl__build_device_model_args_old(libxl__gc *gc,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> ÂÂÂÂÂÂÂÂÂcase LIBXL_VGA_INTERFACE_TYPE_QXL:
> ÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> +ÂÂÂÂÂÂÂÂdefault:
> +ÂÂÂÂÂÂÂÂÂÂÂÂLOG(ERROR, "Invalid emulated video card specified");
> +ÂÂÂÂÂÂÂÂÂÂÂÂreturn ERROR_INVAL;
> ÂÂÂÂÂÂÂÂÂ}
> Â
> ÂÂÂÂÂÂÂÂÂif (b_info->u.hvm.boot) {
> @@ -970,6 +973,9 @@ static int
> libxl__build_device_model_args_new(libxl__gc *gc,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂGCSPRINTF("qxl-
> vga,vram_size_mb=%"PRIu64",ram_size_mb=%"PRIu64,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ(b_info->video_memkb/2/1024), (b_info-
> >video_memkb/2/1024) ) );
> ÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> +ÂÂÂÂÂÂÂÂdefault:
> +ÂÂÂÂÂÂÂÂÂÂÂÂLOG(ERROR, "Invalid emulated video card specified");
> +ÂÂÂÂÂÂÂÂÂÂÂÂreturn ERROR_INVAL;
> ÂÂÂÂÂÂÂÂÂ}
> Â
> ÂÂÂÂÂÂÂÂÂif (b_info->u.hvm.boot) {
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 9ad7eba..92c95e5 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -204,11 +204,12 @@ libxl_shutdown_reason =
> Enumeration("shutdown_reason", [
> ÂÂÂÂÂ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN")
> Â
> Âlibxl_vga_interface_type = Enumeration("vga_interface_type", [
> +ÂÂÂÂ(0, "UNDEF"),
> ÂÂÂÂÂ(1, "CIRRUS"),
> ÂÂÂÂÂ(2, "STD"),
> ÂÂÂÂÂ(3, "NONE"),
> ÂÂÂÂÂ(4, "QXL"),
> -ÂÂÂÂ], init_val = "LIBXL_VGA_INTERFACE_TYPE_CIRRUS")
> +ÂÂÂÂ], init_val = "LIBXL_VGA_INTERFACE_TYPE_UNDEF")
> Â
> Âlibxl_vendor_device = Enumeration("vendor_device", [
> ÂÂÂÂÂ(0, "NONE"),
_______________________________________________
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®.