[libvirt] [PATCH] qemuDomainRename: Report error if adding domain to domainObj list fails

Martin Kletzander mkletzan at redhat.com
Mon Aug 17 21:27:57 UTC 2015


On Fri, Aug 14, 2015 at 03:40:16PM +0200, Michal Privoznik wrote:
>So, domain renaming works like this: new domain name is added
>into the list of domain objects. Then, domain definition is
>updated. After that, old domain name is removed from the domain
>object list. Now, if the very firs step fails for some reason, no
>error is reported:
>
>virsh # domrename dummy dummy
>error: An error occurred, but the cause is unknown
>

ACK series.

>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_driver.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>index 3683591..8e365bd 100644
>--- a/src/qemu/qemu_driver.c
>+++ b/src/qemu/qemu_driver.c
>@@ -19950,8 +19950,11 @@ static int qemuDomainRename(virDomainPtr dom,
>         goto endjob;
>     }
>
>-    if (virDomainObjListRenameAddNew(driver->domains, vm, new_name) < 0)
>+    if (virDomainObjListRenameAddNew(driver->domains, vm, new_name) < 0) {
>+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
>+                       _("could not add new name into internal list of domains"));
>         goto endjob;
>+    }
>
>     if ((logfile = qemuDomainCreateLog(driver, vm, true)) < 0)
>         goto rollback;
>--
>2.4.6
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150817/a770e4c1/attachment-0001.sig>


More information about the libvir-list mailing list