From nobody Mon Feb 9 16:53:52 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; dkim=pass; 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=pass(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1571916289; cv=none; d=zoho.com; s=zohoarc; b=hUfxGNj7Y+mAXmb96CtGsjqZFaigrPL+9qh/FMdRP+hC4Qc0QGhsZ4/9qyW4bhAjD6cUk3qDWO6p9+OSC6iNiIcr2EiPOoVrF69Hhq0ut25ubFjdh6kmDGopmvEghBkBGzPdfrmthGwpKtRh3msFv5UW/EZhOxrbXwx/54MwnH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571916289; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=D/pJ3W/Qz9XHj2UuEyUytLHj665k521TrYBAmheGze8=; b=eGYhNz9uvZ5JZHuMKTJGfzk0EwIwL3sgHitjUFRiApJblCfbfdaH12IjvWBQ88HJKtmVjdWcSeOdZgz9TwW1kVogO9E7YL3A6sM2b3qiinHK2SnrYGgBLJDS6HXLfi6zHTdPsrSL0enGS55dTbvYlOM5q+Zu7f88hzIqbpTXTBA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; 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=pass 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 1571916289209732.3341325087972; Thu, 24 Oct 2019 04:24:49 -0700 (PDT) Received: from localhost ([::1]:37034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNZno-0004ts-TB for importer@patchew.org; Thu, 24 Oct 2019 05:53:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNZBs-0006rx-RW for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:13:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNZBr-0005zY-On for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:13:56 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:34864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNZBr-0005z1-GQ for qemu-devel@nongnu.org; Thu, 24 Oct 2019 05:13:55 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9O94rg6100053; Thu, 24 Oct 2019 09:13:50 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2vqteq2av8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 09:13:50 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9O97kQ4170676; Thu, 24 Oct 2019 09:11:49 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2vtsk4898v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 Oct 2019 09:11:49 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x9O9BmYO024517; Thu, 24 Oct 2019 09:11:48 GMT Received: from jaraman-bur-1.us.oracle.com (/10.152.33.39) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Oct 2019 02:11:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : in-reply-to : references; s=corp-2019-08-05; bh=D/pJ3W/Qz9XHj2UuEyUytLHj665k521TrYBAmheGze8=; b=GZKogrjVclAuXGvEmw/PYM/HdkuoeOIkapBzA+RIBYwKckoZYnsP2L3qzHhzRhTvpcdV sG8OIPkkiSVU8PJwh8BRxmA7z2tEfoxIWmRxtsUTpGkVR3CwUelkPUJHqurG7AKvfwGK mfjh3QRUEWe2/g/Vxg/GHT5oahR9a5VwjQORtfdycCRooWWVaFUPnDN8VG3YoG+dBmvD 54AG1/MPgdmSC2OXqjYcOmxN+7lTNDDJnMGsrZssNG2/r0JUJ3qpggNV2RHlxBVVkehC GWpdNrQS8sM1ahjilH4hFghp7H2RFquUOYWPtOUwnnvNvQ2cawxe4ySWpGRBT42UdHc9 3g== From: Jagannathan Raman To: qemu-devel@nongnu.org Subject: [RFC v4 PATCH 43/49] multi-process/mig: Load VMSD in the proxy object Date: Thu, 24 Oct 2019 05:09:24 -0400 Message-Id: <78a6b0d7f11ff5fc14e2dcfe2f5db5a5e292e726.1571905346.git.jag.raman@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: In-Reply-To: References: X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1910240089 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, fam@euphon.net, john.g.johnson@oracle.com, kraxel@redhat.com, jag.raman@oracle.com, quintela@redhat.com, mst@redhat.com, armbru@redhat.com, kanth.ghatraju@oracle.com, thuth@redhat.com, ehabkost@redhat.com, konrad.wilk@oracle.com, dgilbert@redhat.com, liran.alon@oracle.com, stefanha@redhat.com, rth@twiddle.net, kwolf@redhat.com, berrange@redhat.com, mreitz@redhat.com, ross.lagerwall@citrix.com, marcandre.lureau@gmail.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @oracle.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Elena Ufimtseva The Proxy object loads the VMSD of remote process in source and send it to the remote process in the destination Signed-off-by: Elena Ufimtseva Signed-off-by: John G Johnson Signed-off-by: Jagannathan Raman --- New patch in v4 hw/proxy/qemu-proxy.c | 50 ++++++++++++++++++++++++++++++++++++++++++++= ++++ include/io/mpqemu-link.h | 1 + 2 files changed, 51 insertions(+) diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c index ce72e6a..c85ffb3 100644 --- a/hw/proxy/qemu-proxy.c +++ b/hw/proxy/qemu-proxy.c @@ -473,12 +473,62 @@ static int proxy_post_save(void *opaque) return 0; } =20 +static int proxy_post_load(void *opaque, int version_id) +{ + MigrationIncomingState *mis =3D migration_incoming_get_current(); + PCIProxyDev *pdev =3D opaque; + QEMUFile *f_remote; + MPQemuMsg msg =3D {0}; + Error *err =3D NULL; + QIOChannel *ioc; + uint64_t size; + uint8_t byte; + int fd[2]; + + if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) { + return -1; + } + + ioc =3D qio_channel_new_fd(fd[0], &err); + if (err) { + error_report_err(err); + return -1; + } + + qio_channel_set_name(QIO_CHANNEL(ioc), "proxy-migration-channel"); + + f_remote =3D qemu_fopen_channel_output(ioc); + + msg.cmd =3D START_MIG_IN; + msg.bytestream =3D 0; + msg.num_fds =3D 1; + msg.fds[0] =3D fd[1]; + + mpqemu_msg_send(pdev->mpqemu_link, &msg, pdev->mpqemu_link->com); + + size =3D pdev->migsize; + + while (size) { + byte =3D qemu_get_byte(mis->from_src_file); + qemu_put_byte(f_remote, byte); + size--; + } + + qemu_fflush(f_remote); + qemu_fclose(f_remote); + + close(fd[1]); + + return 0; +} + const VMStateDescription vmstate_pci_proxy_device =3D { .name =3D "PCIProxyDevice", .version_id =3D 2, .minimum_version_id =3D 1, .pre_save =3D proxy_pre_save, .post_save =3D proxy_post_save, + .post_load =3D proxy_post_load, .fields =3D (VMStateField[]) { VMSTATE_PCI_DEVICE(parent_dev, PCIProxyDev), VMSTATE_UINT64(migsize, PCIProxyDev), diff --git a/include/io/mpqemu-link.h b/include/io/mpqemu-link.h index 0ed7750..05dc55e 100644 --- a/include/io/mpqemu-link.h +++ b/include/io/mpqemu-link.h @@ -76,6 +76,7 @@ typedef enum { MMIO_RETURN, DEVICE_RESET, START_MIG_OUT, + START_MIG_IN, MAX, } mpqemu_cmd_t; =20 --=20 1.8.3.1