From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web12.4700.1608157267638574032 for ; Wed, 16 Dec 2020 14:21:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ipLOqAz4; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608157266; 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=EX2XJy6WPFqFQ8LDTCqWYqIur7Rslxo+iZt+g9eRaL4=; b=ipLOqAz4OCl9/pVxg0IdJArbDp8WqnNCzIb4+8Tyq6FH6TtSjThXHEtBxTOti56cE5wjTq dxGnjjUctkJdYFbsSW2Bx9WoaMpfxeotBBOYnV46zcyAGfMGRJM7EzYz3+6QCWsr6fLa7q CcA/orZ8r8zR9JHSH+C3d/gXqHrU0cg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-qY4bri3EP2Otk8DzLTqHFg-1; Wed, 16 Dec 2020 17:21:05 -0500 X-MC-Unique: qY4bri3EP2Otk8DzLTqHFg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EBC48145EE; Wed, 16 Dec 2020 22:21:04 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-152.ams2.redhat.com [10.36.114.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7618260843; Wed, 16 Dec 2020 22:20:59 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io, virtio-fs@redhat.com, lersek@redhat.com Cc: Ard Biesheuvel , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2 PATCH 33/48] OvmfPkg/VirtioFsDxe: implement EFI_FILE_PROTOCOL.Read() for regular files Date: Wed, 16 Dec 2020 22:11:10 +0100 Message-Id: <20201216211125.19496-34-lersek@redhat.com> In-Reply-To: <20201216211125.19496-1-lersek@redhat.com> References: <20201216211125.19496-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 VXNpbmcgdGhlIGZ1bmN0aW9ucyBpbnRyb2R1Y2VkIHByZXZpb3VzbHksIHdlIGNhbiBub3cgaW1w bGVtZW50ClZpcnRpb0ZzU2ltcGxlRmlsZVJlYWQoKTsgZm9yIHJlZ3VsYXIgZmlsZXMgYXQgZmly c3QuCgpDYzogQXJkIEJpZXNoZXV2ZWwgPGFyZC5iaWVzaGV1dmVsQGFybS5jb20+CkNjOiBKb3Jk YW4gSnVzdGVuIDxqb3JkYW4ubC5qdXN0ZW5AaW50ZWwuY29tPgpDYzogUGhpbGlwcGUgTWF0aGll dS1EYXVkw6kgPHBoaWxtZEByZWRoYXQuY29tPgpSZWY6IGh0dHBzOi8vYnVnemlsbGEudGlhbm9j b3JlLm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MzA5NwpTaWduZWQtb2ZmLWJ5OiBMYXN6bG8gRXJzZWsg PGxlcnNla0ByZWRoYXQuY29tPgotLS0KIE92bWZQa2cvVmlydGlvRnNEeGUvU2ltcGxlRnNSZWFk LmMgfCA3NSArKysrKysrKysrKysrKysrKysrLQogMSBmaWxl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ICAg ICAgICAgICAgICAgICAgICAgICAgICAgIExlZnQ7DQorDQorICBWaXJ0aW9GcyA9IFZpcnRpb0Zz RmlsZS0+T3duZXJGczsNCisgIC8vDQorICAvLyBUaGUgVUVGSSBzcGVjIGZvcmJpZHMgcmVhZHMg dGhhdCBzdGFydCBiZXlvbmQgdGhlIGVuZCBvZiB0aGUgZmlsZS4NCisgIC8vDQorICBTdGF0dXMg PSBWaXJ0aW9Gc0Z1c2VHZXRBdHRyIChWaXJ0aW9GcywgVmlydGlvRnNGaWxlLT5Ob2RlSWQsICZG dXNlQXR0cik7DQorICBpZiAoRUZJX0VSUk9SIChTdGF0dXMpIHx8IFZpcnRpb0ZzRmlsZS0+Rmls ZVBvc2l0aW9uID4gRnVzZUF0dHIuU2l6ZSkgew0KKyAgICByZXR1cm4gRUZJX0RFVklDRV9FUlJP UjsNCisgIH0NCisNCisgIFN0YXR1cyAgICAgID0gRUZJX1NVQ0NFU1M7DQorICBUcmFuc2ZlcnJl ZCA9IDA7DQorICBMZWZ0ICAgICAgICA9ICpCdWZmZXJTaXplOw0KKyAgd2hpbGUgKExlZnQgPiAw KSB7DQorICAgIFVJTlQzMiBSZWFkU2l6ZTsNCisNCisgICAgLy8NCisgICAgLy8gRlVTRV9SRUFE IGNhbm5vdCBleHByZXNzIGEgPj00R0IgYnVmZmVyIHNpemUuDQorICAgIC8vDQorICAgIFJlYWRT aXplID0gKFVJTlQzMilNSU4gKChVSU5UTilNQVhfVUlOVDMyLCBMZWZ0KTsNCisgICAgU3RhdHVz ID0gVmlydGlvRnNGdXNlUmVhZEZpbGVPckRpciAoDQorICAgICAgICAgICAgICAgVmlydGlvRnMs DQorICAgICAgICAgICAgICAgVmlydGlvRnNGaWxlLT5Ob2RlSWQsDQorICAgICAgICAgICAgICAg VmlydGlvRnNGaWxlLT5GdXNlSGFuZGxlLA0KKyAgICAgICAgICAgICAgIEZBTFNFLCAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElzRG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