[gnome-boxes/wip/snapshot-config-changes: 3/6] machine-config-editor: Reuse existing GVirConfig.Domain instance
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/snapshot-config-changes: 3/6] machine-config-editor: Reuse existing GVirConfig.Domain instance
- Date: Fri, 9 Oct 2020 12:38:26 +0000 (UTC)
commit 3c9bd08f5a3d4fe97e501db0c221eeea75d7aceb
Author: Felipe Borges <felipeborges gnome org>
Date: Fri Oct 9 12:00:23 2020 +0200
machine-config-editor: Reuse existing GVirConfig.Domain instance
src/config-editor.vala | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/src/config-editor.vala b/src/config-editor.vala
index d85d2bf6..8346bbb9 100644
--- a/src/config-editor.vala
+++ b/src/config-editor.vala
@@ -20,24 +20,11 @@ public void setup (LibvirtMachine machine) {
buffer.language = Gtk.SourceLanguageManager.get_default ().get_language ("xml");
view.buffer = buffer;
- try {
- var config = machine.domain.get_config (GVir.DomainXMLFlags.NONE);
- buffer.set_text (config.to_xml ());
- } catch (GLib.Error error) {
- warning ("Failed to load machine configuration: %s", error.message);
- }
+ buffer.set_text (machine.domain_config.to_xml ());
}
public async void save () {
- GVirConfig.Domain? config = null;
- try {
- config = machine.domain.get_config (GVir.DomainXMLFlags.NONE);
- } catch (GLib.Error error) {
- warning ("Failed to load machine configuration: %s", error.message);
- return;
- }
-
- var saved = yield save_original_config (config);
+ var saved = yield save_original_config (machine.domain_config);
if (!saved) {
var failed_to_save_msg = _("Unable to backup original configuration. Aborting.");
App.app.main_window.notificationbar.display_error (failed_to_save_msg);
@@ -46,7 +33,7 @@ public async void save () {
}
var xml = view.buffer.text;
- if (config.to_xml () == xml) {
+ if (machine.domain_config.to_xml () == xml) {
debug ("Nothing changed in the VM configuration");
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]