Re: [PATCH 15/8] save: add more iohelper support for O_DIRECT

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

 



On 07/19/2011 11:50 AM, Daniel P. Berrange wrote:
On Fri, Jul 15, 2011 at 08:48:18PM -0600, Eric Blake wrote:
Constraining the problem makes the solution easier to think about.

* src/util/iohelper.c (runIO): Make read support easy.
---

Could be squashed into 6/8.

  src/util/iohelper.c |    9 ++++++++-

ACK, if this really works for saving guests. We need to skip over the
initial header + XML in save files, so I would have thought we needed
to support a non-empty seekable file.

Yes, it really works. QEMU state files need not be seekable (it is the same format as used for migration, which can be passed over non-seekable sockets). Therefore, all we are doing is using iohelper to wrap a pipe() around the underlying file, at which point, all I/O is linear.

We do the wrapping _prior_ to the point that libvirt writes the header, and also prior to the point that libvirt then hands the fd over to qemu, for qemu to write the rest of the file. Therefore, from iohelper's perspective, we don't care who did the writing, but the end result is that all i/o is aggregated and replayed into the O_DIRECT fd from start to finish.

Same thing on read - libvirt reads, rather than seeks, the header. Therefore, libvirt reads the header, then hands the fd over to qemu to read the rest of the file.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]