From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id D74BC1FF13F for ; Thu, 26 Feb 2026 13:32:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 776A01EFEC; Thu, 26 Feb 2026 13:33:34 +0100 (CET) From: Markus Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server v3 0/3] Extend qga file-read with chunked access for large files Date: Thu, 26 Feb 2026 13:31:16 +0100 Message-ID: <20260226123122.60418-1-info@ebner-markus.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.474 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_PASS -0.1 DMARC pass policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.618 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.734 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.78 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record X-MailFrom: info@ebner-markus.de X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation Message-ID-Hash: W5IP6WWBR3LQVWL4QOPLILQCELZVJK2Y X-Message-ID-Hash: W5IP6WWBR3LQVWL4QOPLILQCELZVJK2Y X-Mailman-Approved-At: Thu, 26 Feb 2026 13:33:38 +0100 CC: Markus Ebner X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The file-read command of the QEMU guest agent previously had several practical limitations. It always read a fixed 16 MiB block starting at offset 0, making it impossible to retrieve larger files in multiple chunks. On busy or resource‑constrained hosts, requests for large files often timed out because the agent attempted to read and JSON‑encode the entire 16 MiB block at once (while producing high CPU load in both qemu-guest-agent, as well as pvedaemon). Since decode wasn't optional, readinb binary data encoded as JSON string regularly caused highly inflated payload sizes due to extensive unicode escaping. This series extends the file-read method with three new parameters: - decode — Controls whether the base64‑encoded data returned by the guest agent should be decoded before being sent back through the API. When disabled, the base64 string is passed through unchanged, which is ideal for binary data and mirrors the existing encode parameter of file-write. - offset — Allows reading from an arbitrary byte offset within the file. - count — Allows requesting a smaller number of bytes than the internal 16 MiB limit, granting more flexibility to avoid API timeouts. With these additions, the agent/file-read API now essentially behaves like a pread() systemcall. All parameter additions were done in a backwards-compatible fashion. Markus Ebner (3): agent: file-read: Allow specifying max number of bytes to read agent: file-read: Allow maintaining base64-encoding of content agent: file-read: Allow specifying byte offset to start reading at src/PVE/API2/Qemu/Agent.pm | 62 ++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 9 deletions(-) -- 2.53.0