Skip to contentSkip to conversation

guestfs: Don't abort bringup if domain is already defined

PATCH Applied Scott Mayhew 2 participants 2 messages Jan 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 guestfs: Don't abort bringup if domain is already defined

If the domain is already defined, then just start it. This is what the Vagrant bringup script does.

---
 scripts/bringup_guestfs.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/bringup_guestfs.sh +3 -2
index d529ae41..93f7afa7 100755
@@ -66,8 +66,9 @@ do
 	#
 	virsh domstate $name 1>/dev/null 2>&1
 	if [ $? -eq 0 ]; then
-		echo "Domain $name is already defined. Aborting!"
-		exit 1
+		echo "Domain $name is already defined."
+		virsh start $name
+		exit 0
 	fi
 
 	SSH_KEY_DIR="${GUESTFSDIR}/$name/ssh"
Signature · 1 line
2.41.0
Applied
#1 lore raw
Quoted 4 lines · Scott Mayhew

If the domain is already defined, then just start it. This is what the Vagrant bringup script does.

Applied, thanks!

[1/1] guestfs: Don't abort bringup if domain is already defined

      commit: 9732ca92d2c3d96e0728763c844ddf75e0dfebab

Best regards,

Signature · 1 line
Jeff Layton <[email protected]>