Change in vdsm[master]: vm: Libvirt quering after disk detach operation addition.

nsoffer at redhat.com nsoffer at redhat.com
Thu Aug 20 15:36:03 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: vm: Libvirt quering after disk detach operation addition.
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.ovirt.org/#/c/45138/1//COMMIT_MSG
Commit Message:

Line 6: 
Line 7: vm: Libvirt quering after disk detach operation addition.
Line 8: 
Line 9: As stated in libvirt documentary, after detaching a device using the API
Line 10: we need to verify that this device has actually been detached.
> http://libvirt.org/html/libvirt-libvirt-domain.html#virDomainDetachDeviceFl
According to the link:

To check whether the device was successfully removed, either recheck domain configuration using virDomainGetXMLDesc() or add a handler for the VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. In case the device is already gone when virDomainDetachDeviceFlags returns, the event is delivered before this API call ends.

I think we should take the later approach and handle the VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. So our code can wait until deadline and fail with a timeout, or woke up early when getting a VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event, verify the xml that indeed this device was removed, and continue.

Polling libvirt xml every seconds is too ugly, it would be nice if we avoid such operations.

Francesco, do we have similar code handling libvirt events?
Line 11: 
Line 12: Not doing so can cause various problems, as hotunplugDisk could return a
Line 13: success result while it did not actually succeeds to detach the disk.
Line 14: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I393ce55dd761ac825cb96bd499976fd74c366b09
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list