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=QKn7qBKd; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id E82F95A061F for ; Fri, 08 Nov 2024 11:37:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731062265; 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: in-reply-to:in-reply-to:references:references; bh=hydqQ+2+YNCpsYr+xqNXs7lQId4ISJDveG9Dw7wqX04=; b=QKn7qBKdk0kZQXskZwWiRXC8F3YwbfZkuT3Dcyyn7rbsZiZMRnDIQknVLLH1+dD7rDQ/6U rhoqBx8B2HdWGpXQl9EpkajqNobLZMURL1ErghRs50eVmrLx5oDskvrvFS6MAOTd+wRoqd wONjgI19GqPZCVSjgup2aKSrAYcGaRs= 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-182-0wIisdClMfek18Piasu77A-1; Fri, 08 Nov 2024 05:37:42 -0500 X-MC-Unique: 0wIisdClMfek18Piasu77A-1 X-Mimecast-MFC-AGG-ID: 0wIisdClMfek18Piasu77A Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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 5CDCB1954233 for ; Fri, 8 Nov 2024 10:37:41 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.194.73]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 371D81953880; Fri, 8 Nov 2024 10:37:39 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v10 03/12] vhost-user: introduce vhost-user API Date: Fri, 8 Nov 2024 11:37:22 +0100 Message-ID: <20241108103733.3554357-4-lvivier@redhat.com> In-Reply-To: <20241108103733.3554357-1-lvivier@redhat.com> References: <20241108103733.3554357-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _NOxaKrhqvJrQ5dEwWld7siSFEhqW_P8zoFNmGlCKhE_1731062261 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: CJKGWO6YJBKKW7UOCVC7U7Z7XLXPA7KV X-Message-ID-Hash: CJKGWO6YJBKKW7UOCVC7U7Z7XLXPA7KV 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: QWRkIHZob3N0X3VzZXIuYyBhbmQgdmhvc3RfdXNlci5oIHRoYXQgZGVmaW5lIHRoZSBmdW5jdGlv bnMgbmVlZGVkDQp0byBpbXBsZW1lbnQgdmhvc3QtdXNlciBiYWNrZW5kLg0KD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