[PATCH v4 2/2] test: avoid slash characters to the new domain name.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As QEMU driver, test driver does not accept slashes inside domain names.
This commit fixes this problem checking slashes inside the new name when
'domrename' is executed.

Signed-off-by: Julio Faracco <jcfaracco@xxxxxxxxx>
---
 src/test/test_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index a1888c0c9f..974369f28a 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2638,6 +2638,12 @@ testDomainRenameCallback(virDomainObjPtr privdom,
 
     virCheckFlags(0, -1);
 
+    if (strchr(new_name, '/')) {
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("name %s cannot contain '/'"), new_name);
+        return -1;
+    }
+
     if (VIR_STRDUP(new_dom_name, new_name) < 0)
         goto cleanup;
 
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux