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=hFlVXFK9; 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 5824E5A004C for ; Wed, 09 Oct 2024 11:07:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728464847; 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=n2/txRI6XX7jd6Ri8VRYaJj2jKZ5fIAC/XKg4cE8lpc=; b=hFlVXFK9u6+rNDUczpLOtJLj0b96IRR8Ez9wlduIIsKU5pX/jd7aBYWpIwn0M80RX15UDS o+3leI+sQBdVA7H+49lQzRzTHGW/qVd5ATZFA4NnJh2evd5f8j7hqHN/i2Kx2trG63/9nn lcAD55AEj7oROIzSpmvxKhGAMsFp2Fg= 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-548-5EHv-2DKP-avNgxeUPotyw-1; Wed, 09 Oct 2024 05:07:25 -0400 X-MC-Unique: 5EHv-2DKP-avNgxeUPotyw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 81365195608A for ; Wed, 9 Oct 2024 09:07:24 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.184]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 585A11956086; Wed, 9 Oct 2024 09:07:23 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v7 3/8] vhost-user: introduce vhost-user API Date: Wed, 9 Oct 2024 11:07:10 +0200 Message-ID: <20241009090716.691361-4-lvivier@redhat.com> In-Reply-To: <20241009090716.691361-1-lvivier@redhat.com> References: <20241009090716.691361-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: RFQJCOYMWXTMVTLPA6OH3GI2VLZ5ABV4 X-Message-ID-Hash: RFQJCOYMWXTMVTLPA6OH3GI2VLZ5ABV4 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 ICAgIHwgICA0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