Description of problem: Quote (virsh man page) --- Most virsh commands act asynchronously, so just because the virsh pro- gram returned, doesn’t mean the action is complete. This is important, as many operations on domains, like create and shutdown, can take con- siderable time (30 seconds or more) to bring the machine into a fully compliant state. If you want to know when one of these actions has finished you must poll through virsh list periodically. --- The virsh man page describes 'most operations' as being 'asynchronous', which is not the case. The virsh commands are tied in to the libvirt APIs which are synchronous. It looks like the paragraph in question was lifted directly from the 'xm' man page without being updated: Quote (xm man page) --- Most xm commands act asynchronously, so just because the xm command returned, doesn’t mean the action is complete. This is important, as many operations on domains, like create and shutdown, can take consid- erable time (30 seconds or more) to bring the machine into a fully com- pliant state. If you want to know when one of these actions has fin- ished you must poll through xm list periodically. --- In practice, the implementation of shell scripts using 'virsh', following the man page as it is documented must do: virsh [command] if [ $? -eq 0 ]; then # per virsh man page... # operation was started, now poll to see # if it completed # if a timeout occurs, give up. while ...; do ... if [ $complete ]; then return 0 fi done fi return 1 Expected results: It would be nice to either: (a) remove the above paragraph from the virsh man page, or (b) explicitly define which virsh commands, if any, are actually asynchronous It is my understanding based on talks with libvirt developers that none of the commands are asynchronous today and that the paragraph is simply wrong. Either way, clarifying the man page will allow administrators and developers who write scripts around 'virsh' have a reasonable expectation about whether the return code reflects the completion of the operation. For example: virsh [command] return $?
libvirt-0.6.3-14.el5
Created attachment 370080 [details] patch frixing the man page source and result State that most operations are synchronous except create and shutdown of domains. I guess that should be good enough
https://www.redhat.com/archives/libvir-list/2009-November/msg00626.html patch posted upstream as this still applied :-\ Daniel
libvirt-0.6.3-22.el5 has been built in dist-5E-qu-candidate with the fixes, Daniel
The bus has been fixed in libvirt-0.6.3-22.el5
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0205.html