]> xenbits.xensource.com Git - libvirt.git/commit
save: let iohelper handle inherited fd
authorEric Blake <eblake@redhat.com>
Tue, 12 Jul 2011 15:17:52 +0000 (09:17 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 21 Jul 2011 22:24:08 +0000 (16:24 -0600)
commit1eb6647979f8c657958069a28df713deab3052a6
tree68b380a1ae440a9d4a1f2558c45ee57901a0401b
parent38149ec145416fe15ba662e9083af1e5b941a2e9
save: let iohelper handle inherited fd

Rather than making the iohelper subject to a race in reopening
the file, it is nicer to pass an already-open fd by inheritance.

The old synopsis form must continue to work - if someone updates
their libvirt package and installs a new libvirt_iohelper but
without restarting the old libvirtd daemon, then the daemon can
still make calls using the old syntax but the new iohelper.

* src/util/iohelper.c (runIO): Split code for open...
(prepare): ...to new function.
(usage): Update synopsis.
(main): Allow alternate calling form.
* src/fdstream.c (virFDStreamOpenFileInternal): Use alternate form.
src/fdstream.c
src/util/iohelper.c