]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
api: disallow virDomainAgentSetResponseTimeout() on read-only connections
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 20 Mar 2020 14:43:13 +0000 (09:43 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Mar 2020 13:47:38 +0000 (14:47 +0100)
This function changes the amount of time that libvirt waits for a
response from the guest agent for all guest agent commands. Since this
is a configuration change, it should not be allowed on read-only
connections.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/libvirt-domain.c

index 65813b68ccd8b23b56a76b5a19f7afddc1249cdd..a12809c2d5e36a5c3b0726e7be9c27300b726d5e 100644 (file)
@@ -12576,6 +12576,8 @@ virDomainAgentSetResponseTimeout(virDomainPtr domain,
     virCheckDomainReturn(domain, -1);
     conn = domain->conn;
 
+    virCheckReadOnlyGoto(conn->flags, error);
+
     if (conn->driver->domainAgentSetResponseTimeout) {
         if (conn->driver->domainAgentSetResponseTimeout(domain, timeout, flags) < 0)
             goto error;