Change in vdsm[master]: virt: Trigger event on guest agent status changes

fromani at redhat.com fromani at redhat.com
Mon Jun 15 11:15:54 UTC 2015


Francesco Romani has posted comments on this change.

Change subject: virt: Trigger event on guest agent status changes
......................................................................


Patch Set 20: Code-Review-1

(4 comments)

minor comments inside, please have a look. -1 for visibility.
I'm not really confident this is the right direction, this code seems to lean toward complexity. But
- no better ideas
- if Vinzenz's OK, I'm OK as well
- I'm too late to this party.

https://gerrit.ovirt.org/#/c/41108/20/tests/vmTests.py
File tests/vmTests.py:

Line 472:     @MonkeyPatch(constants, 'SMBIOS_OSNAME', 'oVirt Node')
Line 473:     @MonkeyPatch(libvirtconnection, 'get', fake.Connection)
Line 474:     @MonkeyPatch(utils, 'getHostUUID',
Line 475:                  lambda: "fc25cbbe-5520-4f83-b82e-1541914753d9")
Line 476:     @MonkeyPatch(vm.Vm, 'send_status_event', lambda x: None)
see comments in vmfakelib.py
Line 477:     def testBuildCmdLineX86_64(self):
Line 478:         self.assertBuildCmdLine(CONF_TO_DOMXML_X86_64)
Line 479: 
Line 480:     @MonkeyPatch(caps, 'getTargetArch', lambda: caps.Architecture.PPC64)


Line 482:         'release': '1', 'version': '18', 'name': 'Fedora'})
Line 483:     @MonkeyPatch(libvirtconnection, 'get', fake.Connection)
Line 484:     @MonkeyPatch(utils, 'getHostUUID',
Line 485:                  lambda: "fc25cbbe-5520-4f83-b82e-1541914753d9")
Line 486:     @MonkeyPatch(vm.Vm, 'send_status_event', lambda x: None)
same
Line 487:     def testBuildCmdLinePPC64(self):
Line 488:         self.assertBuildCmdLine(CONF_TO_DOMXML_PPC64)
Line 489: 
Line 490:     def testGetVmPolicySucceded(self):


https://gerrit.ovirt.org/#/c/41108/20/tests/vmfakelib.py
File tests/vmfakelib.py:

Line 289:        cif=None, create_device_objects=False):
Line 290:     with namedTemporaryDir() as tmpDir:
Line 291:         with MonkeyPatchScope([(constants, 'P_VDSM_RUN', tmpDir + '/'),
Line 292:                                (libvirtconnection, 'get', Connection),
Line 293:                                (vm.Vm, 'send_status_event', lambda x: None)]):
why do we need this? bad rebase?
Line 294:             vmParams = {'vmId': 'TESTING'}
Line 295:             vmParams.update({} if params is None else params)
Line 296:             cif = ClientIF() if cif is None else cif
Line 297:             fake = vm.Vm(cif, vmParams)


https://gerrit.ovirt.org/#/c/41108/20/vdsm/virt/guestagent.py
File vdsm/virt/guestagent.py:

Line 139: 
Line 140:     @guestStatus.setter
Line 141:     def guestStatus(self, value):
Line 142:         oldValue = self._status
Line 143:         self._status = value
maybe 

  oldValue, self.status = self.status, value

is more idiomatic? your call, I'm OK both ways
Line 144:         if oldValue != value and self._onStatusChange:
Line 145:             self._onStatusChange()
Line 146: 
Line 147:     @property


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaceca8e42720df50d5eb1e20670b6ed733db8b50
Gerrit-PatchSet: 20
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list