From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OLTPkrAT; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 6F6015A0274 for ; Thu, 19 Dec 2024 12:14:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734606845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2Pxyrrj8XWvZU8/eEaRuiEqAxXIV10anE/iploiO4EE=; b=OLTPkrATizjBszedPFBUZxtBSt2+Fk3MP2BobxcNxmse904F1q9/Si0GQg/P+ycOM8Sdca f87xKutnMbgQJy7cbayxJ+l54LTCnpBLhmMLz5pFTsttwd5bdw+H9GnC7uD77UPHvGwu7m eVmU7sMoVWmXME5Z9kclYvfFHur8kEw= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-671-CCm18KpIP_KBedlu1LfwVA-1; Thu, 19 Dec 2024 06:14:03 -0500 X-MC-Unique: CCm18KpIP_KBedlu1LfwVA-1 X-Mimecast-MFC-AGG-ID: CCm18KpIP_KBedlu1LfwVA Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BBE0219560AB for ; Thu, 19 Dec 2024 11:14:02 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.193.37]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CAC701953953; Thu, 19 Dec 2024 11:14:01 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 0/9] vhost-user: Migration support Date: Thu, 19 Dec 2024 12:13:51 +0100 Message-ID: <20241219111400.2352110-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: P4-wmOeXskVaHD_LDZqbLqbw7xVet-JnJb8V2d8d13k_1734606842 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NUVUYAK45MCEZXL2S4RCJJEEQWVD4ERH X-Message-ID-Hash: NUVUYAK45MCEZXL2S4RCJJEEQWVD4ERH X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This series allows a QEMU guest to be migrated while it is connected=0D to Passt using vhost-user interface.=0D =0D There are two parts:=0D =0D - first part enables the migration of QEMU without transferring the=0D internal state of Passt. All connections are lost.=0D =0D This is done by implementing VHOST_USER_SET_LOG_FD and=0D VHOST_USER_SET_LOG_BASE commands (and enabling=0D VHOST_USER_PROTOCOL_F_LOG_SHMFD feature)=0D =0D "vhost-user: add VHOST_USER_SET_LOG_FD command"=0D "vhost-user: add VHOST_USER_SET_LOG_BASE command"=0D "vhost-user: Report to front-end we support VHOST_USER_PROTOCOL_F_LOG_SHM= FD"=0D =0D - second part allows source Passt instance to send its internal=0D state using QEMU migration channel to destination Passt instance.=0D =0D This is done implementing VHOST_USER_SET_DEVICE_STATE_FD and=0D VHOST_USER_CHECK_DEVICE_STATE (and enabling=0D VHOST_USER_PROTOCOL_F_DEVICE_STATE feature).=0D =0D "vhost-user: add VHOST_USER_CHECK_DEVICE_STATE command"=0D "vhost-user: add VHOST_USER_SET_DEVICE_STATE_FD command"=0D "vhost-user: Report to front-end we support VHOST_USER_PROTOCOL_F_DEVICE_= STATE"=0D =0D For now, it only implements the function needed to transfer the=0D state but no state is transferred.=0D =0D VHOST_USER_PROTOCOL_F_DEVICE_STATE is implemented in QEMU=0D only for vhost-user-fs, to be able to use it with virtio-net=0D I have proposed a patch upstream:=0D =0D https://patchew.org/QEMU/20241218143453.1573185-1-lvivier@redhat.com/=0D =0D Laurent Vivier (9):=0D virtio: Use const pointer for vu_dev=0D vhost-user: update protocol features and commands list=0D vhost-user: add VHOST_USER_SET_LOG_FD command=0D vhost-user: Pass vu_dev to more virtio functions=0D vhost-user: add VHOST_USER_SET_LOG_BASE command=0D vhost-user: Report to front-end we support=0D VHOST_USER_PROTOCOL_F_LOG_SHMFD=0D vhost-user: add VHOST_USER_CHECK_DEVICE_STATE command=0D vhost-user: add VHOST_USER_SET_DEVICE_STATE_FD command=0D vhost-user: Report to front-end we support=0D VHOST_USER_PROTOCOL_F_DEVICE_STATE=0D =0D epoll_type.h | 2 +=0D passt.c | 4 +=0D util.h | 3 +=0D vhost_user.c | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++-=0D vhost_user.h | 50 +++++++++-=0D virtio.c | 116 +++++++++++++++++++++---=0D virtio.h | 32 +++++--=0D vu_common.c | 59 +++++++++++-=0D vu_common.h | 3 +-=0D 9 files changed, 484 insertions(+), 36 deletions(-)=0D =0D --=20=0D 2.47.1=0D =0D