[virt-tools-list] [PATCH 3/7] virt-install: utilize the LXC installer

Lubomir Rintel lkundrak at v3.sk
Fri Mar 23 09:17:02 UTC 2018


This hooks the newly added LXCInstaller class to the virt-install tool.
It is used when a container is being installed and installtion tree
location is set.
---
 virt-install         | 9 ++++++---
 virtinst/__init__.py | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/virt-install b/virt-install
index 8b84eff60..c5d2b15f5 100755
--- a/virt-install
+++ b/virt-install
@@ -460,7 +460,7 @@ def check_option_collisions(options, guest):
              {"methods": install_methods})
 
     if (guest.os.is_container() and
-        install_specified(options.location, options.cdrom,
+        install_specified(None, options.cdrom,
                           options.pxe, options.import_install)):
         fail(_("Install methods (%s) cannot be specified for "
                "container guests") % install_methods)
@@ -556,10 +556,13 @@ def build_installer(options, conn, virt_type):
     # Build the Installer instance
     if options.pxe:
         instclass = virtinst.PXEInstaller
+    elif virt_type == "exe":
+        if options.location:
+            instclass = virtinst.LXCInstaller
+        else:
+            instclass = virtinst.ContainerInstaller
     elif options.cdrom or options.location or options.livecd:
         instclass = virtinst.DistroInstaller
-    elif virt_type == "exe":
-        instclass = virtinst.ContainerInstaller
     elif options.import_install or options.boot:
         if options.import_install and options.nodisks:
             fail(_("A disk device must be specified with --import."))
diff --git a/virtinst/__init__.py b/virtinst/__init__.py
index eb3ec9b37..62207bae1 100644
--- a/virtinst/__init__.py
+++ b/virtinst/__init__.py
@@ -88,6 +88,7 @@ from virtinst.installer import (ContainerInstaller, ImportInstaller,
                                 PXEInstaller, Installer)
 
 from virtinst.distroinstaller import DistroInstaller
+from virtinst.lxcinstaller import LXCInstaller
 
 from virtinst.guest import Guest
 from virtinst.cloner import Cloner
-- 
2.14.3




More information about the virt-tools-list mailing list