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=djc2KexJ; 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 B611B5A061D for ; Fri, 22 Nov 2024 17:43:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732293827; 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=+Ek6fFv718oK2A2efe9mYVFgTw0HCr5ifcXtovplMYY=; b=djc2KexJ8H9BL5Mr+WIkE7hcAO21c5c3RS3J27INsFg8+mW9bdT5jPQobEF5z1KJjuAilp KC3j5UQ25KamaAvgds7huFvSY6H9lGoIyiUtkW0eVLNWLzDFnsEBQXr3jQPJ5m3H4B97V8 vZtieGZN5j6O0HjVeWZGIXEXoMVbYEA= Received: from mx-prod-mc-05.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-567-B51WmQ9_Mk2026aPmDzN0A-1; Fri, 22 Nov 2024 11:43:46 -0500 X-MC-Unique: B51WmQ9_Mk2026aPmDzN0A-1 X-Mimecast-MFC-AGG-ID: B51WmQ9_Mk2026aPmDzN0A Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4F5011956088 for ; Fri, 22 Nov 2024 16:43:45 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.193.97]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0C03230000DF; Fri, 22 Nov 2024 16:43:43 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v14 3/9] vhost-user: introduce vhost-user API Date: Fri, 22 Nov 2024 17:43:30 +0100 Message-ID: <20241122164337.3377854-4-lvivier@redhat.com> In-Reply-To: <20241122164337.3377854-1-lvivier@redhat.com> References: <20241122164337.3377854-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DdzaPdpQZkMy1tGcotylWQ4mvqR3Qh9o6gVmScAvkCs_1732293825 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: MCMXK47FXNBPQ2DO7Y23N4TWEYPXS6DQ X-Message-ID-Hash: MCMXK47FXNBPQ2DO7Y23N4TWEYPXS6DQ 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 bnMgbmVlZGVkDQp0byBpbXBsZW1lbnQgdmhvc3QtdXNlciBi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