|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] libxl: Wait until QEMU removed the device before tearing it down
On 11/14/2014 11:19 AM, Ian Jackson wrote:
There are already instances of usleep in libxl (e.g. qmp_open(), which is where I got the ~5 seconds number, btw). But I agree that callbacks are better here, I didn't think of non-xl users. OK, I'll try to see what needs to be done (I am not familiar with how libxl does asynchronous calls) Secondly, I'm not particularly keen on polling. Is there not a QMP function that can be used to get notified when the device is really removed ? I didn't see any. Sadly I guess that if there is, restructuring the qmp handling in libxl_qmp.c (qmp_next et al) to be able to use it would be way out of scope for a bugfix during the freeze. This would probably require changes in QEMU as well since I don't believe it notifies anyone on the other end of QMP connection that it is done cleaning up. Finally, some notes about error handling:
rc is overwritten later:
if (rc) {
rc = ERROR_FAIL;
goto out_fail;
}
So this whole rc assignment business in the patch was somewhat pointless
anyway.
One question though: should we fail on the timeout and not clean up xenstore and reset the device (which is what this version of the patch does)? Because we may end up with device finally removed and cleanup up by QEMU/guest but not reset and removed from xenstore. Thanks. -boris I'm sorry that the rest of this file is so confused about this. I think you should use `ret' to contain responses which are `0 (for success) or -1 (setting errno)', and probably something like `errnoval' if you need actual errno values. You should definitely never write -EFOOBAR in userland code. Thanks, Ian. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |