mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add virConnectGetLibvirtVersion API
There is currently no way to determine the libvirt version of a remote libvirtd we are connected to. This is a useful piece of data to enable feature detection.
This commit is contained in:
@@ -258,6 +258,26 @@ remoteDispatchGetVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetLibVersion (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
virConnectPtr conn,
|
||||
remote_message_header *hdr ATTRIBUTE_UNUSED,
|
||||
remote_error *rerr,
|
||||
void *args ATTRIBUTE_UNUSED,
|
||||
remote_get_lib_version_ret *ret)
|
||||
{
|
||||
unsigned long libVer;
|
||||
|
||||
if (virConnectGetLibVersion (conn, &libVer) == -1) {
|
||||
remoteDispatchConnError(rerr, conn);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret->lib_ver = libVer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
remoteDispatchGetHostname (struct qemud_server *server ATTRIBUTE_UNUSED,
|
||||
struct qemud_client *client ATTRIBUTE_UNUSED,
|
||||
|
||||
Reference in New Issue
Block a user