bug#57272: libvirt 8.6 fails to start network

2022-08-29 Thread Marius Bakke
Hi, thanks for the bug report, and sorry for the breakage.

Lars-Dominik Braun  skriver:

> Hi,
>
> after the update to libvirt 8.6.0 in
> 3a76c2bfd94557c9776aa11240fec14580aec1b0 networks don’t start any more:
>
> > LANG=C virsh net-start default
> error: Failed to start network default
> error: Unable to find 'dnsmasq' binary in $PATH: No such file or directory
>
> I tried to patch dnsmasq’s path like follows, but then the testcase
> networkxml2conftest fails and cannot find dnsmasq either.

I don't understand why that test is failing with your patch.  It has a
hard coded "/usr/sbin/dnsmasq", but patching that does not make a
difference.  It seems the lookup via virFindFileInPath, which ultimately
calls out to GLib's g_find_program_in_path, fails; but ostensibly using
an absolute file name should not make a difference[0].

  [0]: https://docs.gtk.org/glib/func.find_program_in_path.html

Anyway, I was able to reproduce the failure in the system test:

--8<---cut here---start->8---
diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm
index 4bd56e5d9d..557f30db4f 100644
--- a/gnu/tests/virtualization.scm
+++ b/gnu/tests/virtualization.scm
@@ -106,6 +106,26 @@ (define marionette
  "-c" "qemu:///system" "connect"))
  marionette))
 
+  (test-eq "create default network"
+0
+(marionette-eval
+ '(begin
+(chdir "/tmp")
+(system* #$(file-append libvirt "/bin/virsh")
+ "-c" "qemu:///system" "net-define"
+ #$(file-append libvirt
+
"/etc/libvirt/qemu/networks/default.xml")))
+ marionette))
+
+  (test-eq "start default network"
+0
+(marionette-eval
+ '(begin
+(chdir "/tmp")
+(system* #$(file-append libvirt "/bin/virsh")
+ "-c" "qemu:///system" "net-start" "default"))
+ marionette))
+
   (test-end
 
   (gexp->derivation "libvirt-test" test))
--8<---cut here---end--->8---

And can confirm your patch fixes that, which is arguably more important.
So I went ahead and committed your patch (and disabled the failing
test), and the system test to avoid future regressions in this area.

Fixed in:

  acbf2f9def gnu: libvirt: Use absolute dnsmasq.
  3e0abde17b tests: libvirt: Ensure the default network can be started.


signature.asc
Description: PGP signature


bug#57272: libvirt 8.6 fails to start network

2022-08-18 Thread Lars-Dominik Braun
Hi,

after the update to libvirt 8.6.0 in
3a76c2bfd94557c9776aa11240fec14580aec1b0 networks don’t start any more:

> LANG=C virsh net-start default
error: Failed to start network default
error: Unable to find 'dnsmasq' binary in $PATH: No such file or directory

I tried to patch dnsmasq’s path like follows, but then the testcase
networkxml2conftest fails and cannot find dnsmasq either.

---snip---
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index d451b8529e..89507774cb 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -1311,6 +1311,12 @@ (define-public libvirt
   (substitute* "scripts/meson-install-dirs.py"
 (("destdir = .*")
  "destdir = '/tmp'"
+  (add-after 'unpack 'fix-paths
+(lambda* (#:key inputs #:allow-other-keys)
+  (let ((dnsmasq (search-input-file inputs "sbin/dnsmasq")))
+(substitute* "src/util/virdnsmasq.c"
+  (("#define DNSMASQ \"dnsmasq\"")
+   (string-append "#define DNSMASQ \"" dnsmasq "\""))
   (add-before 'configure 'disable-broken-tests
 (lambda _
   (let ((tests (list "commandtest" ; hangs idly
---snap---

I’m not sure what the problem might be.

Lars