[gnome-boxes/delete-efi-guests: 5/5] libvirt-machine: Properly undefine/delete EFI guests
- From: Jordan Petridis <jpetridis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/delete-efi-guests: 5/5] libvirt-machine: Properly undefine/delete EFI guests
- Date: Sun, 16 Aug 2020 23:37:58 +0000 (UTC)
commit 1a58368d2b9f9f760a3314d77923ce58918b80fa
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Jul 31 11:05:36 2020 +0200
libvirt-machine: Properly undefine/delete EFI guests
Requires https://gitlab.com/libvirt/libvirt-glib/-/commit/fdd05bcbf
...libvirt-glib-add-gvir-domain-delete-nvram.patch | 31 ++++++++++++++++++++++
build-aux/flatpak/org.gnome.Boxes.json | 4 +++
src/libvirt-machine.vala | 3 ++-
3 files changed, 37 insertions(+), 1 deletion(-)
---
diff --git a/build-aux/flatpak/libvirt-glib-add-gvir-domain-delete-nvram.patch
b/build-aux/flatpak/libvirt-glib-add-gvir-domain-delete-nvram.patch
new file mode 100644
index 00000000..89eafc7f
--- /dev/null
+++ b/build-aux/flatpak/libvirt-glib-add-gvir-domain-delete-nvram.patch
@@ -0,0 +1,31 @@
+From fdd05bcbf2b0f037daf0b1178c0538350e4cd7b6 Mon Sep 17 00:00:00 2001
+From: Felipe Borges <felipeborges gnome org>
+Date: Wed, 25 Mar 2020 16:49:43 +0100
+Subject: [PATCH] GVirDomain: Add GVIR_DOMAIN_DELETE_{REMOVE,KEEP}_NVRAM
+
+These are mapped respectively to VIR_DOMAIN_UNDEFINE_NVRAM and
+VIR_DOMAIN_UNDEFINE_KEEP_NVRAM.
+
+Fixes issues such as https://bugzilla.redhat.com/1817031
+
+Signed-off-by: Felipe Borges <feborges redhat com>
+---
+ libvirt-gobject/libvirt-gobject-domain.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
+index 099cde3..8e55d17 100644
+--- a/libvirt-gobject/libvirt-gobject-domain.h
++++ b/libvirt-gobject/libvirt-gobject-domain.h
+@@ -104,6 +104,8 @@ typedef enum {
+ GVIR_DOMAIN_DELETE_NONE = 0,
+ GVIR_DOMAIN_DELETE_SAVED_STATE = VIR_DOMAIN_UNDEFINE_MANAGED_SAVE,
+ GVIR_DOMAIN_DELETE_SNAPSHOTS_METADATA = VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA,
++ GVIR_DOMAIN_DELETE_REMOVE_NVRAM = VIR_DOMAIN_UNDEFINE_NVRAM,
++ GVIR_DOMAIN_DELETE_KEEP_NVRAM = VIR_DOMAIN_UNDEFINE_KEEP_NVRAM,
+ } GVirDomainDeleteFlags;
+
+ /**
+--
+2.26.2
+
diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
index e8244e4b..8b53caed 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -183,6 +183,10 @@
"type" : "archive",
"url" : "https://libvirt.org/sources/glib/libvirt-glib-3.0.0.tar.gz",
"sha256" : "7fff8ca9a2b723dbfd04223b1c7624251c8bf79eb57ec27362a7301b2dd9ebfe"
+ },
+ {
+ "type" : "patch",
+ "path" : "libvirt-glib-add-gvir-domain-delete-nvram.patch"
}
]
},
diff --git a/src/libvirt-machine.vala b/src/libvirt-machine.vala
index 8fe653ff..418814b3 100644
--- a/src/libvirt-machine.vala
+++ b/src/libvirt-machine.vala
@@ -516,7 +516,8 @@ public override void delete (bool by_user = true) {
try {
// This undefines the domain, causing it to be transient if it was running
domain.delete (DomainDeleteFlags.SAVED_STATE |
- DomainDeleteFlags.SNAPSHOTS_METADATA);
+ DomainDeleteFlags.SNAPSHOTS_METADATA |
+ DomainDeleteFlags.REMOVE_NVRAM);
} catch (GLib.Error err) {
warning (err.message);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]