[jenkins-ci PATCH] lcitool: use slirp networking if running non-root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The virtual networks are only available to the system libvirt
instance.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 guests/lcitool | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 0f60704..9d17f1a 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -511,9 +511,12 @@ class Application:
                 facts["install_disk_size"],
                 facts["install_storage_pool"],
             )
-            network_arg = "network={},model=virtio".format(
-                facts["install_network"],
-            )
+            if os.geteuid() == 0:
+                network_arg = "network={},model=virtio".format(
+                    facts["install_network"],
+                )
+            else:
+                network_arg = "user,model=virtio"
 
             # Different operating systems require different configuration
             # files for unattended installation to work, but some operating
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux