mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
libxl: refactor stdvga opinon support.
Be ready to add and describe new vga interface Signed-off-by: Zhou Peng <ailvpeng25@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
1 parent
32b854a92c
commit
705e756e45
5 files changed
+33
-8
No files matched your search
@@ -253,7 +253,8 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
|
||||
if (!b_info->u.hvm.boot) return ERROR_NOMEM;
|
||||
}
|
||||
|
||||
libxl_defbool_setdefault(&b_info->u.hvm.stdvga, false);
|
||||
if (!b_info->u.hvm.vga.kind)
|
||||
b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
|
||||
libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
|
||||
if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
|
||||
libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
|
||||
|
||||
+13
-3
@@ -177,8 +177,13 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
|
||||
libxl__sizekb_to_mb(b_info->video_memkb)),
|
||||
NULL);
|
||||
}
|
||||
if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
|
||||
|
||||
switch (b_info->u.hvm.vga.kind) {
|
||||
case LIBXL_VGA_INTERFACE_TYPE_STD:
|
||||
flexarray_append(dm_args, "-std-vga");
|
||||
break;
|
||||
case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
|
||||
break;
|
||||
}
|
||||
|
||||
if (b_info->u.hvm.boot) {
|
||||
@@ -424,8 +429,13 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
|
||||
flexarray_append(dm_args, spiceoptions);
|
||||
}
|
||||
|
||||
if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
|
||||
flexarray_vappend(dm_args, "-vga", "std", NULL);
|
||||
switch (b_info->u.hvm.vga.kind) {
|
||||
case LIBXL_VGA_INTERFACE_TYPE_STD:
|
||||
flexarray_vappend(dm_args, "-vga", "std", NULL);
|
||||
break;
|
||||
case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
|
||||
flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (b_info->u.hvm.boot) {
|
||||
|
||||
@@ -126,9 +126,19 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
|
||||
(4, "watchdog"),
|
||||
])
|
||||
|
||||
libxl_vga_interface_type = Enumeration("vga_interface_type", [
|
||||
(1, "CIRRUS"),
|
||||
(2, "STD"),
|
||||
], init_val = 0)
|
||||
|
||||
#
|
||||
# Complex libxl types
|
||||
#
|
||||
|
||||
libxl_vga_interface_info = Struct("vga_interface_info", [
|
||||
("kind", libxl_vga_interface_type),
|
||||
])
|
||||
|
||||
libxl_vnc_info = Struct("vnc_info", [
|
||||
("enable", libxl_defbool),
|
||||
# "address:port" that should be listened on
|
||||
@@ -282,7 +292,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
|
||||
("nested_hvm", libxl_defbool),
|
||||
("incr_generationid",libxl_defbool),
|
||||
("nographic", libxl_defbool),
|
||||
("stdvga", libxl_defbool),
|
||||
("vga", libxl_vga_interface_info),
|
||||
("vnc", libxl_vnc_info),
|
||||
# keyboard layout, default is en-us keyboard
|
||||
("keymap", string),
|
||||
|
||||
@@ -1264,7 +1264,10 @@ skip_vfb:
|
||||
#undef parse_extra_args
|
||||
|
||||
if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
|
||||
xlu_cfg_get_defbool(config, "stdvga", &b_info->u.hvm.stdvga, 0);
|
||||
if (!xlu_cfg_get_long(config, "stdvga", &l, 0))
|
||||
b_info->u.hvm.vga.kind = l ? LIBXL_VGA_INTERFACE_TYPE_STD :
|
||||
LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
|
||||
|
||||
xlu_cfg_get_defbool(config, "vnc", &b_info->u.hvm.vnc.enable, 0);
|
||||
xlu_cfg_replace_string (config, "vnclisten",
|
||||
&b_info->u.hvm.vnc.listen, 0);
|
||||
|
||||
@@ -110,8 +110,9 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config)
|
||||
libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
|
||||
printf("\t\t\t(no_incr_generationid %s)\n",
|
||||
libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
|
||||
printf("\t\t\t(stdvga %s)\n",
|
||||
libxl_defbool_to_string(b_info->u.hvm.stdvga));
|
||||
printf("\t\t\t(stdvga %s)\n", b_info->u.hvm.vga.kind ==
|
||||
LIBXL_VGA_INTERFACE_TYPE_STD ?
|
||||
"True" : "False");
|
||||
printf("\t\t\t(vnc %s)\n",
|
||||
libxl_defbool_to_string(b_info->u.hvm.vnc.enable));
|
||||
printf("\t\t\t(vnclisten %s)\n", b_info->u.hvm.vnc.listen);
|
||||
|
||||