Blame SOURCES/libvirt-api-disallow-virDomainAgentSetResponseTimeout-on-read-only-connections.patch

fbe740
From 0c1bec6a89f97c77ba9e0ed4146deb8606ea6f16 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <0c1bec6a89f97c77ba9e0ed4146deb8606ea6f16@dist-git>
fbe740
From: Jonathon Jongsma <jjongsma@redhat.com>
fbe740
Date: Wed, 25 Mar 2020 11:21:19 -0500
fbe740
Subject: [PATCH] api: disallow virDomainAgentSetResponseTimeout() on read-only
fbe740
 connections
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
This function changes the amount of time that libvirt waits for a
fbe740
response from the guest agent for all guest agent commands. Since this
fbe740
is a configuration change, it should not be allowed on read-only
fbe740
connections.
fbe740
fbe740
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
fbe740
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
fbe740
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
fbe740
(cherry picked from commit 4cc90c2e62df653e909ad31fd810224bf8bcf913)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1814508
fbe740
fbe740
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
fbe740
Message-Id: <20200325162119.9047-2-jjongsma@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/libvirt-domain.c | 2 ++
fbe740
 1 file changed, 2 insertions(+)
fbe740
fbe740
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
fbe740
index eb66999f07..3deee54e48 100644
fbe740
--- a/src/libvirt-domain.c
fbe740
+++ b/src/libvirt-domain.c
fbe740
@@ -12554,6 +12554,8 @@ virDomainAgentSetResponseTimeout(virDomainPtr domain,
fbe740
     virCheckDomainReturn(domain, -1);
fbe740
     conn = domain->conn;
fbe740
 
fbe740
+    virCheckReadOnlyGoto(conn->flags, error);
fbe740
+
fbe740
     if (conn->driver->domainAgentSetResponseTimeout) {
fbe740
         if (conn->driver->domainAgentSetResponseTimeout(domain, timeout, flags) < 0)
fbe740
             goto error;
fbe740
-- 
fbe740
2.26.0
fbe740