<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 23, 2017 at 4:05 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail-HOEnZb"><div class="gmail-h5">On Thu, Nov 23, 2017 at 03:00:45PM +0200, Yaniv Kaul wrote:<br>
> On Thu, Nov 23, 2017 at 10:57 AM, Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>><br>
> wrote:<br>
><br>
> > On Tue, Nov 21, 2017 at 11:43:54PM +0200, Yaniv Kaul wrote:<br>
> > > Since I upgrading to FC27, I *sometimes* fail to virt-sysprep.<br>
> > > The debug messages:<br>
> > > libguestfs: trace: set_verbose true<br>
> > > libguestfs: trace: set_verbose = 0<br>
> > > libguestfs: create: flags = 0, handle = 0x7f4600005dd0, program = python2<br>
> > > libguestfs: trace: set_program "lago"<br>
> > > libguestfs: trace: set_program = 0<br>
> > > libguestfs: trace: add_drive_ro<br>
> > > "/home/ykaul/ovirt-system-<wbr>tests/deployment-basic-suite-<br>
> > master/default/images/lago-<wbr>basic-suite-master-host-0_<wbr>root.qcow2"<br>
> > > libguestfs: trace: add_drive<br>
> > > "/home/ykaul/ovirt-system-<wbr>tests/deployment-basic-suite-<br>
> > master/default/images/lago-<wbr>basic-suite-master-host-0_<wbr>root.qcow2"<br>
> > > "readonly:true"<br>
> > > libguestfs: creating COW overlay to protect original drive content<br>
> > > libguestfs: trace: disk_format<br>
> > > "/home/ykaul/ovirt-system-<wbr>tests/deployment-basic-suite-<br>
> > master/default/images/lago-<wbr>basic-suite-master-host-0_<wbr>root.qcow2"<br>
> > > libguestfs: command: run: qemu-img<br>
> > > libguestfs: command: run: \ info<br>
> > > libguestfs: command: run: \ --output json<br>
> > > libguestfs: command: run: \ /dev/fd/7<br>
> > > qemu-img: Could not open '/dev/fd/7': Failed to get shared "write" lock<br>
> > > Is another process using the image?<br>
<br>
</div></div>Looking at this a bit closer, I think this may be a bug in qemu.<br>
<br>
/dev/fd/7 is supposed to be the file descriptor of the image which we<br>
have opened in libguestfs, see this code:<br>
<br>
  <a href="https://github.com/libguestfs/libguestfs/blob/06df910491c49360c0292c7153ba5e5cd09a4735/lib/info.c#L174-L191" rel="noreferrer" target="_blank">https://github.com/libguestfs/<wbr>libguestfs/blob/<wbr>06df910491c49360c0292c7153ba5e<wbr>5cd09a4735/lib/info.c#L174-<wbr>L191</a><br>
<br>
I wonder if qemu gets confused by this and thinks that the image is<br>
open in two places?<br>
<br>
I can't reproduce this here however.  Having a nice short reproducer<br>
might help.<br></blockquote><div><br></div><div>It's not reliably reproduced on my setup either.</div><div>I run Lago (<a href="http://lago.readthedocs.io/en/latest/">http://lago.readthedocs.io/en/latest/</a>) which is virt-sysprep'ing several VMs (using direct backend, but they were brought up via libvirt - is that an issue?).</div><div>I don't recall seeing it before upgrading to FC27...</div><div>Y.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Rich.<br>
<span class="gmail-"><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>Fedora Windows cross-compiler. Compile Windows programs, test, and<br>
build Windows installers. Over 100 libraries supported.<br>
<a href="http://fedoraproject.org/wiki/MinGW" rel="noreferrer" target="_blank">http://fedoraproject.org/wiki/<wbr>MinGW</a><br>
</blockquote></div><br></div></div>