From: Michal Privoznik Date: Tue, 26 Mar 2013 14:45:16 +0000 (+0100) Subject: qemu: Set migration FD blocking X-Git-Tag: v0.10.2.4~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bcf1522ff4b72e559cd5203ab916fad2e2d6b15;p=thirdparty%2Flibvirt.git qemu: Set migration FD blocking Since we switched from direct host migration scheme to the one, where we connect to the destination and then just pass a FD to a qemu, we have uncovered a qemu bug. Qemu expects migration FD to block. However, we are passing a nonblocking one which results in cryptic error messages like: qemu: warning: error while loading state section id 2 load of migration failed The bug is already known to Qemu folks, but we should workaround already released Qemus. Patch has been originally proposed by Stefan Hajnoczi (cherry picked from commit ceb31795af40f6127a541076b905935ff83e5b11) --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 1da353c3a7..7decf13220 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1811,6 +1811,13 @@ qemuMigrationConnect(struct qemud_driver *driver, spec->dest.fd.qemu == -1) goto cleanup; + /* Migration expects a blocking FD */ + if (virSetBlocking(spec->dest.fd.qemu, true) < 0) { + virReportSystemError(errno, _("Unable to set FD %d blocking"), + spec->dest.fd.qemu); + goto cleanup; + } + ret = 0; cleanup: