Skip to content

Commit ad1bdb3

Browse files
committed
libvirt_vm: Skip vm startup when --noreboot is specified
Skip vm startup and session created when user add --noreboot flag Signed-off-by: Lei Yang <leiyang@redhat.com>
1 parent db0410e commit ad1bdb3

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

virttest/libvirt_vm.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,16 +2264,20 @@ def create(
22642264
)
22652265
# some other problem happened, raise normally
22662266
raise
2267-
# Wait for the domain to be created
2268-
utils_misc.wait_for(
2269-
func=self.is_alive,
2270-
timeout=60,
2271-
text=("waiting for domain %s to start" % self.name),
2272-
)
2273-
result = virsh.domuuid(self.name, uri=self.connect_uri)
2274-
self.uuid = result.stdout_text.strip()
2275-
# Create isa serial ports.
2276-
self.create_serial_console()
2267+
# Don't start VM and create console when user add --noreboot flag
2268+
if params.get("use_no_reboot") == "yes":
2269+
LOG.info("VM created with --noreboot, skipping start up")
2270+
else:
2271+
# Wait for the domain to be created
2272+
utils_misc.wait_for(
2273+
func=self.is_alive,
2274+
timeout=60,
2275+
text=("waiting for domain %s to start" % self.name),
2276+
)
2277+
result = virsh.domuuid(self.name, uri=self.connect_uri)
2278+
self.uuid = result.stdout_text.strip()
2279+
# Create isa serial ports.
2280+
self.create_serial_console()
22772281
finally:
22782282
fcntl.lockf(lockfile, fcntl.LOCK_UN)
22792283
lockfile.close()

0 commit comments

Comments
 (0)