<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2/3/22 21:42, Cole Robinson wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:002fa1a1-a15a-91c5-a0ee-bbe6eb1576e0@redhat.com">
      <pre class="moz-quote-pre" wrap="">On 2/1/22 8:43 AM, Shalini Chellathurai Saroja wrote:
</pre>
      <blockquote type="cite" style="color: #007cff;">
        <pre class="moz-quote-pre" wrap="">With virt-manager application, it is possible to add inactive node
devices(eg: mediated device) in host system to guest system. But it is
impossible to start a guest system with inactive node devices.  Also,
it is not yet possible to start a node device with virt-manager
application. So, the user cannot use the inactive node devices.

This patch disables the "finish" button and provides a tip, when
inactive node devices are selected. So, it is not possible to add
inactive node devices to the guest system.

Signed-off-by: Shalini Chellathurai Saroja <a class="moz-txt-link-rfc2396E" href="mailto:shalini@linux.ibm.com" moz-do-not-send="true"><shalini@linux.ibm.com></a>
Reviewed-by: Boris Fiuczynski <a class="moz-txt-link-rfc2396E" href="mailto:fiuczy@linux.ibm.com" moz-do-not-send="true"><fiuczy@linux.ibm.com></a>
---
 virtManager/addhardware.py | 42 +++++++++++++++++++++++++++++++++++---
 1 file changed, 39 insertions(+), 3 deletions(-)

</pre>
      </blockquote>
      [...Snip...]<br>
      <blockquote type="cite" style="color: #007cff;">
        <pre class="moz-quote-pre" wrap="">+        if hostdev[1] is None:
+            self.widget("create-finish").set_sensitive(False)
+            self.widget("create-finish").set_tooltip_text()
+        elif hostdev[2]:
+            self.widget("create-finish").set_sensitive(True)
+            self.widget("create-finish").set_tooltip_text()
+        else:
+            tooltip = (_("%s is not active in the host system.\n"
+            "Please start the mdev in the host system before adding it to the guest.")
+            % hostdev[1])
+            self.widget("create-finish").set_sensitive(False)
+            self.widget("create-finish").set_tooltip_text(tooltip)
+
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">I prefer if there's only a single set_sensitive and set_tooltip_text
call. The state is basically

tooltip = None
sensitive = row[2]
if row[1] and sensitive is False:
    tooltip = ...
set_tooltip_text(tooltip)
set_sensitive(sensitive)

</pre>
    </blockquote>
    <p>Hello Cole,</p>
    <p>Thank you very much for your comments. <br>
    </p>
    <p>I have implemented all of your comments and have sent v4 of the
      patch.I only did a minor change</p>
    <p> to the above comment, I used the below code to avoid providing a
      tool tip when no devices are available.<br>
    </p>
    <pre class="moz-quote-pre" wrap="">if row[0] and sensitive is False: # instead of row[1]

</pre>
    <pre class="moz-signature" cols="72">-- 
Kind regards
Shalini Chellathurai Saroja
Linux on Z and Virtualization Development
Vorsitzende des Aufsichtsrats: Gregor Pillen
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294</pre>
  </body>
</html>