Re: [PATCH] details: ADD checkbox to plug/unplug network interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/17/2018 04:53 AM, Pavel Hrdina wrote:
On Thu, Aug 16, 2018 at 05:30:31PM +0200, Simon Kobyda wrote:
Hardware Details -> NIC of every VM should now contain checkbox for
interface's link state. This checkbox edits domain's XML by changing
<link state='up/down'/>. If XML doesn't contain this tag, virt manager
assumes state "up".

https://bugzilla.redhat.com/show_bug.cgi?id=1614532

Signed-off-by: Simon Kobyda <skobyda@xxxxxxxxxx>
---
  ui/details.ui          | 25 +++++++++++++++++++++++++
  virtManager/details.py | 12 +++++++++++-
  virtManager/domain.py  |  5 ++++-
  3 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/ui/details.ui b/ui/details.ui
index 88379b0e..9df12a7f 100644
--- a/ui/details.ui
+++ b/ui/details.ui
@@ -4014,6 +4014,31 @@
                                              <property name="top_attach">2</property>
                                            </packing>
                                          </child>
+                                        <child>
+                                          <object class="GtkLabel" id="network_link_state_label">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <property name="label" translatable="yes">Link state</property>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">0</property>
+                                            <property name="top_attach">3</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkCheckButton" id="network_link_state_checkbox">
+                                            <property name="label" translatable="yes">active</property>
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="receives_default">False</property>
+                                            <property name="draw_indicator">True</property>
+                                            <signal name="toggled" handler="on_network_link_state_checkbox_toggled" swapped="no"/>
+                                          </object>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="top_attach">3</property>
+                                          </packing>
+                                        </child>

The 'label' should be aligned to right and the 'checkbox' should be
aligned to left.  There was missing ':' after the label text.

We tend to enable usage of shortcuts, I'll add it before pushing.

I've also renamed ids of both object to contain '-' instead of '_'.

Congratulation on your first virt-manager commit :).


FYI the mnemonic changes were busted and broke opening the details dialog, I pushed a follow up fix.

Side note: I wish changing link state could be used for regaining VM connectivity after a virtual network is restarted. I wonder if there's a reason we can't add/remove the qemu netdev when link state changes...

- Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux