[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] Name resolution not working inside virt-customize



On Wed, Mar 11, 2015 at 09:29:29AM -0400, Lee Revell wrote:
> On 03/10/2015 05:12 PM, Richard W.M. Jones wrote:
> >Just for comparison, libguestfs 1.29.29 on Fedora host, plus
> >virt-builder, with a Fedora guest does this:
> 
> Hmm, something weird is going in with the output of virt-customize.

What actually happens is that we download the log file using the
guestfs_download API:

  https://github.com/libguestfs/libguestfs/blob/master/customize/customize_run.ml#L44

The API opens [in this instance] /dev/stderr with O_TRUNC:

  https://github.com/libguestfs/libguestfs/blob/master/src/proto.c#L752

So if you redirect stderr to a file, then the file gets truncated.

A quick fix is to use `tee' (or another program) in the redirection,
since a pipe ignores truncations.

The real fix is to modify the guestfs_download API to allow the
truncation behaviour to be optional.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]