- libxl: Implement domainGetMessages API

cbae4eaa-libxl-add-domainGetMessages.patch
  bsc##1193623

OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=916
This commit is contained in:
James Fehlig 2021-12-14 16:38:36 +00:00 committed by Git OBS Bridge
parent 35b29c118b
commit 048a050f6a
3 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,62 @@
commit cbae4eaa19dd97da8b4330af80cf1e1f7cb21931
Author: Jim Fehlig <jfehlig@suse.com>
Date: Mon Dec 13 16:59:55 2021 -0700
libxl: Implement domainGetMessages API
Since commit 46783e6307a, the 'virsh dominfo' command calls
virDomainGetMessages to report any messages from the domain.
Hypervisors not implementing the API now get the following
libvirtd log message when clients invoke 'virsh dominfo'
this function is not supported by the connection driver: virDomainGetMessages
Although libxl currently does not support any tainting or
deprecation messages, provide an implementation to squelch
the previously unseen error message when collecting dominfo.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bc8598ea96..2d9385654c 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -6385,6 +6385,29 @@ libxlDomainGetMetadata(virDomainPtr dom,
return ret;
}
+static int
+libxlDomainGetMessages(virDomainPtr dom,
+ char ***msgs,
+ unsigned int flags)
+{
+ virDomainObj *vm = NULL;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ return -1;
+
+ if (virDomainGetMessagesEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ ret = virDomainObjGetMessages(vm, msgs, flags);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
static virHypervisorDriver libxlHypervisorDriver = {
.name = LIBXL_DRIVER_EXTERNAL_NAME,
.connectURIProbe = libxlConnectURIProbe,
@@ -6498,6 +6521,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
.connectBaselineCPU = libxlConnectBaselineCPU, /* 2.3.0 */
.domainSetMetadata = libxlDomainSetMetadata, /* 5.7.0 */
.domainGetMetadata = libxlDomainGetMetadata, /* 5.7.0 */
+ .domainGetMessages = libxlDomainGetMessages, /* 8.0.0 */
};

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Dec 14 16:36:15 UTC 2021 - James Fehlig <jfehlig@suse.com>
- libxl: Implement domainGetMessages API
cbae4eaa-libxl-add-domainGetMessages.patch
bsc##1193623
-------------------------------------------------------------------
Mon Dec 13 15:15:35 UTC 2021 - James Fehlig <jfehlig@suse.com>

View File

@ -292,6 +292,7 @@ Patch2: e4f7589a-libxl-shutdown-thread-name.patch
Patch3: b9a5faea-libxl-handle-death-thread.patch
Patch4: 5c5df531-libxl-search-domid-in-thread.patch
Patch5: a7a03324-libxl-protect-logger-access.patch
Patch6: cbae4eaa-libxl-add-domainGetMessages.patch
# Patches pending upstream review
Patch100: libxl-dom-reset.patch
Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch