mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
clone: do not use a '/' separator when using a disk file under /
It avoids file names like //foo. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1210564 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
a22f75544e
commit
f5a13510eb
@ -29,7 +29,7 @@
|
||||
<readonly/>
|
||||
</disk>
|
||||
<disk type="file" device="disk">
|
||||
<source file="/tmp/clone2.img"/>
|
||||
<source file="/clone2.img"/>
|
||||
<target dev="sdb" bus="scsi"/>
|
||||
</disk>
|
||||
<interface type="network">
|
||||
|
@ -86,7 +86,7 @@ class TestClone(unittest.TestCase):
|
||||
|
||||
if disks is None:
|
||||
disks = ["/dev/disk-pool/disk-vol1", "/tmp/clone2.img",
|
||||
"/tmp/clone3.img", "/tmp/clone4.img",
|
||||
"/clone3", "/tmp/clone4.img",
|
||||
"/tmp/clone5.img", None]
|
||||
|
||||
cloneobj.clone_paths = disks
|
||||
@ -156,7 +156,7 @@ class TestClone(unittest.TestCase):
|
||||
base = "force"
|
||||
self._clone_helper(base,
|
||||
disks=["/dev/default-pool/1234.img",
|
||||
None, "/tmp/clone2.img"],
|
||||
None, "/clone2.img"],
|
||||
force_list=["hda", "fdb", "sdb"])
|
||||
|
||||
def testCloneStorageSkip(self):
|
||||
|
@ -236,7 +236,10 @@ class _StorageCreator(_StorageBase):
|
||||
if self.get_dev_type() == "network":
|
||||
self._path = self._vol_install.name
|
||||
else:
|
||||
self._path = (xmlobj.target_path + "/" +
|
||||
sep = "/"
|
||||
if xmlobj.target_path == "" or xmlobj.target_path[-1] == '/':
|
||||
sep = ""
|
||||
self._path = (xmlobj.target_path + sep +
|
||||
self._vol_install.name)
|
||||
return self._path
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user