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

Commit b578af5

Browse files
committed
virt-clone: Don't continuosly error if first disk prompt is bogus
1 parent ed0b7fa commit b578af5

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

tests/clitest.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import shlex
2020
import subprocess
2121
import sys
22+
import time
2223
import traceback
2324
import unittest
2425
import StringIO
@@ -1254,6 +1255,17 @@ def _launch_command(self):
12541255
proc.kill()
12551256
break
12561257

1258+
exited = False
1259+
for i in range(30):
1260+
if proc.poll() is not None:
1261+
exited = True
1262+
break
1263+
time.sleep(.1)
1264+
1265+
if not exited:
1266+
proc.kill()
1267+
out += "\nProcess was killed by test harness"
1268+
12571269
return proc.wait(), out
12581270

12591271

@@ -1310,6 +1322,14 @@ def _launch_command(self):
13101322
p6.add("use as the cloned disk", "%(NEWIMG2)s")
13111323
promptlist.append(p6)
13121324

1325+
# Basic virt-clone prompting with disk failure handling
1326+
p7 = PromptTest("virt-clone --connect %(TESTURI)s --prompt --quiet "
1327+
"--clone-running -o test-clone-simple -n test-clone-new")
1328+
p7.add("use as the cloned disk", "/root")
1329+
p7.add("'/root' must be a file or a device")
1330+
p7.add("use as the cloned disk", "%(MANAGEDNEW1)s")
1331+
promptlist.append(p7)
1332+
13131333

13141334
#########################
13151335
# Test runner functions #

virtinst/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,8 @@ def prompt_size_conflict(dev):
708708
# If we fail within the loop, reprompt for size and path
709709
if not retry_path:
710710
origpath = None
711-
origsize = None
711+
if not path_to_clone:
712+
origsize = None
712713
retry_path = False
713714

714715
# Get disk path

0 commit comments

Comments
 (0)