mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-26 10:03:54 +03:00
distroinstaller: Remove implied cdrom installs
This is an obscure feature that I'm skeptical anyone is relying on, and has weirdly subtle semantics that are hard to test.
This commit is contained in:
parent
286dbf6d51
commit
4f320c2b98
@ -670,7 +670,6 @@ c.add_compare("--cdrom %(EXISTIMG2)s --os-variant win2k3 --wait 0 --vcpus cores=
|
||||
c.add_invalid("--paravirt --import --print-xml 2") # PV Import install, no second XML step
|
||||
|
||||
c = vinst.add_category("misc-install", "--nographics --noautoconsole")
|
||||
c.add_valid("--disk path=%(EXISTIMG1)s,device=cdrom") # Implied cdrom install
|
||||
c.add_compare("", "noargs-fail", auto_printarg=False) # No arguments
|
||||
c.add_valid("--panic help --disk=?") # Make sure introspection doesn't blow up
|
||||
c.add_valid("--test-stub-command") # --test-stub-command
|
||||
|
@ -34,10 +34,6 @@ def install_specified(options):
|
||||
return any([bool(o) for o in all_install_options(options)])
|
||||
|
||||
|
||||
def implied_cdrom_install(guest):
|
||||
return [d.is_cdrom() for d in guest.devices.disk]
|
||||
|
||||
|
||||
def supports_pxe(guest):
|
||||
"""
|
||||
Return False if we are pretty sure the config doesn't support PXE
|
||||
@ -488,10 +484,6 @@ def build_installer(options, guest):
|
||||
options.xmlonly or
|
||||
options.boot):
|
||||
instclass = virtinst.Installer
|
||||
elif implied_cdrom_install(guest):
|
||||
# Explicit install options always take precedent over this case
|
||||
cdrom = True
|
||||
instclass = virtinst.DistroInstaller
|
||||
|
||||
if not instclass:
|
||||
# This triggers an error in validate_required_options
|
||||
|
@ -35,8 +35,7 @@ def _is_url(conn, url):
|
||||
MEDIA_LOCATION_CDROM,
|
||||
MEDIA_LOCATION_URL,
|
||||
MEDIA_CDROM_PATH,
|
||||
MEDIA_CDROM_URL,
|
||||
MEDIA_CDROM_IMPLIED) = range(1, 7)
|
||||
MEDIA_CDROM_URL) = range(1, 6)
|
||||
|
||||
|
||||
class DistroInstaller(Installer):
|
||||
@ -60,10 +59,6 @@ class DistroInstaller(Installer):
|
||||
########################
|
||||
|
||||
def _get_media_type(self):
|
||||
if self.cdrom and not self.location:
|
||||
# CDROM install requested from a disk already attached to VM
|
||||
return MEDIA_CDROM_IMPLIED
|
||||
|
||||
if self.location and _is_url(self.conn, self.location):
|
||||
return self.cdrom and MEDIA_CDROM_URL or MEDIA_LOCATION_URL
|
||||
if self.cdrom:
|
||||
@ -128,7 +123,7 @@ class DistroInstaller(Installer):
|
||||
|
||||
def _is_persistent_cd(self):
|
||||
mediatype = self._get_media_type()
|
||||
local = mediatype in [MEDIA_CDROM_PATH, MEDIA_CDROM_IMPLIED,
|
||||
local = mediatype in [MEDIA_CDROM_PATH,
|
||||
MEDIA_LOCATION_DIR, MEDIA_LOCATION_CDROM]
|
||||
persistent_cd = bool(local and self.cdrom and self.livecd)
|
||||
return persistent_cd
|
||||
@ -177,9 +172,6 @@ class DistroInstaller(Installer):
|
||||
def _prepare(self, guest, meter):
|
||||
mediatype = self._get_media_type()
|
||||
|
||||
if mediatype == MEDIA_CDROM_IMPLIED:
|
||||
return
|
||||
|
||||
cdrom_path = None
|
||||
if mediatype == MEDIA_CDROM_PATH or mediatype == MEDIA_LOCATION_CDROM:
|
||||
cdrom_path = self.location
|
||||
|
Loading…
x
Reference in New Issue
Block a user