From nobody Mon May 13 14:42:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1645622023; cv=none; d=zohomail.com; s=zohoarc; b=nhBS32o08wD+XXiJNWiiH3agQJ5hDPrqYaL1+8dYzkDxO7zO0RiOyjjwprevVWQBwseZiztpOsW8fHCLh/g52bomArzmKM/VZ/LRhqBspC+Vh4sOlXZChrI0qryJNMhVESOw0ySw+sD3os0NWq60l2GOuWTDmpkNdEZv73aOrx8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645622023; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JfGo2Jg7W3GN7Us138a1CG9iMlWvwv3/nXdGUSczat4=; b=EjqDhPx02Dib49kCqwppGM1xln9aURMHCBO7bTUvOY9QGoVWLqencIdhU1BH6pglQ6NVQEpnQ04sWc/W1Ev6fZfGg9WaUJgMg+rMhWBd5Pltsoav24UKnWosxx3qLQ7leNscN7+FOjzxXoGeLwhtUVftnq28+rG9fZFf/AnsR+4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645622023022847.017837866849; Wed, 23 Feb 2022 05:13:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-3anxJen1OCOml8svqZ_6ew-1; Wed, 23 Feb 2022 08:13:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5364480D6AF; Wed, 23 Feb 2022 13:13:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 070CF7C0C4; Wed, 23 Feb 2022 13:13:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2CBF144A5E; Wed, 23 Feb 2022 13:13:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21ND1moD025136 for ; Wed, 23 Feb 2022 08:01:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id ED98A84940; Wed, 23 Feb 2022 13:01:48 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.39.195.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42CE984964; Wed, 23 Feb 2022 13:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645622022; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JfGo2Jg7W3GN7Us138a1CG9iMlWvwv3/nXdGUSczat4=; b=g2SPtyQCYUWK9E4BUuz1l8Nze5pxtjLoECD76B1+XffDPqnKCuhq5oZCuU6+m54ESnOQmk 0AVcT0YT6aMXUXq/9gqOZNpJZjDCtGk+BudrX3MYESSSxkkhQxejW+hPFM4PJ6I/7lQozo RCzYWVQiDFjF6dnhGnlDY6dii8FmEog= X-MC-Unique: 3anxJen1OCOml8svqZ_6ew-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [PATCH] qemu: honour user's nvram path when undefining VM Date: Wed, 23 Feb 2022 13:01:30 +0000 Message-Id: <20220223130130.2084998-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1645622024567100001 When undefining a VM, we must optionally delete any NVRAM that might exist. When using firmware auto-select we always check the generated path, ignoring any user specified path. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e417d358cd..b74b0375a7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6615,11 +6615,10 @@ qemuDomainUndefineFlags(virDomainPtr dom, } } =20 - if (vm->def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI) { + if (vm->def->os.loader->nvram) { + nvram_path =3D g_strdup(vm->def->os.loader->nvram); + } else if (vm->def->os.firmware =3D=3D VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)= { qemuDomainNVRAMPathFormat(cfg, vm->def, &nvram_path); - } else { - if (vm->def->os.loader) - nvram_path =3D g_strdup(vm->def->os.loader->nvram); } =20 if (nvram_path && virFileExists(nvram_path)) { --=20 2.34.1