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=K6Ge0R6q; 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 26F645A061B for ; Fri, 15 Nov 2024 14:59:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731679139; 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=rXvVXnAIil295vKVKOT3mN7ZE/NNFYth3B/MHC31EJc=; b=K6Ge0R6q8lzosdp3bvmZql4/d/LWy9ISD0BckF2amKzHMVM1fM0k+6suFxv89/O/zWBbJ0 6HhQTM5VpG3H/YxkjCujx+psuUzvCgf0AkQlOpBa7DhUV2q1/C5WHXp6fe4Qp/lZuMwq+o kXeElDMsXzE/X/tBkqnq8eePnPAU1Xk= 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-118-z1P1VCV_Mq2RngzEMTV3dw-1; Fri, 15 Nov 2024 08:58:57 -0500 X-MC-Unique: z1P1VCV_Mq2RngzEMTV3dw-1 X-Mimecast-MFC-AGG-ID: z1P1VCV_Mq2RngzEMTV3dw Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 9C13E1955F79 for ; Fri, 15 Nov 2024 13:58:56 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.39.193.96]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 546F23003B74; Fri, 15 Nov 2024 13:58:55 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH v12 02/10] vhost-user: introduce virtio API Date: Fri, 15 Nov 2024 14:58:40 +0100 Message-ID: <20241115135850.1170744-3-lvivier@redhat.com> In-Reply-To: <20241115135850.1170744-1-lvivier@redhat.com> References: <20241115135850.1170744-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4W1vuEdoaVz4ir0c3W7jaExvXyb7mm-iL_4R3c5J8Xo_1731679136 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: P4AK3O66DWV6TZECQSZAPHVYBCREHDF3 X-Message-ID-Hash: P4AK3O66DWV6TZECQSZAPHVYBCREHDF3 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: QWRkIHZpcnRpby5jIGFuZCB2aXJ0aW8uaCB0aGF0IGRlZmluZSB0aGUgZnVuY3Rpb25zIG5lZWRl ZA0KdG8gbWFuYWdlIHZpcnRxdWV1ZXMuDQoNClNpZ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