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=W2lwii3q; 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 9E2695A004E for ; Thu, 10 Oct 2024 14:29:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728563354; 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=aUv7idxbzIGU3PxQ2TY9rdKKvDjoZtcY3CFypRMr66s=; b=W2lwii3qmB1mbhJ8NUBR4y7vmb5OqfgH2ROaTvPl4YPInMhCYqFkNCZa5jdB238ISwCm8g 2797dZ9/COQwo4y7j8mGTMErzJcz7r0NmxiNSy73IuVVfBV8o9NvhxHhVeyNWGpqbnvYRz mY1d6xKOXCGnLZyqTEVEdGjaSkIIGF0= Received: from mx-prod-mc-02.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-141-UuVJyCqnPam1AXDeyOQRNA-1; Thu, 10 Oct 2024 08:29:13 -0400 X-MC-Unique: UuVJyCqnPam1AXDeyOQRNA-1 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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6CD321954237 for ; Thu, 10 Oct 2024 12:29:12 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.193.163]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0C67519560A2; Thu, 10 Oct 2024 12:29:10 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v8 3/8] vhost-user: introduce vhost-user API Date: Thu, 10 Oct 2024 14:28:57 +0200 Message-ID: <20241010122903.1188992-4-lvivier@redhat.com> In-Reply-To: <20241010122903.1188992-1-lvivier@redhat.com> References: <20241010122903.1188992-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-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: S47JJFBIFCRVIAMLJW4YDYR5OW7DXSFJ X-Message-ID-Hash: S47JJFBIFCRVIAMLJW4YDYR5OW7DXSFJ 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 ICAgIHwg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