mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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:
parent
afe6e58aed
commit
c8683f231d
@ -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,
|
|||||||
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user