[libvirt] [PATCH v2] qemu: avoid slash characters to the new domain name.

Julio Faracco jcfaracco at gmail.com
Mon Apr 23 03:27:40 UTC 2018


The 'domrename' command needs to check if the new domain name contains
the slash character. This character is not accepted by libvirt XML
definition because it is an invalid char (see Cole's commit b1fc6a7b7).
This commit enhace the 'domrename' command adding this check. The method
virDomainDefPostParse() was the other methods to check the domain are
not accessible.

Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
---
 src/qemu/qemu_driver.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 5673d9fd8..9b16bc9c9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20773,6 +20773,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
     vm->def->name = new_dom_name;
     new_dom_name = NULL;
 
+    if (virDomainDefPostParse(vm->def, driver->caps, 0, driver->xmlopt, NULL) < 0)
+        goto rollback;
+
     if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0)
         goto rollback;
 
-- 
2.14.1




More information about the libvir-list mailing list