1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-27 18:03:50 +03:00

Forbid new-line char in name of new storagepool

New line character in name of storagepool is now forbidden because it
mess virsh output and can be confusing for users.
Validation of name is done in driver, after parsing XML to avoid
problems with dissappeared pools which was already created with
new-line char in name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Sławek Kapłoński 2016-11-11 10:17:38 +01:00 committed by Michal Privoznik
parent 6c98ac2c62
commit ae381879f3
2 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,8 @@
<ul>
<li>vz: Fix migration in P2P mode
</li>
<li>Forbid newline character in names of some libvirt objects.
</li>
</ul>
</li>
</ul>

View File

@ -780,6 +780,9 @@ storagePoolDefineXML(virConnectPtr conn,
if (!(def = virStoragePoolDefParseString(xml)))
goto cleanup;
if (virXMLCheckIllegalChars("name", def->name, "\n") < 0)
goto cleanup;
if (virStoragePoolDefineXMLEnsureACL(conn, def) < 0)
goto cleanup;