提交 c8683f23 编写于 作者: J Jiri Denemark

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.
上级 afe6e58a
...@@ -2943,9 +2943,11 @@ doCoreDump(struct qemud_driver *driver, ...@@ -2943,9 +2943,11 @@ doCoreDump(struct qemud_driver *driver,
int ret = -1; int ret = -1;
virFileWrapperFdPtr wrapperFd = NULL; virFileWrapperFdPtr wrapperFd = NULL;
int directFlag = 0; int directFlag = 0;
unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING;
/* Create an empty file with appropriate ownership. */ /* Create an empty file with appropriate ownership. */
if (bypass_cache) { if (bypass_cache) {
flags |= VIR_FILE_WRAPPER_BYPASS_CACHE;
directFlag = virFileDirectFdFlag(); directFlag = virFileDirectFdFlag();
if (directFlag < 0) { if (directFlag < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
...@@ -2961,9 +2963,7 @@ doCoreDump(struct qemud_driver *driver, ...@@ -2961,9 +2963,7 @@ doCoreDump(struct qemud_driver *driver,
NULL, NULL)) < 0) NULL, NULL)) < 0)
goto cleanup; goto cleanup;
if (bypass_cache && if (!(wrapperFd = virFileWrapperFdNew(&fd, path, flags)))
!(wrapperFd = virFileWrapperFdNew(&fd, path,
VIR_FILE_WRAPPER_BYPASS_CACHE)))
goto cleanup; goto cleanup;
if (qemuMigrationToFile(driver, vm, fd, 0, path, if (qemuMigrationToFile(driver, vm, fd, 0, path,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册