public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server v2 0/3] Extend qga file-read with chunked access for large files
@ 2026-02-25 11:28 Markus Ebner
  2026-02-25 11:28 ` [PATCH qemu-server v2 1/3] agent: file-read: Allow specifying max number of bytes to read Markus Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Markus Ebner @ 2026-02-25 11:28 UTC (permalink / raw)
  To: pve-devel; +Cc: Markus Ebner

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 | 60 +++++++++++++++++++++++++++++++++-----
 1 file changed, 52 insertions(+), 8 deletions(-)

-- 
2.53.0




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-02-26 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 11:28 [PATCH qemu-server v2 0/3] Extend qga file-read with chunked access for large files Markus Ebner
2026-02-25 11:28 ` [PATCH qemu-server v2 1/3] agent: file-read: Allow specifying max number of bytes to read Markus Ebner
2026-02-26 12:04   ` Fiona Ebner
2026-02-25 11:28 ` [PATCH qemu-server v2 2/3] agent: file-read: Allow maintaining base64-encoding of content Markus Ebner
2026-02-26 12:04   ` Fiona Ebner
2026-02-25 11:28 ` [PATCH qemu-server v2 3/3] agent: file-read: Allow specifying byte offset to start reading at Markus Ebner
2026-02-26 12:04   ` Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal