Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 71895fb

Browse files
committed
clone: Fix cloning to existing local managed block device
1 parent e1e2b4a commit 71895fb

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

virtinst/CloneManager.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,22 @@ def setup_clone(self):
473473
xmldisk = disk
474474

475475
if clone_disk.vol_object:
476-
# XXX We could do this with vol upload I think
477-
raise RuntimeError(
478-
_("Clone onto existing storage volume is not "
479-
"supported: '%s'") % clone_disk.path)
476+
# XXX We could always do this with vol upload?
477+
478+
# Special case: non remote cloning of a guest using
479+
# managed block devices: fall back to local cloning if
480+
# we have permissions to do so. This validation check
481+
# caused a few bug reports in a short period of time,
482+
# so must be a common case.
483+
if (clone_disk.is_remote() or
484+
clone_disk.type != clone_disk.TYPE_BLOCK or
485+
not orig_disk.path or
486+
not os.access(orig_disk.path, os.R_OK) or
487+
not clone_disk.path or
488+
not os.access(clone_disk.path, os.W_OK)):
489+
raise RuntimeError(
490+
_("Clone onto existing storage volume is not "
491+
"currently supported: '%s'") % clone_disk.path)
480492

481493
# Sync 'size' between the two
482494
if orig_disk.size:

0 commit comments

Comments
 (0)