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=c23rJmN5; 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 84DF95A0277 for ; Thu, 15 Aug 2024 17:50:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723737033; 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=TdsMwoHBGLwZ6IItC0R4Wms/1KhjA5GkGR6XMI2HCXU=; b=c23rJmN5+7RFtGTvMVC21+5hC+IacWRk0KgoZHF5j2/xiA/Gsk5EK8I400qRMbPZhUoLRY uGXchZkvQkRRtIpHYaWnK6yFpDkBk+YfdgNAH7FF2DNs4E8Cy/JzqioZhD23LH2S9AJ7+r dQtHo4jISDlw7ZLefM1oEGOKmqDExtw= 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-661-Jky-FBViO72fSUxlLPcM9w-1; Thu, 15 Aug 2024 11:50:31 -0400 X-MC-Unique: Jky-FBViO72fSUxlLPcM9w-1 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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 174381954B1F for ; Thu, 15 Aug 2024 15:50:31 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.69]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id DF20C1955D42; Thu, 15 Aug 2024 15:50:29 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v3 3/4] vhost-user: introduce vhost-user API Date: Thu, 15 Aug 2024 17:50:22 +0200 Message-ID: <20240815155024.827956-4-lvivier@redhat.com> In-Reply-To: <20240815155024.827956-1-lvivier@redhat.com> References: <20240815155024.827956-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-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: ZZY77RM7MUTEC7HLCLXCVCSIIUSAPLHH X-Message-ID-Hash: ZZY77RM7MUTEC7HLCLXCVCSIIUSAPLHH 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 bnMgbmVlZGVkDQp0byBpbXBsZW1lbnQgdmhvc3QtdXNlciBiYWNrZW5kLg0KDQpTaWduZWQtb2Zm LWJ5OiBMYXVyZW50IFZpdmllciA8bHZpdmllckByZWRoYXQuY29tPg0KLS0tDQogTWFrZWZpbGUg ICAgIHwgICAgN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