From nobody Sun Feb 8 22:18:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1559735899; cv=none; d=zoho.com; s=zohoarc; b=Pb1nkZOgzw8lapsUDfEJMRCDhfpOEkeOUJM3LDZ3QFOFsAOiAyqgpIRJN5aFP39aIpBBmTiIoffdqSSgevpP4WTsg65PaDT7ksLhhKeHYbdRNE4lKjK7VgdgiW0fr9Be/mQAh+7JKYYIGHoU+G5J2JZcA2LDM0RCyQgsbOMkl+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559735899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=s27Y1wtyPVXNdwPybvNTaGXQFLfA1keMqAw4PkMYgDg=; b=mmTG/e2flX/b4/jfdsycTlSYLRogaGTYRMZGSv7gVfVGdolKpFZxSV2bHWLIFP8p05tocGJa6CEwdj9xom3EI/3m0iYKEJ3Hy/yr6JP7DGWlLRybPgZry8Gxm3nSofweepLOlYvFDehw6+tQwgBjNTxBNNSK+wAEc24I+Nm6wCY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1559735899430462.26017434734024; Wed, 5 Jun 2019 04:58:19 -0700 (PDT) Received: from localhost ([127.0.0.1]:39915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUYT-00071l-HA for importer@patchew.org; Wed, 05 Jun 2019 07:58:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYUUQ-0003up-Ga for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYUUM-0002rj-Sh for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hYUUL-0002mh-4s for qemu-devel@nongnu.org; Wed, 05 Jun 2019 07:53:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A35802F8BF3; Wed, 5 Jun 2019 11:53:40 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-241.ams2.redhat.com [10.36.116.241]) by smtp.corp.redhat.com (Postfix) with ESMTP id C14855D6A9; Wed, 5 Jun 2019 11:53:33 +0000 (UTC) From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 5 Jun 2019 13:53:16 +0200 Message-Id: <20190605115318.9972-4-quintela@redhat.com> In-Reply-To: <20190605115318.9972-1-quintela@redhat.com> References: <20190605115318.9972-1-quintela@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Jun 2019 11:53:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/5] migration: Fix fd protocol for incoming defer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , zhanghailiang , Juan Quintela , "Dr. David Alan Gilbert" , Peter Xu , Markus Armbruster , Yury Kotov , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Yury Kotov Currently, incoming migration through fd supports only command-line case: E.g. fork(); fd =3D open(); exec("qemu ... -incoming fd:%d", fd); It's possible to use add-fd commands to pass fd for migration, but it's invalid case. add-fd works with fdset but not with particular fds. To work with getfd in incoming defer it's enough to use monitor_fd_param instead of strtol. monitor_fd_param supports both cases: * fd:123 * fd:fd_name (added by getfd). And also the use of monitor_fd_param improves error messages. Signed-off-by: Yury Kotov Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- migration/fd.c | 8 +++++--- migration/fd.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/migration/fd.c b/migration/fd.c index a7c13df4ad..0a29ecdebf 100644 --- a/migration/fd.c +++ b/migration/fd.c @@ -52,12 +52,14 @@ static gboolean fd_accept_incoming_migration(QIOChannel= *ioc, return G_SOURCE_REMOVE; } =20 -void fd_start_incoming_migration(const char *infd, Error **errp) +void fd_start_incoming_migration(const char *fdname, Error **errp) { QIOChannel *ioc; - int fd; + int fd =3D monitor_fd_param(cur_mon, fdname, errp); + if (fd =3D=3D -1) { + return; + } =20 - fd =3D strtol(infd, NULL, 0); trace_migration_fd_incoming(fd); =20 ioc =3D qio_channel_new_fd(fd, errp); diff --git a/migration/fd.h b/migration/fd.h index a14a63ce2e..b901bc014e 100644 --- a/migration/fd.h +++ b/migration/fd.h @@ -16,7 +16,7 @@ =20 #ifndef QEMU_MIGRATION_FD_H #define QEMU_MIGRATION_FD_H -void fd_start_incoming_migration(const char *path, Error **errp); +void fd_start_incoming_migration(const char *fdname, Error **errp); =20 void fd_start_outgoing_migration(MigrationState *s, const char *fdname, Error **errp); --=20 2.21.0