mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Catch stderr of image compression binary
If a compression binary prints something to stderr, currently it is discarded. However, it can contain useful data from debugging POV, so we should catch it.
This commit is contained in:
parent
cc6c425f94
commit
137229bf4a
@ -3598,6 +3598,7 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
||||
virCommandPtr cmd = NULL;
|
||||
int pipeFD[2] = { -1, -1 };
|
||||
unsigned long saveMigBandwidth = priv->migMaxBandwidth;
|
||||
char *errbuf = NULL;
|
||||
|
||||
/* Increase migration bandwidth to unlimited since target is a file.
|
||||
* Failure to change migration speed is not fatal. */
|
||||
@ -3680,6 +3681,8 @@ qemuMigrationToFile(virQEMUDriverPtr driver, virDomainObjPtr vm,
|
||||
cmd = virCommandNewArgs(args);
|
||||
virCommandSetInputFD(cmd, pipeFD[0]);
|
||||
virCommandSetOutputFD(cmd, &fd);
|
||||
virCommandSetErrorBuffer(cmd, &errbuf);
|
||||
virCommandDoAsyncIO(cmd);
|
||||
if (virSetCloseExec(pipeFD[1]) < 0) {
|
||||
virReportSystemError(errno, "%s",
|
||||
_("Unable to set cloexec flag"));
|
||||
@ -3727,7 +3730,11 @@ cleanup:
|
||||
|
||||
VIR_FORCE_CLOSE(pipeFD[0]);
|
||||
VIR_FORCE_CLOSE(pipeFD[1]);
|
||||
virCommandFree(cmd);
|
||||
if (cmd) {
|
||||
VIR_DEBUG("Compression binary stderr: %s", NULLSTR(errbuf));
|
||||
VIR_FREE(errbuf);
|
||||
virCommandFree(cmd);
|
||||
}
|
||||
if (restoreLabel && (!bypassSecurityDriver) &&
|
||||
virSecurityManagerRestoreSavedStateLabel(driver->securityManager,
|
||||
vm->def, path) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user