libvirt does not work

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Pierre Langlois
  • qblade
Owner
unassigned
Submitted by
qblade
Severity
normal
Q
Q
qblade wrote on 1 Apr 2021 15:38
FhsbeL1BHR_XS6-TjLxQ8VbYpIq8ngMHr6EPt6-lBw78dwmhxuU8kn_KcDYW-ntg0U4gcvMAQ7ktzE0SxS8s-WYv_BhdqUO6hfwFh7N9Aoo=@protonmail.com
after this commit, the `virsh` does not work corrent:

```
commit 383b02a370252c08eb1d43ac94d659c1d3993a35
Author: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sat Mar 20 21:31:22 2021 +0000

gnu: libvirt: Update to 7.1.0.

* gnu/packages/virtualization.scm (libvirt): Update to 7.1.0.
[source]: Remove libvirt-create-machine-cgroup.patch, add
libvirt-do-not-create-var-dirs.patch.
[build-system]: Switch to meson-build-system.
[arguments]: Use meson-0.55. Adapt #:configure-flags for meson, there is no
need for --docdir anymore. Remove fix-BOURNE_SHELL-definition phase. Add
fix-sysconfdir-and-localstatedir phase. Adapt disable-broken-tests to meson.
[native-inputs]: Add python-docutils and rpcsvc-proto.
* gnu/packages/patches/libvirt-create-machine-cgroup.patch: Delete.
* gnu/packages/patches/libvirt-do-not-create-var-dirs.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add new patch, remove the other.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>

```

Command to reproduce wrong:
```
# This is wrong:
# After commit
luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:16:37 PM HKT]
$ GUIX_BUILD_OPTIONS="" guix time-machine --commit=383b02a370252c08eb1d43ac94d659c1d3993a35 -c 8 -M 8 -- environment --ad-hoc libvirt -- virsh connect
qemu:///system
error: failed to connect to the hypervisor
error: Failed to connect socket to 'var/run/libvirt/libvirt-sock': No such file or directory


```

It uses the wrong path to connect to libvirtd of the current system.

Command to reproduce corrent:
```
# This is corrent:
# Before commit


luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:16:32 PM HKT]
$ GUIX_BUILD_OPTIONS="" guix time-machine --commit=c536f0b217714917988d2f412999d978c2f2f495 -c 8 -M 8 -- environment --ad-hoc libvirt -- virsh connect qemu:///system
error: failed to connect to the hypervisor
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
```

I use strace to create verbose log:


```
luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:22:18 PM HKT]
$ GUIX_BUILD_OPTIONS="" guix time-machine --commit=383b02a370252c08eb1d43ac94d659c1d3993a35 -c 8 -M 8 -- environment --ad-hoc libvirt strace -- strace -o strace.log -- virsh connect qemu:///system
error: failed to connect to the hypervisor
error: Failed to connect socket to 'var/run/libvirt/libvirt-sock': No such file or directory


```

strace shows that it did use the wrong path:

```
1056 access("var/run/libvirt/virtqemud-sock", F_OK) = -1 ENOENT (No such file or directory)
1057 access("var/run/libvirt/libvirt-sock", F_OK) = -1 ENOENT (No such file or directory)
```

full strace log is in the attachment
| | |
V V V


My guess is that the patch in the commit caused this problem, but I have no ability to fix it.
Please fix it


thanks

qblade
Attachment: strace.log
P
P
Pierre Langlois wrote on 2 Apr 2021 00:05
(name . qblade)(address . qblade@protonmail.com)
871rbtwti8.fsf@gmx.com
Hello!

qblade via Bug reports for GNU Guix writes:

Toggle quote (25 lines)
> after this commit, the `virsh` does not work corrent:
>
> ```
> commit 383b02a370252c08eb1d43ac94d659c1d3993a35
> Author: Pierre Langlois <pierre.langlois@gmx.com>
> Date: Sat Mar 20 21:31:22 2021 +0000
>
> gnu: libvirt: Update to 7.1.0.
>
> * gnu/packages/virtualization.scm (libvirt): Update to 7.1.0.
> [source]: Remove libvirt-create-machine-cgroup.patch, add
> libvirt-do-not-create-var-dirs.patch.
> [build-system]: Switch to meson-build-system.
> [arguments]: Use meson-0.55. Adapt #:configure-flags for meson, there is no
> need for --docdir anymore. Remove fix-BOURNE_SHELL-definition phase. Add
> fix-sysconfdir-and-localstatedir phase. Adapt disable-broken-tests to meson.
> [native-inputs]: Add python-docutils and rpcsvc-proto.
> * gnu/packages/patches/libvirt-create-machine-cgroup.patch: Delete.
> * gnu/packages/patches/libvirt-do-not-create-var-dirs.patch: New patch.
> * gnu/local.mk (dist_patch_DATA): Add new patch, remove the other.
>
> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
>
> ```

Ooh no! Sorry for the breakage!

Toggle quote (16 lines)
>
> Command to reproduce wrong:
> ```
> # This is wrong:
> # After commit
> luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:16:37 PM HKT]
> $ GUIX_BUILD_OPTIONS="" guix time-machine --commit=383b02a370252c08eb1d43ac94d659c1d3993a35 -c 8 -M 8 -- environment --ad-hoc libvirt -- virsh connect
> qemu:///system
> error: failed to connect to the hypervisor
> error: Failed to connect socket to 'var/run/libvirt/libvirt-sock': No such file or directory
>
>
> ```
>
> It uses the wrong path to connect to libvirtd of the current system.

I see, I tried to cover all cases where libvirt would not use the
correct /var and /etc but clearly missed some :-/.

Toggle quote (40 lines)
>
> Command to reproduce corrent:
> ```
> # This is corrent:
> # Before commit
>
>
> luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:16:32 PM HKT]
> $ GUIX_BUILD_OPTIONS="" guix time-machine --commit=c536f0b217714917988d2f412999d978c2f2f495 -c 8 -M 8 -- environment --ad-hoc libvirt -- virsh connect qemu:///system
> error: failed to connect to the hypervisor
> error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory
> ```
>
> I use strace to create verbose log:
>
>
> ```
> luhux@thinkpad-x230 ~ [date: Thu 01 Apr 2021 09:22:18 PM HKT]
> $ GUIX_BUILD_OPTIONS="" guix time-machine --commit=383b02a370252c08eb1d43ac94d659c1d3993a35 -c 8 -M 8 -- environment --ad-hoc libvirt strace -- strace -o strace.log -- virsh connect qemu:///system
> error: failed to connect to the hypervisor
> error: Failed to connect socket to 'var/run/libvirt/libvirt-sock': No such file or directory
>
>
> ```
>
> strace shows that it did use the wrong path:
>
> ```
> 1056 access("var/run/libvirt/virtqemud-sock", F_OK) = -1 ENOENT (No such file or directory)
> 1057 access("var/run/libvirt/libvirt-sock", F_OK) = -1 ENOENT (No such file or directory)
> ```
>
> full strace log is in the attachment
> | | |
> V V V
>
>
> My guess is that the patch in the commit caused this problem, but I have no ability to fix it.
> Please fix it

I'll see if I can look into it at the weekend, although I'm not sure
I'll be able to get to it, so in the meantime we should probably just
revert the updates. Thanks a lot for investigating though, I think we
ought to write a system test that uses virsh to connect if that's
possible.

All that being said, I just noticed somebody had already posted an
alternative patch to do the update before I did, maybe that one is

Anyways, I'll revert the patches tomorrow unless there are any
objections!

Sorry again,

Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmBmQ58YHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UvI8H/ira0WDQK2mzL1FqrJvMaVE5
LMpQ+v/gwQv7ylTLTLHj9j8eiwO9LozyEq5jc2xi45/ttUd+0JZsRY3CalkyrYwG
FJykPPGnBxgrdmTx/Slv+EMW9jh7NVJN8IfaLD7gUcSkxIxPVk8gobQ23Dr+O3OP
Oi/tISwK+yHpbjjnLLLWcTzd0ZQgW/6YB5Cy7lvejPaKYxJPkX0QC5hIQN5cx0eR
chsfpdP5cLzCAidR9iR7lLrOwgDNux5AMKF0JsoJ6uQftLRA7cSSO4NjGXBc7iLv
3cbPd8FCFdenSKWiRt6JLD4IhtjzzkEwrS4WqHoB8dyDBzYCu5vn/fZ2kQEv2+c=
=v8dX
-----END PGP SIGNATURE-----

P
P
Pierre Langlois wrote on 2 Apr 2021 14:06
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
87a6qgvqjh.fsf@gmx.com
Pierre Langlois writes:

Toggle quote (2 lines)
> Hello!

(snip)

Toggle quote (13 lines)
> I'll see if I can look into it at the weekend, although I'm not sure
> I'll be able to get to it, so in the meantime we should probably just
> revert the updates. Thanks a lot for investigating though, I think we
> ought to write a system test that uses virsh to connect if that's
> possible.
>
> All that being said, I just noticed somebody had already posted an
> alternative patch to do the update before I did, maybe that one is
> correct! https://issues.guix.gnu.org/46623
>
> Anyways, I'll revert the patches tomorrow unless there are any
> objections!

Ok, I've reverted the update while we work on updating it again, this
time correctly and with a working test :-).

Thanks,
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmBnCOIYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31Ul4oIAJmPV3iADkHex+o+nGmsRcaB
YakEVHhwtX0avA1VOulnrd9PKG7WOVovuZgU86r5J567K+CyWRS7FC/yymyqH/qM
1bD46iscxzxL5EQlFAf06Zo5OgfzBul0siXQUO5TOvjTpMfmqkQq30ILTUH4k6Gn
qBY2zrkmuZm+kU5r+bUJnjoNTqUgFSXajaD++MZHjmkyJ+grhB+QUdQkkGY/qXgy
mvu/dZMjUafp4GrAOsey6hdtqPC97QYJL/jl4nNCgHk4R4jhnhMTbbS814q/CHe1
hB/+6S/0lq8t4+wXKqxjxZ4kLZ92TQIozo47KrSlJYigoOXFeupLGFW1L3Tn3as=
=REfZ
-----END PGP SIGNATURE-----

Closed
L
L
Ludovic Courtès wrote on 2 Apr 2021 17:16
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
87eefs1zuq.fsf@gnu.org
Hi Pierre,

Pierre Langlois <pierre.langlois@gmx.com> skribis:

Toggle quote (13 lines)
> I'll see if I can look into it at the weekend, although I'm not sure
> I'll be able to get to it, so in the meantime we should probably just
> revert the updates. Thanks a lot for investigating though, I think we
> ought to write a system test that uses virsh to connect if that's
> possible.
>
> All that being said, I just noticed somebody had already posted an
> alternative patch to do the update before I did, maybe that one is
> correct! https://issues.guix.gnu.org/46623
>
> Anyways, I'll revert the patches tomorrow unless there are any
> objections!

It would be best to see how to fix it, but if there’s nothing obvious,
we can revert.

Thanks,
Ludo’.
P
P
Pierre Langlois wrote on 2 Apr 2021 17:34
(name . Ludovic Courtès)(address . ludo@gnu.org)
87y2e0u2d3.fsf@gmx.com
Hi Ludo,

Ludovic Courtès writes:

Toggle quote (20 lines)
> Hi Pierre,
>
> Pierre Langlois <pierre.langlois@gmx.com> skribis:
>
>> I'll see if I can look into it at the weekend, although I'm not sure
>> I'll be able to get to it, so in the meantime we should probably just
>> revert the updates. Thanks a lot for investigating though, I think we
>> ought to write a system test that uses virsh to connect if that's
>> possible.
>>
>> All that being said, I just noticed somebody had already posted an
>> alternative patch to do the update before I did, maybe that one is
>> correct! https://issues.guix.gnu.org/46623
>>
>> Anyways, I'll revert the patches tomorrow unless there are any
>> objections!
>
> It would be best to see how to fix it, but if there’s nothing obvious,
> we can revert.

Yeah, in the end I saw Brice's update patch that I missed from back in
February (oooups!) and that one works just fine! So I've reverted it so
we can go with his approach, I've posted a new series that includes it:

Thanks,
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmBnOYkYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UGHsH/jV2BKok1WyO3j3NG2fPVZC+
Ro6tAwhvnmhbq+Mqt+cabGbBwwpxEF2O6KMyLrcGuOD2GbNn1D5/uC+HQ5IJqvrl
ZEzmpFDUrGDhwyOl+LwWJzRRbaMYfCUy2CSkk93E1pJiN88SBYcOJSlxyoMNb17+
pKwg7j3EnpdElaQQkdXTxiSJy/jFM09iLifD08wVa2ozQyOVOOiiHN4b7pPDO/Qq
ylDW+SPABnCT5+Fi6U4z5ZLvezZ/2aFQ7x7wzhuKTNEQj9eZK0Em9eXX9d+Rsz6Y
162nbm2fF3PIIBOQ5whd9Zg6KwN4p7IP7NwQGe7bjiW1tpWzKRZTeoslvWIEvFM=
=AtTy
-----END PGP SIGNATURE-----

?