Michal Privoznik f6e88f6113 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>
2023-07-19 13:08:30 +02:00
..
2023-03-13 13:29:07 +01:00
2023-05-05 15:08:25 +02:00
2023-05-05 15:08:25 +02:00
2023-03-13 13:29:07 +01:00
2023-05-05 15:08:25 +02:00
2022-06-16 06:43:58 +02:00
2023-04-14 15:22:02 +02:00
2023-04-14 15:22:02 +02:00