diff options
author | 2012-02-06 14:53:24 +0100 | |
---|---|---|
committer | 2012-02-08 11:26:20 +0100 | |
commit | c8683f231dd227da8540f3249d7e332ec7a75ad7 (patch) | |
tree | 7b4071ecb1ecd2e452b30576448c7aecb6f1d9ab | |
parent | util: Generalize virFileDirectFd (diff) | |
download | libvirt-c8683f231dd227da8540f3249d7e332ec7a75ad7.tar.gz libvirt-c8683f231dd227da8540f3249d7e332ec7a75ad7.tar.bz2 libvirt-c8683f231dd227da8540f3249d7e332ec7a75ad7.zip |
qemu: Always use iohelper for dumping domain core
Qemu uses non-blocking I/O which doesn't play nice with regular file
descriptors. We need to pass a pipe to qemu instead, which can easily be
done using iohelper.
-rw-r--r-- | src/qemu/qemu_driver.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 99da3f23a..52350f26f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2943,9 +2943,11 @@ doCoreDump(struct qemud_driver *driver, int ret = -1; virFileWrapperFdPtr wrapperFd = NULL; int directFlag = 0; + unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING; /* Create an empty file with appropriate ownership. */ if (bypass_cache) { + flags |= VIR_FILE_WRAPPER_BYPASS_CACHE; directFlag = virFileDirectFdFlag(); if (directFlag < 0) { qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", @@ -2961,9 +2963,7 @@ doCoreDump(struct qemud_driver *driver, NULL, NULL)) < 0) goto cleanup; - if (bypass_cache && - !(wrapperFd = virFileWrapperFdNew(&fd, path, - VIR_FILE_WRAPPER_BYPASS_CACHE))) + if (!(wrapperFd = virFileWrapperFdNew(&fd, path, flags))) goto cleanup; if (qemuMigrationToFile(driver, vm, fd, 0, path, |