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

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. v2: - removed guest agent path rename code - removed rename permission - added code for emitting undefined+renamed event for the old domain v3: - removed domain rename permission - fixed virDomainRename doc comment - added @flags parameter to the virDomainRename API v4: - removed ATTRIBUTE_UNUSED from the @flags parameter - added virCheckFlags() call - added flags to the remote_domain_rename_args 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 | 4 + include/libvirt/libvirt-domain.h | 6 ++ src/conf/domain_conf.c | 35 +++++++++ src/conf/domain_conf.h | 5 ++ src/driver-hypervisor.h | 6 ++ src/libvirt-domain.c | 35 +++++++++ src/libvirt_private.syms | 2 + src/libvirt_public.syms | 5 ++ src/qemu/qemu_driver.c | 147 ++++++++++++++++++++++++++++++++++++ src/remote/remote_driver.c | 1 + src/remote/remote_protocol.x | 18 ++++- src/remote_protocol-structs | 9 +++ tools/virsh-domain.c | 63 +++++++++++++++- tools/virsh.pod | 7 ++ 14 files changed, 340 insertions(+), 3 deletions(-) -- 2.1.0

Also, among with this new API new ACL that restricts rename capability is invented too. Signed-off-by: Tomas Meszaros <exo@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/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index e8ea7b4..fb3ea0f 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -3844,4 +3844,8 @@ int virDomainSetUserPassword(virDomainPtr dom, const char *password, unsigned int flags); +int virDomainRename(virDomainPtr dom, + const char *new_name, + unsigned int flags); + #endif /* __VIR_LIBVIRT_DOMAIN_H__ */ diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 3275343..ae2ec4d 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -650,6 +650,11 @@ typedef int (*virDrvDomainIsActive)(virDomainPtr dom); typedef int +(*virDrvDomainRename)(virDomainPtr dom, + const char *new_name, + unsigned int flags); + +typedef int (*virDrvDomainIsPersistent)(virDomainPtr dom); typedef int @@ -1347,6 +1352,7 @@ struct _virHypervisorDriver { virDrvConnectIsEncrypted connectIsEncrypted; virDrvConnectIsSecure connectIsSecure; virDrvDomainIsActive domainIsActive; + virDrvDomainRename domainRename; virDrvDomainIsPersistent domainIsPersistent; virDrvDomainIsUpdated domainIsUpdated; virDrvConnectCompareCPU connectCompareCPU; 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. + * + * Returns 0 if successfully renamed, -1 on error + */ +int +virDomainRename(virDomainPtr dom, + const char *new_name, + unsigned int flags) +{ + VIR_DEBUG("dom=%p, new_name=%s", dom, NULLSTR(new_name)); + + virResetLastError(); + virCheckDomainReturn(dom, -1); + virCheckNonNullArgGoto(new_name, error); + + if (dom->conn->driver->domainRename) { + int ret = dom->conn->driver->domainRename(dom, new_name, flags); + if (ret < 0) + goto error; + return ret; + } + + virReportUnsupportedError(); + error: + virDispatchError(dom->conn); + return -1; +} /** * virDomainIsUpdated: diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms index 2c653f2..dd94191 100644 --- a/src/libvirt_public.syms +++ b/src/libvirt_public.syms @@ -720,4 +720,9 @@ LIBVIRT_1.2.17 { virTypedParamsAddStringList; } LIBVIRT_1.2.16; +LIBVIRT_1.2.19 { + global: + virDomainRename; +} LIBVIRT_1.2.17; + # .... define new API here using predicted next version number .... diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 5c4cf7c..ec26ebe 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -8391,6 +8391,7 @@ static virHypervisorDriver hypervisor_driver = { .domainGetFSInfo = remoteDomainGetFSInfo, /* 1.2.11 */ .domainInterfaceAddresses = remoteDomainInterfaceAddresses, /* 1.2.14 */ .domainSetUserPassword = remoteDomainSetUserPassword, /* 1.2.16 */ + .domainRename = remoteDomainRename, /* 1.2.19 */ }; static virNetworkDriver network_driver = { diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 9f1be6b..770aa72 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -3230,6 +3230,15 @@ struct remote_domain_set_user_password_args { unsigned int flags; }; +struct remote_domain_rename_args { + remote_nonnull_domain dom; + remote_string new_name; + unsigned int flags; +}; + +struct remote_domain_rename_ret { + int rename; +}; /*----- Protocol. -----*/ @@ -5696,5 +5705,12 @@ enum remote_procedure { * @generate:both * @acl: domain:set_password */ - REMOTE_PROC_DOMAIN_SET_USER_PASSWORD = 357 + REMOTE_PROC_DOMAIN_SET_USER_PASSWORD = 357, + + /** + * @generate: both + * @acl: domain:write + * @acl: domain:save + */ + REMOTE_PROC_DOMAIN_RENAME = 358 }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 48c3bd8..ca36dc9 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2684,6 +2684,14 @@ struct remote_domain_set_user_password_args { remote_string password; u_int flags; }; +struct remote_domain_rename_args { + remote_nonnull_domain dom; + remote_string new_name; + u_int flags; +}; +struct remote_domain_rename_ret { + int rename; +}; enum remote_procedure { REMOTE_PROC_CONNECT_OPEN = 1, REMOTE_PROC_CONNECT_CLOSE = 2, @@ -3042,4 +3050,5 @@ enum remote_procedure { REMOTE_PROC_DOMAIN_ADD_IOTHREAD = 355, REMOTE_PROC_DOMAIN_DEL_IOTHREAD = 356, REMOTE_PROC_DOMAIN_SET_USER_PASSWORD = 357, + REMOTE_PROC_DOMAIN_RENAME = 358, }; -- 2.1.0

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@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

This patch implements new virsh command, domrename. Using domrename, it will be possible to rename domain from the virsh shell by calling virRenameDomain API. It takes two arguments, current domain name and new domain name. Example: virsh # list --all Id Name State ---------------------------------------------------- - bar shut off virsh # domrename bar foo Domain successfully renamed virsh # list --all Id Name State ---------------------------------------------------- - foo shut off virsh # Signed-off-by: Tomas Meszaros <exo@tty.sk> --- tools/virsh-domain.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/virsh.pod | 7 +++++++ 2 files changed, 64 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c8b0e76..e2f5a0b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9746,6 +9746,57 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd) } /* + * "domrename" command + */ +static const vshCmdInfo info_domrename[] = { + {.name = "help", + .data = N_("rename a domain") + }, + {.name = "desc", + .data = "Rename an inactive domain." + }, + {.name = NULL} +}; + +static const vshCmdOptDef opts_domrename[] = { + {.name = "domain", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("domain name, id or uuid") + }, + {.name = "new-name", + .type = VSH_OT_DATA, + .flags = VSH_OFLAG_REQ, + .help = N_("new domain name") + }, + {.name = NULL} +}; + +static bool +cmdDomrename(vshControl *ctl, const vshCmd *cmd) +{ + virDomainPtr dom; + const char *new_name = NULL; + bool ret = false; + + if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) + return ret; + + if (vshCommandOptStringReq(ctl, cmd, "new-name", &new_name) < 0) + goto cleanup; + + if (virDomainRename(dom, new_name, 0) < 0) + goto cleanup; + + vshPrint(ctl, "Domain successfully renamed\n"); + ret = true; + + cleanup: + virDomainFree(dom); + return false; +} + +/* * "domid" command */ static const vshCmdInfo info_domid[] = { @@ -13102,6 +13153,12 @@ const vshCmdDef domManagementCmds[] = { .info = info_domname, .flags = 0 }, + {.name = "domrename", + .handler = cmdDomrename, + .opts = opts_domrename, + .info = info_domrename, + .flags = 0 + }, {.name = "dompmsuspend", .handler = cmdDomPMSuspend, .opts = opts_dom_pm_suspend, diff --git a/tools/virsh.pod b/tools/virsh.pod index 07e6ba7..83c445d3 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1258,6 +1258,13 @@ on both of them). Convert a domain Id (or UUID) to domain name +=item B<domrename> I<domain> I<new-name> + +Rename a domain. This command changes current domain name to the new name +specified in the second argument. + +B<Note>: Domain must be inactive and without snapshots. + =item B<domstate> I<domain> [I<--reason>] Returns state about a domain. I<--reason> tells virsh to also print -- 2.1.0

We just need to update the entry in the second hash table. Since commit 8728a56 we have two hash tables for the domain list so that we can do O(1) lookup regardless of looking up by UUID or name. Since with renaming a domain UUID does not change, we only need to update the second hash table, where domains are referenced by their name. We will call both functions from the qemuDomainRename(). Signed-off-by: Tomas Meszaros <exo@tty.sk> --- src/conf/domain_conf.c | 35 +++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 5 +++++ src/libvirt_private.syms | 2 ++ 3 files changed, 42 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f1e02e3..7013e60 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2864,6 +2864,41 @@ virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms, return ret; } + +int +virDomainObjListRenameAddNew(virDomainObjListPtr doms, + virDomainObjPtr vm, + const char *name) +{ + int ret = -1; + virObjectLock(doms); + + /* Add new name into the hash table of domain names. */ + if (virHashAddEntry(doms->objsName, name, vm) < 0) + goto cleanup; + + /* Okay, this is crazy. virHashAddEntry() does not increment + * the refcounter of @vm, but virHashRemoveEntry() does + * decrement it. We need to work around it. */ + virObjectRef(vm); + + ret = 0; + cleanup: + virObjectUnlock(doms); + return ret; +} + + +int +virDomainObjListRenameRemove(virDomainObjListPtr doms, const char *name) +{ + virObjectLock(doms); + virHashRemoveEntry(doms->objsName, name); + virObjectUnlock(doms); + return 0; +} + + /* * Mark the running VM config as transient. Ensures transient hotplug * operations do not persist past shutdown. diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 9762c4f..1798572 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2579,6 +2579,11 @@ virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms, virDomainXMLOptionPtr xmlopt, unsigned int flags, virDomainDefPtr *oldDef); +int virDomainObjListRenameAddNew(virDomainObjListPtr doms, + virDomainObjPtr vm, + const char *name); +int virDomainObjListRenameRemove(virDomainObjListPtr doms, + const char *name); void virDomainObjAssignDef(virDomainObjPtr domain, virDomainDefPtr def, bool live, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 45f42f5..9042330 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -410,6 +410,8 @@ virDomainObjListNew; virDomainObjListNumOfDomains; virDomainObjListRemove; virDomainObjListRemoveLocked; +virDomainObjListRenameAddNew; +virDomainObjListRenameRemove; virDomainObjNew; virDomainObjParseNode; virDomainObjSetDefTransient; -- 2.1.0

This should be emitted whenever a domain is renamed. Signed-off-by: Tomas Meszaros <exo@tty.sk> --- examples/object-events/event-test.c | 4 ++++ include/libvirt/libvirt-domain.h | 2 ++ tools/virsh-domain.c | 6 ++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c index 4f17273..dcae981 100644 --- a/examples/object-events/event-test.c +++ b/examples/object-events/event-test.c @@ -108,10 +108,14 @@ static const char *eventDetailToString(int event, int detail) { ret = "Added"; else if (detail == VIR_DOMAIN_EVENT_DEFINED_UPDATED) ret = "Updated"; + else if (detail == VIR_DOMAIN_EVENT_DEFINED_RENAMED) + ret = "Renamed"; break; case VIR_DOMAIN_EVENT_UNDEFINED: if (detail == VIR_DOMAIN_EVENT_UNDEFINED_REMOVED) ret = "Removed"; + else if (detail == VIR_DOMAIN_EVENT_UNDEFINED_RENAMED) + ret = "Renamed"; break; case VIR_DOMAIN_EVENT_STARTED: switch ((virDomainEventStartedDetailType) detail) { diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index fb3ea0f..a1ea6a5 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2329,6 +2329,7 @@ typedef enum { typedef enum { VIR_DOMAIN_EVENT_DEFINED_ADDED = 0, /* Newly created config file */ VIR_DOMAIN_EVENT_DEFINED_UPDATED = 1, /* Changed config file */ + VIR_DOMAIN_EVENT_DEFINED_RENAMED = 2, /* Domain was renamed */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_DEFINED_LAST @@ -2342,6 +2343,7 @@ typedef enum { */ typedef enum { VIR_DOMAIN_EVENT_UNDEFINED_REMOVED = 0, /* Deleted the config file */ + VIR_DOMAIN_EVENT_UNDEFINED_RENAMED = 1, /* Domain was renamed */ # ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_EVENT_UNDEFINED_LAST diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index e2f5a0b..8f6d9f2 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -11785,12 +11785,14 @@ VIR_ENUM_DECL(vshDomainEventDefined) VIR_ENUM_IMPL(vshDomainEventDefined, VIR_DOMAIN_EVENT_DEFINED_LAST, N_("Added"), - N_("Updated")) + N_("Updated"), + N_("Renamed")) VIR_ENUM_DECL(vshDomainEventUndefined) VIR_ENUM_IMPL(vshDomainEventUndefined, VIR_DOMAIN_EVENT_UNDEFINED_LAST, - N_("Removed")) + N_("Removed"), + N_("Renamed")) VIR_ENUM_DECL(vshDomainEventStarted) VIR_ENUM_IMPL(vshDomainEventStarted, -- 2.1.0

Currently supports only renaming inactive domains without snapshots. Signed-off-by: Tomas Meszaros <exo@tty.sk> --- src/qemu/qemu_driver.c | 147 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2e44500..3926ccd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19871,6 +19871,152 @@ qemuDomainSetUserPassword(virDomainPtr dom, } +static int qemuDomainRename(virDomainPtr dom, + const char *new_name, + unsigned int flags) +{ + virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriverConfigPtr cfg = NULL; + virDomainObjPtr vm; + virObjectEventPtr event_new = NULL; + virObjectEventPtr event_old = NULL; + int ret = -1; + int logfile = -1; + char ebuf[1024]; + char *timestamp; + char *rename_log_msg = NULL; + char *new_dom_name = NULL; + char *old_dom_name = NULL; + char *old_dom_cfg_file = NULL; + + virCheckFlags(0, ret); + + if (VIR_STRDUP(new_dom_name, new_name) < 0) + goto cleanup; + + if (!(vm = qemuDomObjFromDomain(dom))) + goto cleanup; + + if (virDomainRenameEnsureACL(dom->conn, vm->def) < 0) + goto cleanup; + + cfg = virQEMUDriverGetConfig(driver); + + if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) + goto cleanup; + + if (virDomainObjIsActive(vm)) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot rename active domain")); + goto endjob; + } + + if (!vm->persistent) { + virReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot rename a transient domain")); + goto endjob; + } + + if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTOFF) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("domain has to be shutoff before renaming")); + goto endjob; + } + + if (virDomainSnapshotObjListNum(vm->snapshots, NULL, 0) > 0) { + virReportError(VIR_ERR_OPERATION_INVALID, + "%s", _("cannot rename domain with snapshots")); + goto endjob; + } + + if (virAsprintf(&rename_log_msg, ": domain %s has been renamed to %s\n", + vm->def->name, new_name) < 0) { + goto endjob; + } + + if (!(old_dom_cfg_file = virDomainConfigFile(cfg->configDir, + vm->def->name))) { + goto endjob; + } + + if (virDomainObjListRenameAddNew(driver->domains, vm, new_name) < 0) + goto endjob; + + if ((logfile = qemuDomainCreateLog(driver, vm, true)) < 0) + goto rollback; + + event_old = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_UNDEFINED, + VIR_DOMAIN_EVENT_UNDEFINED_RENAMED); + + /* Switch name in domain definition. */ + old_dom_name = vm->def->name; + vm->def->name = new_dom_name; + new_dom_name = NULL; + + if (virDomainSaveConfig(cfg->configDir, vm->def) < 0) + goto rollback; + + if (virFileExists(old_dom_cfg_file) && + unlink(old_dom_cfg_file) < 0) { + virReportSystemError(errno, + _("cannot remove old domain config file %s"), + old_dom_cfg_file); + goto rollback; + } + + /* Remove old domain name from table. */ + virDomainObjListRenameRemove(driver->domains, old_dom_name); + + event_new = virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_DEFINED, + VIR_DOMAIN_EVENT_DEFINED_RENAMED); + + /* Write message to the log. */ + if ((timestamp = virTimeStringNow()) != NULL) { + if (safewrite(logfile, timestamp, strlen(timestamp)) < 0 || + safewrite(logfile, rename_log_msg, + strlen(rename_log_msg)) < 0) { + VIR_WARN("Unable to write timestamp to logfile: %s", + virStrerror(errno, ebuf, sizeof(ebuf))); + } + VIR_FREE(timestamp); + } + + /* Success, domain has been renamed. */ + ret = 0; + + endjob: + qemuDomainObjEndJob(driver, vm); + + cleanup: + if (VIR_CLOSE(logfile) < 0) { + VIR_WARN("Unable to close logfile: %s", + virStrerror(errno, ebuf, sizeof(ebuf))); + } + virDomainObjEndAPI(&vm); + VIR_FREE(old_dom_cfg_file); + VIR_FREE(old_dom_name); + VIR_FREE(new_dom_name); + VIR_FREE(rename_log_msg); + if (event_old) + qemuDomainEventQueue(driver, event_old); + if (event_new) + qemuDomainEventQueue(driver, event_new); + virObjectUnref(cfg); + return ret; + + rollback: + if (old_dom_name) { + new_dom_name = vm->def->name; + vm->def->name = old_dom_name; + old_dom_name = NULL; + } + + virDomainObjListRenameRemove(driver->domains, new_name); + goto endjob; +} + static virHypervisorDriver qemuHypervisorDriver = { .name = QEMU_DRIVER_NAME, .connectOpen = qemuConnectOpen, /* 0.2.0 */ @@ -20078,6 +20224,7 @@ static virHypervisorDriver qemuHypervisorDriver = { .domainGetFSInfo = qemuDomainGetFSInfo, /* 1.2.11 */ .domainInterfaceAddresses = qemuDomainInterfaceAddresses, /* 1.2.14 */ .domainSetUserPassword = qemuDomainSetUserPassword, /* 1.2.16 */ + .domainRename = qemuDomainRename, /* 1.2.19 */ }; -- 2.1.0
participants (2)
-
Peter Krempa
-
Tomas Meszaros