From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=OXvKeRgq; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 04C835A061B for ; Mon, 04 Nov 2024 09:40:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730709607; bh=j9LluDP2pXNZvhm7EWfom7ih5UEbqGe1gMCaCh9UdEY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXvKeRgqdT90xpbeX4SD9lv6cwaNWfpuepTf1lBbWLv74zEsfhOrQVpSDa2BDKh+B TftKwlYL/8u0WqgL0oCtqU6WbKIVnETklk9Wel7nnkYdeFTgAOr6CI/73oLaD1pX1Q 0BuTtw6PYh1WCapgIIgQ5NJdYniungn2bKBmSiZlR3HDZcQWJhqar0Dq5ipmUq5rtg 9febXXmc1atMq8grVfjCyS1zw5Nya0mkLTCquOxwRWpQRp/3Cj/E6AhbaCsjfwKKi7 1NlnDkqL/1dkmEpjktJQ4oo1/d2Gp8Bqa9TDFtvCfWq4JL2P/d2CpjNwhWqWqjLQdr 4mjdcEawhD48A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XhlK33Ydyz4x8Y; Mon, 4 Nov 2024 19:40:07 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v9 03/20] vhost-user: introduce vhost-user API Date: Mon, 4 Nov 2024 19:39:46 +1100 Message-ID: <20241104084004.3544294-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241104084004.3544294-1-david@gibson.dropbear.id.au> References: <20241104084004.3544294-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: ZSSGBXH6Q333IIG44WSYAKMXWJPZVM6P X-Message-ID-Hash: ZSSGBXH6Q333IIG44WSYAKMXWJPZVM6P X-MailFrom: dgibson@gandalf.ozlabs.org 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 , David Gibson 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: RnJvbTogTGF1cmVudCBWaXZpZXIgPGx2aXZpZXJAcmVkaGF0LmNvbT4NCg0KQWRkIHZob3N0X3Vz ZXIuYyBhbmQgdmhvc3RfdXNlci5oIHRoYXQgZGVmaW5lIHRoZSBmdW5jdGlvbnMgbmVlZGVkDQp0 byBpbXBsZW1lbnQgdmhvc3QtdXNlciBiYWNrZW5kLg0KDQpTaWduZWQtb2ZmLWJ5OiBMYXVyZW50 IFZpdmllciA8bHZpdmllckByZWRoYXQuY29tPg0KTWVzc2FnZS1JRDogPDIwMjQxMDEwMTIyOTAz LjExODg5OTItNC1sdml2aWVyQHJlZGhhdC5jb20+DQpTaWduZWQtb2ZmLWJ5OiBEYXZpZCBHaWJz b24gPGRhdmlkQGdpYnNvbi5kcm9wYmVhci5pZC5hdT4NCi0tLQ0KIE1ha2VmaWxlICAgICB8ICAg NCArLQ0KIHZob3N0X3VzZXIuYyB8IDk3MCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysNCiB2aG9zdF91c2VyLmggfCAyMDggKysrKysrKysrKysNCiB2 aXJ0aW8uaCAgICAgfCAgIDEgKw0KIDQgZmlsZXMgY2hhbmdlZCwgMTE4MSBpbnNlcnRpb25zKCs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