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.
This commit is contained in:
Jiri Denemark 2012-02-06 14:53:24 +01:00
parent afe6e58aed
commit c8683f231d

View File

@ -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,