]> xenbits.xensource.com Git - libvirt.git/commit
Fix domain restore for files on root-squash NFS
authorLaine Stump <laine@laine.org>
Wed, 3 Mar 2010 15:38:42 +0000 (16:38 +0100)
committerDaniel Veillard <veillard@redhat.com>
Wed, 3 Mar 2010 15:40:49 +0000 (16:40 +0100)
commita03121bcfe24d8677c44a084b57b1ffb4a053d8c
tree2e60328ae101a5940d97dadca1175b22356d9c97
parent9882123d69c24cedc44dd90f56a6bc09033c8245
Fix domain restore for files on root-squash NFS

If qemudDomainRestore fails to open the domain save file, create a
pipe, then fork a process that does setuid(qemu_user) and opens the
file, then reads this file and stuffs it into the pipe. the parent
libvirtd process will use the other end of the pipe as its fd, then
reap the child process after it's done reading.

This makes domain restore work on a root-squash NFS share that is only
visible to the qemu user.

* src/qemu/qemu_driver.c: add new qemudOpenAsUID() helper function,
  and use it in qemudDomainRestore() if reading as root directly failed.
src/qemu/qemu_driver.c