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

Daniel P. Berrangé berrange at redhat.com
Thu May 2 14:29:51 UTC 2019


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

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 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




More information about the libvir-list mailing list