libvirt-domain: forbid use virDomainRename in readonly connection

This function will change the guest name, we shouldn't
allow the readonly user do this.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
This commit is contained in:
Luyao Huang 2015-08-17 13:22:00 +08:00 committed by John Ferlan
parent b2da1d453f
commit 2b3fb38fab

View File

@ -8796,6 +8796,7 @@ virDomainRename(virDomainPtr dom,
virResetLastError();
virCheckDomainReturn(dom, -1);
virCheckNonNullArgGoto(new_name, error);
virCheckReadOnlyGoto(dom->conn->flags, error);
if (dom->conn->driver->domainRename) {
int ret = dom->conn->driver->domainRename(dom, new_name, flags);