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

Daniel P. Berrangé posted 1 patch 2 weeks ago
Failed in applying to current master (apply log)
guests/lcitool | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

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

Posted by Daniel P. Berrangé 2 weeks ago
The virtual networks are only available to the system libvirt
instance.

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

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

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

Posted by Daniel P. Berrangé 2 weeks ago
On Thu, May 02, 2019 at 03:29:51PM +0100, Daniel P. Berrangé wrote:
> The virtual networks are only available to the system libvirt
> instance.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  guests/lcitool | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Self-NACK.

While this works fine for initial install, we can't then ssh into
it to run ansible.  hostfwd could make that work, but libvirt
doesn't support it :-(

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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