• E
    qemu: refactor file opening · 449ae9c2
    Eric Blake 提交于
    In a SELinux or root-squashing NFS environment, libvirt has to go
    through some hoops to create a new file that qemu can then open()
    by name.  Snapshots are a case where we want to guarantee an empty
    file that qemu can open; also, reopening a save file to convert it
    from being marked partial to complete requires a reopen to avoid
    O_DIRECT headaches.  Refactor some existing code to make it easier
    to reuse in later patches.
    
    * src/qemu/qemu_migration.h (qemuMigrationToFile): Drop parameter.
    * src/qemu/qemu_migration.c (qemuMigrationToFile): Let cgroup do
    the stat, rather than asking caller to do it and pass info down.
    * src/qemu/qemu_driver.c (qemuOpenFile): New function, pulled from...
    (qemuDomainSaveInternal): ...here.
    (doCoreDump, qemuDomainSaveImageOpen): Use it here as well.
    449ae9c2
qemu_migration.c 95.2 KB