[gnome-boxes/delete-efi-guests: 11/11] libvirt-machine: Properly undefine/delete EFI guests
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/delete-efi-guests: 11/11] libvirt-machine: Properly undefine/delete EFI guests
- Date: Tue, 11 Aug 2020 11:24:08 +0000 (UTC)
commit 878e059d5c77fbff246b78afb7faca869b79b080
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 d79dd82b..8aa2cfac 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -187,6 +187,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]