]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virt-admin: Add warning when connection to default daemon fails
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Feb 2024 09:40:41 +0000 (10:40 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Feb 2024 15:06:15 +0000 (16:06 +0100)
commit442061583e9dc0e4e3bf314275979051345a4a93
tree10237a9f326fca4b1ee13660cb65ecc0bb4a7807
parent6eaf3614b6f2e79d5827b152a5cc100b05f1f935
virt-admin: Add warning when connection to default daemon fails

The admin connection defaults to the system-wide 'libvirtd' daemon to
manage (libvirtd:///system). As we've now switched to modular daemons
this will not work for most users out of the box:

 $ virt-admin version
 error: Failed to connect to the admin server
 error: no valid connection
 error: Failed to connect socket to '/run/user/1000/libvirt/libvirt-admin-sock': No such file or directory

As we don't want to assume which daemon the user wants to manage in the
modular topology there's no reasonable default to pick.

Give a hint to the users to use the '-c' if the connection to the
default URI fails:

 $ virt-admin version
 NOTE: Connecting to default daemon. Specify daemon using '-c' (e.g. virtqemud:///system)
 error: Failed to connect to the admin server
 error: no valid connection
 error: Failed to connect socket to '/run/user/1000/libvirt/libvirt-admin-sock': No such file or directory

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tools/virt-admin.c