From: Julio Faracco Date: Tue, 1 May 2018 15:56:08 +0000 (-0300) Subject: qemu: avoid slash characters to the new domain name. X-Git-Tag: v4.4.0-rc1~355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e1a9702194eab22cb7b5fb34bd84fc47800223d;p=thirdparty%2Flibvirt.git qemu: avoid slash characters to the new domain name. 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. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1333232 Signed-off-by: Julio Faracco Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ef11e3cc44..9ce97eaa1d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20765,6 +20765,12 @@ qemuDomainRenameCallback(virDomainObjPtr vm, virCheckFlags(0, ret); + if (strchr(new_name, '/')) { + virReportError(VIR_ERR_XML_ERROR, + _("name %s cannot contain '/'"), new_name); + return -1; + } + cfg = virQEMUDriverGetConfig(driver); if (VIR_STRDUP(new_dom_name, new_name) < 0)