]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: Set migration FD blocking
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Mar 2013 14:45:16 +0000 (15:45 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 26 Mar 2013 16:16:27 +0000 (17:16 +0100)
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 <stefanha@gmail.com>

src/qemu/qemu_migration.c

index 537b8340d8ed064889bfbf372cf9ade56ca2489c..15f3cef69759e70c4f6d0ffc5f677d525b8b88fe 100644 (file)
@@ -2657,6 +2657,13 @@ qemuMigrationConnect(virQEMUDriverPtr 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: