diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-12-07 09:35:39 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-12-07 09:35:39 +0100 |
commit | f7b51680b96ed01f681eeec9e487347b31682de0 (patch) | |
tree | 90b386ad07ef4d465666e80a363bf1dc81f72b3d | |
parent | d33191174efce46b7c4be190a93637dc314a5139 (diff) | |
download | vconsole-master.tar.gz |
-rw-r--r-- | domain.c | 7 | ||||
-rw-r--r-- | main.ui | 9 | ||||
-rw-r--r-- | vconsole.c | 18 | ||||
-rw-r--r-- | vconsole.h | 2 |
4 files changed, 31 insertions, 5 deletions
@@ -249,7 +249,7 @@ static void domain_user_input(VteTerminal *vte, gchar *buf, guint len, virStreamSend(dom->stream, buf, len); return; } - domain_start(dom); + domain_start(dom, false); } static void domain_connect(struct vconsole_domain *dom, virDomainPtr d) @@ -433,11 +433,14 @@ void domain_untabify(struct vconsole_domain *dom) gtk_widget_show_all(dom->window); } -void domain_start(struct vconsole_domain *dom) +void domain_start(struct vconsole_domain *dom, bool reset_nvram) { virDomainPtr d = virDomainLookupByUUIDString(dom->conn->ptr, dom->uuid); uint32_t flags = 0; + if (reset_nvram) + flags |= VIR_DOMAIN_START_RESET_NVRAM; + domain_update_info(dom, d); switch (dom->info.state) { case VIR_DOMAIN_SHUTOFF: @@ -216,6 +216,15 @@ </child> <child> <object class="GtkImageMenuItem"> + <property name="label" translatable="yes">Run with NVRAM reset</property> + <property name="can-focus">False</property> + <property name="action-name">main.GuestRunResetNvram</property> + <property name="use-underline">True</property> + <property name="use-stock">False</property> + </object> + </child> + <child> + <object class="GtkImageMenuItem"> <property name="label" translatable="yes">_Pause</property> <property name="can-focus">False</property> <property name="action-name">main.GuestPause</property> @@ -505,7 +505,18 @@ static void menu_cb_vm_run(GSimpleAction *action, struct vconsole_domain *dom = find_guest(win); if (dom) - domain_start(dom); + domain_start(dom, false); +} + +static void menu_cb_vm_run_reset_nvram(GSimpleAction *action, + GVariant *parameter, + gpointer data) +{ + struct vconsole_window *win = data; + struct vconsole_domain *dom = find_guest(win); + + if (dom) + domain_start(dom, true); } static void menu_cb_vm_run_gfx(GSimpleAction *action, @@ -517,7 +528,7 @@ static void menu_cb_vm_run_gfx(GSimpleAction *action, if (dom) { run_virt_viewer(dom, false); - domain_start(dom); + domain_start(dom, false); } } @@ -694,6 +705,9 @@ static const GActionEntry entries[] = { .name = "GuestRun", .activate = menu_cb_vm_run, },{ + .name = "GuestRunResetNvram", + .activate = menu_cb_vm_run_reset_nvram, + },{ .name = "GuestRunGfx", .activate = menu_cb_vm_run_gfx, },{ @@ -126,7 +126,7 @@ struct vconsole_domain { void domain_untabify(struct vconsole_domain *dom); -void domain_start(struct vconsole_domain *dom); +void domain_start(struct vconsole_domain *dom, bool reset_nvram); void domain_pause(struct vconsole_domain *dom); void domain_save(struct vconsole_domain *dom); void domain_reboot(struct vconsole_domain *dom); |