mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virt-install: concatenate all extra-args argument
So far we used only the last --extra-args argument from virt-install command line, but it makes more sense to use all occurrences of --extra-args and pass them to kernel. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
c8aaf08682
commit
4c3e7969c6
@ -8,7 +8,7 @@
|
|||||||
<type arch="x86_64">hvm</type>
|
<type arch="x86_64">hvm</type>
|
||||||
<kernel>/tmp/virtinst-vmlinuz.</kernel>
|
<kernel>/tmp/virtinst-vmlinuz.</kernel>
|
||||||
<initrd>/tmp/virtinst-initrd.img.</initrd>
|
<initrd>/tmp/virtinst-initrd.img.</initrd>
|
||||||
<cmdline>method=tests/cli-test-xml/faketree console=ttyS0</cmdline>
|
<cmdline>console=ttyS0 method=tests/cli-test-xml/faketree</cmdline>
|
||||||
</os>
|
</os>
|
||||||
<features>
|
<features>
|
||||||
<acpi/>
|
<acpi/>
|
||||||
|
@ -521,8 +521,9 @@ def _show_nographics_warnings(options, guest):
|
|||||||
# warn about it.
|
# warn about it.
|
||||||
return
|
return
|
||||||
|
|
||||||
if console_type in (options.extra_args or ""):
|
for args in options.extra_args:
|
||||||
return
|
if console_type in (options.extra_args or ""):
|
||||||
|
return
|
||||||
|
|
||||||
logging.warn(_("Did not find '%(console_string)s' in --extra-args, "
|
logging.warn(_("Did not find '%(console_string)s' in --extra-args, "
|
||||||
"which is likely required to see text install output from the "
|
"which is likely required to see text install output from the "
|
||||||
@ -589,7 +590,7 @@ def build_guest_instance(conn, options, parsermap):
|
|||||||
convert_old_os_options(options)
|
convert_old_os_options(options)
|
||||||
|
|
||||||
# non-xml install options
|
# non-xml install options
|
||||||
guest.installer.extraargs = options.extra_args
|
guest.installer.extraargs = options.extra_args or []
|
||||||
guest.installer.initrd_injections = options.initrd_inject
|
guest.installer.initrd_injections = options.initrd_inject
|
||||||
guest.autostart = options.autostart
|
guest.autostart = options.autostart
|
||||||
|
|
||||||
@ -922,7 +923,7 @@ def parse_args():
|
|||||||
help=_("Build guest around an existing disk image"))
|
help=_("Build guest around an existing disk image"))
|
||||||
insg.add_argument("--livecd", action="store_true",
|
insg.add_argument("--livecd", action="store_true",
|
||||||
help=_("Treat the CD-ROM media as a Live CD"))
|
help=_("Treat the CD-ROM media as a Live CD"))
|
||||||
insg.add_argument("-x", "--extra-args",
|
insg.add_argument("-x", "--extra-args", action="append",
|
||||||
help=_("Additional arguments to pass to the install kernel "
|
help=_("Additional arguments to pass to the install kernel "
|
||||||
"booted from --location"))
|
"booted from --location"))
|
||||||
insg.add_argument("--initrd-inject", action="append",
|
insg.add_argument("--initrd-inject", action="append",
|
||||||
|
@ -1807,12 +1807,8 @@ class vmmCreate(vmmGObjectUI):
|
|||||||
if cdrom:
|
if cdrom:
|
||||||
self._guest.installer.cdrom = True
|
self._guest.installer.cdrom = True
|
||||||
|
|
||||||
extraargs = ""
|
|
||||||
if extra:
|
if extra:
|
||||||
extraargs += extra
|
self._guest.installer.extraargs = [extra]
|
||||||
|
|
||||||
if extraargs:
|
|
||||||
self._guest.installer.extraargs = extraargs
|
|
||||||
|
|
||||||
if init:
|
if init:
|
||||||
self._guest.os.init = init
|
self._guest.os.init = init
|
||||||
|
@ -374,7 +374,8 @@ class DistroInstaller(Installer):
|
|||||||
|
|
||||||
self._install_kernel = kernel
|
self._install_kernel = kernel
|
||||||
self._install_initrd = initrd
|
self._install_initrd = initrd
|
||||||
self.extraargs = args
|
if args:
|
||||||
|
self.extraargs.append(args)
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
@ -59,7 +59,7 @@ class Installer(object):
|
|||||||
|
|
||||||
self.cdrom = False
|
self.cdrom = False
|
||||||
self.livecd = False
|
self.livecd = False
|
||||||
self.extraargs = None
|
self.extraargs = []
|
||||||
|
|
||||||
self.initrd_injections = []
|
self.initrd_injections = []
|
||||||
|
|
||||||
@ -128,7 +128,7 @@ class Installer(object):
|
|||||||
if self._install_initrd:
|
if self._install_initrd:
|
||||||
guest.os.initrd = self._install_initrd
|
guest.os.initrd = self._install_initrd
|
||||||
if self.extraargs:
|
if self.extraargs:
|
||||||
guest.os.kernel_args = self.extraargs
|
guest.os.kernel_args = " ".join(self.extraargs)
|
||||||
|
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
|
@ -644,9 +644,6 @@ class Distro(object):
|
|||||||
if not self.fetcher.location.startswith("/"):
|
if not self.fetcher.location.startswith("/"):
|
||||||
args += "%s=%s" % (self._get_method_arg(), self.fetcher.location)
|
args += "%s=%s" % (self._get_method_arg(), self.fetcher.location)
|
||||||
|
|
||||||
if guest.installer.extraargs:
|
|
||||||
args += " " + guest.installer.extraargs
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
initrd = self.fetcher.acquireFile(initrdpath)
|
initrd = self.fetcher.acquireFile(initrdpath)
|
||||||
return kernel, initrd, args
|
return kernel, initrd, args
|
||||||
|
Loading…
Reference in New Issue
Block a user