From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8D7321272CC for ; Tue, 5 Mar 2024 20:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709670208; cv=none; b=qC+FhKxFkyo+4mw/ro0I0bLg7RWatHMxpvyj1j68Sd7Wt8Har3mrLhA8WzgehOZc1c3CnHqVEkel9mxA79A5DtB6QN6R1XqxSO6ic6KsQK2Qq3HNI3bIRCamBLY6otAfFcvAV0FfF6VT2hRGqPbAKKbFGohIbDdypXh5SBb/k3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709670208; c=relaxed/simple; bh=c59BZMzfT+I3NZcjbobDmDdxDdsxE7VTpIHWInvOT4c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A/Cd96K5zppVvH8yF893NlQVBq7b2+yWf+BBUhRQSGjX1A+B1vjvSeGumeQc9eKTOfDE15OaPZ2P+juhvQBVpycRG5oLgWniiYIyCh5YBg2fiYI1YKyxr+XfAMkaHG6VGjhuVFIuv5FEmljemOFKsehhrK74w7iWIyIzTs8mxAE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=PwgdvpbT; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="PwgdvpbT" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=E8yEwp7RXB78SyqnDaqd1M59sI72KVM+QuWhgcrlKAI=; b=PwgdvpbTs5+O60+XJ7T0p82KCw /zWhFmg4FZerZrUJeBnrzKvirXWHoLBU0ntzyG7t8jVthI4Ka24mXZkXfUOzIQHX3WEBiYwSF7Szm ELK9B6VSRIImlnWA/1eApQJd9DKMMtWyIhpunu9rAqaxscMQwWqjLypbUC7yiR3veyJTKrnnCb/uk GML+CmFlcX0XRrGq9gYbyXfH2hJ2Tk3D6po2KUHpryTvu0VyAAmaZEL78Y6/QEfY5OAyTf6UDEf8w wm91MHMgT1POHHgrwofQdo1qusWrecthLVoOzONT1RNILUCut/HJJU7CvfQ2HaClA8YPA3/ACe1// upOoAEIg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhbJu-0000000FBHd-0jDk; Tue, 05 Mar 2024 20:23:26 +0000 Date: Tue, 5 Mar 2024 12:23:26 -0800 From: Luis Chamberlain To: Chuck Lever Cc: kdevops@lists.linux.dev Subject: Re: [PATCH 2/4] guestfs: Enable destruction of guests with NVRAM Message-ID: References: <170965631153.2147115.16516176636315502267.stgit@renoir.1015granger.net> <170965658655.2147115.14851979339193217566.stgit@renoir.1015granger.net> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170965658655.2147115.14851979339193217566.stgit@renoir.1015granger.net> Sender: Luis Chamberlain On Tue, Mar 05, 2024 at 11:36:26AM -0500, Chuck Lever wrote: > From: Chuck Lever > > The default guest configuration on ARM systems includes a virtual > NVRAM device. However, "virsh undefine" won't touch such guests > without an explicit command-line option that enables destruction of > that device and its contents. > > Note that virsh(1) says: > > > --nvram and --keep-nvram specify accordingly to delete or keep > > nvram (/domain/os/nvram/) file. > > Although adding this option to "virsh undefine" prevents an error > and allows the "undefine" to continue to completion, it does not > seem to actually delete the virtual NVRAM device's backing file on > my system. > > Signed-off-by: Chuck Lever > --- > scripts/destroy_guestfs.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/destroy_guestfs.sh b/scripts/destroy_guestfs.sh > index 125890dc34dc..9c627f231cc7 100755 > --- a/scripts/destroy_guestfs.sh > +++ b/scripts/destroy_guestfs.sh > @@ -19,7 +19,7 @@ if [ -f "$GUESTFSDIR/kdevops_nodes.yaml" ]; then > if [ "$domstate" = 'running' ]; then > virsh destroy $name > fi > - virsh undefine $name > + virsh undefine --nvram $name Do we want to add: UNDEFINE_EXTRA="" UNDEFINE_EXTRA_CMD="true" if [[ "$CONFIG_LIBVIRT_MACHINE_TYPE_VIRT" == "y" ]]; then UNDEFINE_EXTRA="--nvram" UNDEFINE_EXTRA_CMD="rm -f nvram/foo" fi virsh undefine $UNDEFINE_EXTRA $name $UNDEFINE_EXTRA_CMD So we should nuke the nvram file, that can be done by augmenting the KDEVOPS_MRPROPER += with the nvram file on the Makefile for libguest. Luis