]> xenbits.xensource.com Git - libvirt.git/commit
virsh: Make cmdVersion() work with split daemon
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Jul 2023 13:05:19 +0000 (15:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 19 Jul 2023 11:08:30 +0000 (13:08 +0200)
commitf6e88f611359d617caef2cecbfb02a56cbc2bde4
tree0d9904c713b6fceae7c6d2a78a155c093fb492c0
parent59d73ae7684757c3cbb7f2ef6324ac54bcaa96e7
virsh: Make cmdVersion() work with split daemon

When virsh connects to a non-hypervisor daemon directly (e.g.
"nodedev:///system") and user executes 'version' they are met
with an error message. This is because cmdVersion() calls
virConnectGetVersion() which fails, hence the error.

The reason for virConnectGetVersion() fail is simple - it's
documented as:

  Get the version level of the Hypervisor running.

Well, there's no hypervisor in non-hypervisor daemons and thus it
doesn't make sense to provide an implementation in each driver's
virConnectDriver.hypervisorDriver table (just like we do for
other APIs, e.g. nodeConnectIsSecure()).

Given all of this, just make cmdVersion() deal with the error in
a non-fatal fashion.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
tools/virsh-host.c