render / rpms / libvirt

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