render / rpms / libvirt

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