Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E8FC288CE for ; Thu, 4 Jan 2024 17:47:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="NH6s30wA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704390471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2hRCTH0t6clz6FKqIqutuisrbLvPz7mPhyaIQ/xO8kA=; b=NH6s30wAdwQkjrMM7Hyd55JfRMrz7eMqEJH17Cn3MvuDqlgr8XCsORLpgOUpp4TBShLl+c eYB9IIFXDuZ9KHA3j75/foiTRFjAfP7E+KmVW6fsMo1Jh2EFUSqudH2BMlPjN0MwdywdO/ A9C0jwmJX2xZVj4KrPST71sXk/wnlW0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-357-DU4TPvioO92sfwExVOdc8w-1; Thu, 04 Jan 2024 12:47:50 -0500 X-MC-Unique: DU4TPvioO92sfwExVOdc8w-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1A5783DE82; Thu, 4 Jan 2024 17:47:49 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.32.219]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1908492BC8; Thu, 4 Jan 2024 17:47:49 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id 57AB611464C; Thu, 4 Jan 2024 12:47:49 -0500 (EST) From: Scott Mayhew To: kdevops@lists.linux.dev Cc: jlayton@kernel.org Subject: [PATCH] guestfs: Don't abort bringup if domain is already defined Date: Thu, 4 Jan 2024 12:47:49 -0500 Message-ID: <20240104174749.101272-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true If the domain is already defined, then just start it. This is what the Vagrant bringup script does. Signed-off-by: Scott Mayhew --- scripts/bringup_guestfs.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index d529ae41..93f7afa7 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -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" -- 2.41.0