[libvirt] [PATCH 0/5] domainRename API implementation

Tomas Meszaros exo at tty.sk
Wed Aug 5 11:59:06 UTC 2015


This is an effort to implement domain rename API. Presented patch series
consists of the following: virDomainRename API implementation for qemu,
implementation of the virsh command domrename and the additional support
code.

The idea behind this endeavor is to provide convenient and safe way to rename
a domain.

Instead of the:

    virsh dumpxml domain > domain.xml
    (change domain name in domain.xml)
    virsh undefine domain
    virsh define domain.xml

user can simply type:

    virsh domrename foo bar

or call virDomainRename() API and domain "foo" will be renamed to "bar".

We currently support only renaming inactive domains without snapshots.
Renaming procedure takes care of domain log, config, guest agent path and should
be able to recover in case of failure.

I've been working on this functionality in collaboration with Michal Privoznik
who is my mentor during the GSoC 2015. If you have any questions, ideas
or criticism feel free to join the discussion.


Tomas Meszaros (5):
  Introduce virDomainRename API
  virsh: Implement "domrename" command
  domain_conf: Introducde virDomainObjListRenameAddNew() &
    virDomainObjListRenameRemove()
  Introduce new VIR_DOMAIN_EVENT_DEFINED_RENAMED event
  qemu: Implement virDomainRename

 examples/object-events/event-test.c |   2 +
 include/libvirt/libvirt-domain.h    |   3 +
 src/access/viraccessperm.c          |   3 +-
 src/access/viraccessperm.h          |   6 ++
 src/conf/domain_conf.c              |  35 ++++++++
 src/conf/domain_conf.h              |   5 ++
 src/driver-hypervisor.h             |   5 ++
 src/libvirt-domain.c                |  31 +++++++
 src/libvirt_private.syms            |   2 +
 src/libvirt_public.syms             |   5 ++
 src/qemu/qemu_driver.c              | 172 ++++++++++++++++++++++++++++++++++++
 src/remote/remote_driver.c          |   1 +
 src/remote/remote_protocol.x        |  18 +++-
 src/remote_protocol-structs         |   8 ++
 tools/virsh-domain.c                |  60 ++++++++++++-
 tools/virsh.pod                     |   7 ++
 16 files changed, 360 insertions(+), 3 deletions(-)

--
2.1.0




More information about the libvir-list mailing list