<div dir="ltr">Thanks Rich.<div>I have used libguestfs for several month. It worked perfectly before, the issue appears recently. I am trying <span style="font-size:14px">guestfs_set_backend (g, "direct").</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Thanks,</span></div><div><span style="font-size:14px">Allen</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-29 23:31 GMT+08:00 Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Aug 29, 2016 at 11:19:04PM +0800, Baochuan Wu wrote:<br>
> Thanks Rich for you quick reply. I enabled logs and the program stuck<br>
> again, here is the call stack and log:<br>
> Thread 1 (Thread 0x7fac58edc8c0 (LWP 1271)):<br>
> #0  0x00007fac578fac20 in __poll_nocancel () from /lib64/libc.so.6<br>
> #1  0x00007fac56df3c5a in virNetClientIOEventLoop () from<br>
> /lib64/libvirt.so.0<br>
> #2  0x00007fac56df441b in virNetClientSendInternal () from<br>
> /lib64/libvirt.so.0<br>
> #3  0x00007fac56df5843 in virNetClientSendWithReply () from<br>
> /lib64/libvirt.so.0<br>
> #4  0x00007fac56df6052 in virNetClientProgramCall () from<br>
> /lib64/libvirt.so.0<br>
> #5  0x00007fac56dcbfe2 in callFull.isra.2 () from /lib64/libvirt.so.0<br>
> #6  0x00007fac56de213d in remoteDomainCreateXML () from /lib64/libvirt.so.0<br>
> #7  0x00007fac56d82151 in virDomainCreateXML () from /lib64/libvirt.so.0<br>
> #8  0x00007fac58acca50 in launch_libvirt () from /lib64/libguestfs.so.0<br>
> #9  0x00007fac58ac2b2b in guestfs_impl_launch () from /lib64/libguestfs.so.0<br>
> #10 0x00007fac58a5eba5 in guestfs_launch () from /lib64/libguestfs.so.0<br>
> #11 0x00000000004117ca in main ()<br>
</span>...<br>
<span class="">> libguestfs: [62900ms] launch libvirt guest<br>
<br>
</span>The error is happening in libvirt's virDomainCreateXML call, called<br>
from libguestfs here:<br>
<br>
<a href="https://github.com/libguestfs/libguestfs/blob/master/src/launch-libvirt.c#L600" rel="noreferrer" target="_blank">https://github.com/libguestfs/<wbr>libguestfs/blob/master/src/<wbr>launch-libvirt.c#L600</a><br>
<br>
Unfortunately libvirt isn't a simple C library.  It will launch and<br>
talk to a daemon (usually ``libvirt --timeout=30'' process, if you are<br>
not running as root).  Debugging into libvirtd is described here:<br>
<br>
<a href="http://libguestfs.org/guestfs-faq.1.html#debugging-libvirt" rel="noreferrer" target="_blank">http://libguestfs.org/guestfs-<wbr>faq.1.html#debugging-libvirt</a><br>
<br>
A workaround is to set LIBGUESTFS_BACKEND=direct [or use the<br>
equivalent call ``guestfs_set_backend (g, "direct")''] which will<br>
cause libguestfs to run qemu directly instead of going through<br>
libvirt.<br>
<br>
<a href="http://libguestfs.org/guestfs.3.html#backend" rel="noreferrer" target="_blank">http://libguestfs.org/guestfs.<wbr>3.html#backend</a><br>
<span class=""><br>
Rich.<br>
<br>
--<br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~<wbr>rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
</span>virt-df lists disk usage of guests without needing to install any<br>
software inside the virtual machine.  Supports Linux and Windows.<br>
<a href="http://people.redhat.com/~rjones/virt-df/" rel="noreferrer" target="_blank">http://people.redhat.com/~<wbr>rjones/virt-df/</a><br>
</blockquote></div><br></div>