On Thu, Aug 13, 2015 at 10:22:25 +0200, Tomas Meszaros wrote:
Also, among with this new API new ACL that restricts rename
capability
is invented too.
Signed-off-by: Tomas Meszaros <exo(a)tty.sk>
---
include/libvirt/libvirt-domain.h | 4 ++++
src/driver-hypervisor.h | 6 ++++++
src/libvirt-domain.c | 35 +++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 18 +++++++++++++++++-
src/remote_protocol-structs | 9 +++++++++
7 files changed, 77 insertions(+), 1 deletion(-)
...
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index dc89bab..9065dab 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -8774,6 +8774,41 @@ virDomainIsPersistent(virDomainPtr dom)
return -1;
}
+/**
+ * virDomainRename:
+ * @dom: pointer to the domain object
+ * @new_name: new domain name
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Rename a domain. New domain name is specified in the second
+ * argument. Depending on each driver implementation it may be
+ * required that domain is in a specific state.
Additionally the comment should state that certain attributes of the
domain's config are not modified even if they contain the domain name.
One example is the auto-generated socket path for guest agent
connections. Neglecting to change it after a rename and defining a new
domain with the same name as the previously renamed one will then result
in problems in guest agent use. Ideally the code would rename that but
IIRC the idea was rejected previously.
Peter