mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-24 02:04:13 +03:00
virt-install: Make default graphics configurable
The '--default-graphics' option of 'setup.py configure' only affects virt-manager, but not virt-install. This should be unified, so this patch checks whether default_graphics taken from the cli is supported and uses that option. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=912615
This commit is contained in:
parent
4f7f9e2267
commit
b8a209ef9c
@ -639,9 +639,9 @@ This parameter is deprecated in favour of C<--network NETWORK,mac=12:34...>
|
|||||||
|
|
||||||
=head2 Graphics Configuration
|
=head2 Graphics Configuration
|
||||||
|
|
||||||
If no graphics option is specified, C<virt-install> will default to
|
If no graphics option is specified, C<virt-install> will try to select
|
||||||
'--graphics vnc' if the DISPLAY environment variable is set, otherwise
|
the appropriate graphics if the DISPLAY environment variable is set,
|
||||||
'--graphics none' is used.
|
otherwise '--graphics none' is used.
|
||||||
|
|
||||||
=over 2
|
=over 2
|
||||||
|
|
||||||
|
@ -84,4 +84,4 @@ preferred_distros = _split_list(_get_param("preferred_distros", ""))
|
|||||||
hv_packages = _split_list(_get_param("hv_packages", ""))
|
hv_packages = _split_list(_get_param("hv_packages", ""))
|
||||||
askpass_package = _split_list(_get_param("askpass_packages", ""))
|
askpass_package = _split_list(_get_param("askpass_packages", ""))
|
||||||
libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
|
libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
|
||||||
default_graphics = _get_param("default_graphics", "vnc")
|
default_graphics = _get_param("default_graphics", "spice")
|
||||||
|
@ -788,7 +788,8 @@ def digest_graphics(guest, options, default_override=None):
|
|||||||
if optnum == 0:
|
if optnum == 0:
|
||||||
# If no graphics specified, choose a default
|
# If no graphics specified, choose a default
|
||||||
if default_override is True:
|
if default_override is True:
|
||||||
vnc = True
|
if cliconfig.default_graphics in ["spice", "vnc", "sdl"]:
|
||||||
|
return [cliconfig.default_graphics]
|
||||||
elif default_override is False:
|
elif default_override is False:
|
||||||
nographics = True
|
nographics = True
|
||||||
else:
|
else:
|
||||||
@ -796,8 +797,14 @@ def digest_graphics(guest, options, default_override=None):
|
|||||||
logging.debug("Container guest, defaulting to nographics")
|
logging.debug("Container guest, defaulting to nographics")
|
||||||
nographics = True
|
nographics = True
|
||||||
elif "DISPLAY" in os.environ.keys():
|
elif "DISPLAY" in os.environ.keys():
|
||||||
logging.debug("DISPLAY is set: graphics defaulting to VNC.")
|
logging.debug("DISPLAY is set: looking for pre-configured graphics")
|
||||||
vnc = True
|
if cliconfig.default_graphics in ["spice", "vnc", "sdl"]:
|
||||||
|
logging.debug("Defaulting graphics to pre-configured %s" %
|
||||||
|
cliconfig.default_graphics.upper())
|
||||||
|
return [cliconfig.default_graphics]
|
||||||
|
logging.debug("No valid pre-configured graphics "
|
||||||
|
"found, defaulting to VNC")
|
||||||
|
return ["vnc"]
|
||||||
else:
|
else:
|
||||||
logging.debug("DISPLAY is not set: defaulting to nographics.")
|
logging.debug("DISPLAY is not set: defaulting to nographics.")
|
||||||
nographics = True
|
nographics = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user