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=ISj9UZOl; 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 3083E5A0625 for ; Wed, 13 Nov 2024 09:04:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731485061; 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=4mrGoVE1+GR4cHmhyllt4l+qNOfRGfTPAYVbqEEo4bo=; b=ISj9UZOln2BboT07jBudAbaoeoT0vwV9l1PchQdXI202MFpM3t56BZppK2eP4vFiufSN34 l4xduBmKetJY2SrcEWnkEfsQsKD1bSyJP2FBEMHyNn6EGQBif6OmjdhCsYQKyZJs7Eq5df 8hDa2AbtD6MFfPutg0o6NTfi0+C8R4A= 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-_lGOK6PRNAeN5zZ-JCd-9Q-1; Wed, 13 Nov 2024 03:04:19 -0500 X-MC-Unique: _lGOK6PRNAeN5zZ-JCd-9Q-1 X-Mimecast-MFC-AGG-ID: _lGOK6PRNAeN5zZ-JCd-9Q 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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 76CA6195419F for ; Wed, 13 Nov 2024 08:04:18 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.192.187]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5FF5619560A3; Wed, 13 Nov 2024 08:04:17 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v11 03/10] vhost-user: introduce vhost-user API Date: Wed, 13 Nov 2024 09:04:02 +0100 Message-ID: <20241113080411.476646-4-lvivier@redhat.com> In-Reply-To: <20241113080411.476646-1-lvivier@redhat.com> References: <20241113080411.476646-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-MFC-PROC-ID: -EU6vtukWIeMPb4JL6o6eLy0nF7bb5VMbwxLdkkVOLI_1731485058 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: M37C7GN2OZZEGGBCCU5T5IAYA5FOU6D2 X-Message-ID-Hash: M37C7GN2OZZEGGBCCU5T5IAYA5FOU6D2 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 bnMgbmVlZGVkDQp0byBpbXBsZW1lbnQgdmhvc3QtdXN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