Thanks a lot, Eric. I am now a student and is interesting in it. Your help courage me so much!<div><br></div><div>Yours.<br><br><div class="gmail_quote">2012/8/15 Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 08/14/2012 09:35 AM, mzawdx wang wrote:<br>
> Hi all:<br>
>        I am now reading the source codes of libvirt with version 0.9.2 ,<br>
<br>
</div>You'd be better off investigating the source code of libvirt.git (the<br>
current development is working towards 0.10.0 as the successor to the<br>
released 0.9.13); 0.9.2 is quite old.<br>
<div class="im"><br>
> and be stuck by the function "qemudDispatchServerEvent". as you can see:<br>
> static void<br>
> qemudDispatchServerEvent(int watch, int fd, int events, void *opaque) {<br>
<br>
</div>In fact, in the meantime, this function was deleted in commit df0b57a95<br>
(0.9.3) as part of using a newer RPC framework under src/rpc.<br>
<div class="im"><br>
> ...<br>
> }<br>
><br>
> My question is : except for the argument "void *opaque"£¬ when and how the<br>
> other three arguments (int watch, int fd, int events) being incoming ?<br>
><br>
> For it is a static function, I look through the source file "libvirt.c" and<br>
> find no answer .<br>
> Could someone give me a help ?<br>
<br>
</div>If you insist on debugging 0.9.2, look at<br>
daemon/libvirtd.c:qemudNetworkEnable, which passes the address of<br>
qemudDispatchServerEvent as a callback pointer to virEventAddHandle.<br>
Thus, any time a poll() on the connection socket completes,<br>
qemudDispatchServerEvent() will be called with the information learned<br>
from that poll.  In particular,<br>
src/util/event_poll.c:virEventPollDispatchTimeouts() is a location that<br>
calls the callback function.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Eric Blake   <a href="mailto:eblake@redhat.com">eblake@redhat.com</a>    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</font></span></blockquote></div><br></div>