Change in vdsm[ovirt-3.6]: vm: do not log known missing alias

fromani at redhat.com fromani at redhat.com
Tue Aug 18 11:51:50 UTC 2015


Hello Vinzenz Feenstra, Dan Kenigsberg, Martin Polednik,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/45018

to review the following change.

Change subject: vm: do not log known missing alias
......................................................................

vm: do not log known missing alias

Libvirt will not give back aliases for some devices, e.g.
graphic devices.
Avoid to worry the user and mislead troubleshooting with
error logs in those, well known and usually harmless cases.

X-Backport-To: 3.6
Change-Id: I63bc6d8f4b6fed52ee0af12f129007a1044d413b
Related-To: https://bugzilla.redhat.com/1248788
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/44669
Reviewed-by: Vinzenz Feenstra <vfeenstr at redhat.com>
Reviewed-by: Martin Polednik <mpolednik at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Continuous-Integration: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/virt/vm.py
M vdsm/virt/vmdevices/hwclass.py
2 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/45018/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0eff29a..3beca6b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4479,6 +4479,10 @@
             for dev in self._devices[devType]:
                 if hasattr(dev, 'alias'):
                     aliasToDevice[dev.alias] = dev
+                elif devType == hwclass.WITHOUT_ALIAS:
+                    # we expect these failures, we don't log
+                    # to not confuse the user
+                    pass
                 else:
                     self.log.error("Alias not found for device type %s "
                                    "during migration at destination host" %
diff --git a/vdsm/virt/vmdevices/hwclass.py b/vdsm/virt/vmdevices/hwclass.py
index d44f0bc..fef5439 100644
--- a/vdsm/virt/vmdevices/hwclass.py
+++ b/vdsm/virt/vmdevices/hwclass.py
@@ -35,3 +35,7 @@
 TPM = 'tpm'
 HOSTDEV = 'hostdev'
 MEMORY = 'memory'
+
+
+# libvirt is not giving back aliases
+WITHOUT_ALIAS = GRAPHICS


-- 
To view, visit https://gerrit.ovirt.org/45018
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I63bc6d8f4b6fed52ee0af12f129007a1044d413b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>


More information about the vdsm-patches mailing list