<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 07/28/2016 03:54 PM, Socorro wrote:<br>
    </div>
    <blockquote
      cite="mid:9d00a34c-c09c-3e45-99d7-a90f0ac443a9@linux.vnet.ibm.com"
      type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <p>JFYI....in testing the UI PCI patch from before, I had also
        encountered the Unknown Parameter error when clicking on the
        Filter dropdown.<br>
      </p>
    </blockquote>
    <br>
    Yeah, as I've said, one of the errors was already there. My point is
    that we<br>
    can't add a new one :)<br>
    <br>
    <blockquote
      cite="mid:9d00a34c-c09c-3e45-99d7-a90f0ac443a9@linux.vnet.ibm.com"
      type="cite">
      <p> </p>
      <br>
      <div class="moz-cite-prefix">On 07/28/2016 11:41 AM, Daniel
        Henrique Barboza wrote:<br>
      </div>
      <blockquote
        cite="mid:000e011e-86cd-ff6f-2624-ade7dc5c49e4@gmail.com"
        type="cite">
        <meta content="text/html; charset=windows-1252"
          http-equiv="Content-Type">
        I'll send my feedback here but consider that it belongs to all<br>
        the 3 passthrough related patches you've sent.<br>
        <br>
        Testing in my TP, with your patches, I had one extra error<br>
        when switching to the 'To Add' filter. In current master I have<br>
        the following error:<br>
        <br>
        <img src="cid:part1.7EDC63A3.491D39B5@linux.vnet.ibm.com" alt=""><br>
        <br>
        With your patch:<br>
        <br>
        <img src="cid:part2.AAA06117.A889F33B@linux.vnet.ibm.com" alt=""><br>
        <br>
        There's an extra error 'Node device undefined not found'. <br>
        <br>
        Ideally you could get rid of all the errors in this window but
        at the<br>
        very least we can't increase them.<br>
        <br>
        <br>
        <div class="moz-cite-prefix">On 07/27/2016 11:00 PM, Jose
          Ricardo Ziviani wrote:<br>
        </div>
        <blockquote
          cite="mid:1469671229-9532-1-git-send-email-joserz@linux.vnet.ibm.com"
          type="cite">
          <pre wrap=""> - In order to validade if a given PCI is ok to be attached, a heavy
   verification has to be done. This commit add such verification
   in the task. This will give a faster response to the UI,
   improving the user experience.

Signed-off-by: Jose Ricardo Ziviani <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:joserz@linux.vnet.ibm.com">&lt;joserz@linux.vnet.ibm.com&gt;</a>
---
 model/vmhostdevs.py                 | 22 ++++++++++++++++-
 ui/js/src/kimchi.guest_edit_main.js | 47 ++++++++++++++++++++-----------------
 2 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/model/vmhostdevs.py b/model/vmhostdevs.py
index 15b5bec..ef39de3 100644
--- a/model/vmhostdevs.py
+++ b/model/vmhostdevs.py
@@ -89,7 +89,6 @@ class VMHostDevsModel(object):

     def create(self, vmid, params):
         dev_name = params['name']
-        self._passthrough_device_validate(dev_name)
         dev_info = self.dev_model.lookup(dev_name)

         if dev_info['device_type'] == 'pci':
@@ -216,6 +215,13 @@ class VMHostDevsModel(object):
         dev_info = params['dev_info']
         lock = params['lock']

+        try:
+            self._passthrough_device_validate(dev_info['name'])
+
+        except InvalidParameter as e:
+            cb(e.message, False)
+            raise
+
         with lock:
             try:
                 self._validate_pci_passthrough_env()
@@ -455,6 +461,13 @@ class VMHostDevsModel(object):
         dev_info = params['dev_info']
         lock = params['lock']

+        try:
+            self._passthrough_device_validate(dev_info['name'])
+
+        except InvalidParameter as e:
+            cb(e.message, False)
+            raise
+
         with lock:
             dom = VMModel.get_vm(vmid, self.conn)

@@ -501,6 +514,13 @@ class VMHostDevsModel(object):
         dom = VMModel.get_vm(vmid, self.conn)
         lock = params['lock']

+        try:
+            self._passthrough_device_validate(dev_info['name'])
+
+        except InvalidParameter as e:
+            cb(e.message, False)
+            raise
+
         with lock:
             with RollbackContext() as rollback:
                 xmlstr = self._get_usb_device_xml(dev_info)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 507ae75..5d91b14 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -546,9 +546,11 @@ kimchi.guest_edit_main = function() {
                     wok.message.error(err.responseJSON.reason, '#alert-modal-container');
                 });
             } else {
+                $('html').addClass('in-progress');
+                $('#form-guest-edit-pci &gt; .wok-mask').show();
+                var haveCompanions = false;
+                var pciTitle = i18n['KCHVMED6007M'] + '\n';
                 kimchi.getPCIDeviceCompanions(id, function(infoData) {
-                    var pciTitle = i18n['KCHVMED6007M'] + '\n';
-                    var haveCompanions = false;
                     for (var p = 0; p &lt; infoData.length; p++) {
                         if (infoData[p].device_type === 'net') {
                             haveCompanions = true;
@@ -564,24 +566,19 @@ kimchi.guest_edit_main = function() {
                             pciTitle += ', ' + i18n['KCHVMED6006M'] + ' ' + infoData[p].model + '\n';
                         }
                     }
-                    var settings = {
-                        title: i18n['KCHVMED6012M'],
-                        content: pciTitle,
-                        confirm: i18n['KCHAPI6002M'],
-                        cancel: i18n['KCHAPI6003M']
-                    };
+                });
+                $('#form-guest-edit-pci &gt; .wok-mask').fadeOut(300, function() {});
+                $('html').removeClass('in-progress');

-                    if (haveCompanions) {
-                        wok.confirm(settings, function() {
-                            kimchi.addVMPCIDevice(kimchi.selectedGuest, {
-                                name: id
-                            }, function(task) {
-                                getOngoingAttachingDevices(task);
-                            }, function(err) {
-                                wok.message.error(err.responseJSON.reason, '#alert-modal-container');
-                            });
-                        });
-                    } else {
+                var settings = {
+                    title: i18n['KCHVMED6012M'],
+                    content: pciTitle,
+                    confirm: i18n['KCHAPI6002M'],
+                    cancel: i18n['KCHAPI6003M']
+                };
+
+                if (haveCompanions) {
+                    wok.confirm(settings, function() {
                         kimchi.addVMPCIDevice(kimchi.selectedGuest, {
                             name: id
                         }, function(task) {
@@ -589,8 +586,16 @@ kimchi.guest_edit_main = function() {
                         }, function(err) {
                             wok.message.error(err.responseJSON.reason, '#alert-modal-container');
                         });
-                    }
-                });
+                    });
+                } else {
+                    kimchi.addVMPCIDevice(kimchi.selectedGuest, {
+                        name: id
+                    }, function(task) {
+                        getOngoingAttachingDevices(task);
+                    }, function(err) {
+                        wok.message.error(err.responseJSON.reason, '#alert-modal-container');
+                    });
+                }
             }
         });
     };
</pre>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>