Re: [PATCH 2/2] qemu: use -incoming fd:n to avoid qemu holding fd indefinitely

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/22/2010 03:27 PM, Eric Blake wrote:
> +        } else if (STREQ(migrateFrom, "stdio")) {
> +            if (qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_FD) {
> +                virCommandAddArgFormat(cmd, "fd:%d", migrateFd);
> +                virCommandTransferFD(cmd, migrateFd);

This needs to be preserve rather than transfer, since the caller in
qemu_driver.c expects to be able to still manage and close migrateFd.
I'm squashing this in:

diff --git i/src/qemu/qemu_command.c w/src/qemu/qemu_command.c
index 3187858..31c23c0 100644
--- i/src/qemu/qemu_command.c
+++ w/src/qemu/qemu_command.c
@@ -3870,7 +3870,7 @@ qemuBuildCommandLine(virConnectPtr conn,
         } else if (STREQ(migrateFrom, "stdio")) {
             if (qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_FD) {
                 virCommandAddArgFormat(cmd, "fd:%d", migrateFd);
-                virCommandTransferFD(cmd, migrateFd);
+                virCommandPreserveFD(cmd, migrateFd);
             } else if (qemuCmdFlags & QEMUD_CMD_FLAG_MIGRATE_QEMU_EXEC) {
                 virCommandAddArg(cmd, "exec:cat");
                 virCommandSetInputFD(cmd, migrateFd);
@@ -3899,7 +3899,7 @@ qemuBuildCommandLine(virConnectPtr conn,
                 goto error;
             }
             virCommandAddArg(cmd, migrateFrom);
-            virCommandTransferFD(cmd, migrateFd);
+            virCommandPreserveFD(cmd, migrateFd);
         } else {
             qemuReportError(VIR_ERR_INTERNAL_ERROR,
                             "%s", _("unknown migration protocol"));


-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]