Change in vdsm[master]: virt: run hook before_device_create on every device

phoracek at redhat.com phoracek at redhat.com
Wed Nov 25 14:54:12 UTC 2015


Petr Horáček has uploaded a new change for review.

Change subject: virt: run hook before_device_create on every device
......................................................................

virt: run hook before_device_create on every device

Until now we applied before_device_create hooks only on devices
with attribute 'custom'. In that state were not able to update
vNic devices' XML with our OVS hook.

Now the hook is applied on every passed device's XML. That causes
performance regression.

Change-Id: I07f8be2a8ff1889b22a780ce99f5333fb6bd3405
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/49182/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f07f55e..5b9b71d 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1588,9 +1588,8 @@
                     self.log.info('Skipping device %s.', dev.device)
                     continue
 
-                if getattr(dev, "custom", {}):
-                    deviceXML = hooks.before_device_create(
-                        deviceXML, self.conf, dev.custom)
+                deviceXML = hooks.before_device_create(
+                    deviceXML, self.conf, getattr(dev, "custom", {}))
 
                 dev._deviceXML = deviceXML
                 domxml.appendDeviceXML(deviceXML)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07f8be2a8ff1889b22a780ce99f5333fb6bd3405
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list