<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/qemu.git/block/parallels.c, branch master</title>
<subtitle>QEMU main repository</subtitle>
<id>https://git.landau.one/pub/scm/virt/qemu/qemu.git/atom?h=master</id>
<link rel='self' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/'/>
<updated>2026-07-28T14:55:00+00:00</updated>
<entry>
<title>parallels: validate BAT capacity against advertised disk size</title>
<updated>2026-07-28T14:55:00+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2026-07-22T16:54:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=e8a28c2e0e1faf20713938f549fa4c9d9a94cebb'/>
<id>urn:sha1:e8a28c2e0e1faf20713938f549fa4c9d9a94cebb</id>
<content type='text'>
parallels_open() copied nb_sectors, tracks, and bat_entries from the
image header without checking that the BAT actually covers the
advertised virtual disk size. An image whose header claims more
sectors than its BAT covers passes the generic block-layer bounds
check on open. A write into the gap between BAT coverage and the
advertised size then reaches allocate_clusters(), whose internal
assert(idx &lt; s-&gt;bat_size &amp;&amp; idx + to_allocate &lt;= s-&gt;bat_size) aborts
the process instead of returning a normal I/O error.

Reject such images at open time by requiring
bat_size * tracks &gt;= total_sectors, matching the invariant that
allocate_clusters() already assumes.

Reported-by: Feifan Qian &lt;bea1e@proton.me&gt;
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3804
Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
CC: Thomas Huth &lt;thuth@redhat.com&gt;
CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>parallels: reject BAT entries pointing outside backed storage</title>
<updated>2026-07-28T14:42:45+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2026-07-22T16:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=26c871c76885b1e03786d2cd6da090bc30e8faf2'/>
<id>urn:sha1:26c871c76885b1e03786d2cd6da090bc30e8faf2</id>
<content type='text'>
parallels_open()'s BAT scan and parallels_check_outside_image() only
checked entries against the file's upper end, matching just half of
what docs/interop/parallels.rst requires: an entry's offset must be
both &gt;= data_start and &lt; the file size. An entry below data_start
resolves into the header/BAT region itself, corrupting metadata on
write or losing the write silently on a partial overlap, and neither
qemu-img check nor the open-time scan ever caught it.

Check both bounds everywhere a BAT entry is resolved to a host
offset: seek_to_sector(), the open-time scan (without letting a bad
entry inflate data_end), and parallels_check_outside_image().

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
CC: Thomas Huth &lt;thuth@redhat.com&gt;
CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>parallels: fix bat_entries overflow in image creation</title>
<updated>2026-07-28T14:42:45+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2026-07-22T16:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=3a1e0618ae3df56128a42f98b6168a4c85598466'/>
<id>urn:sha1:3a1e0618ae3df56128a42f98b6168a4c85598466</id>
<content type='text'>
parallels_co_create() computed the BAT entry count directly into a
uint32_t, wrapping silently to zero at exactly 2^32 entries and
writing out a header whose BAT no longer matches its advertised
size. Compute it in an int64_t first and reject it once it no longer
fits, matching the cap parallels_open() already enforces. Also
reject cluster-size 0, and clamp header.cylinders instead of letting
it truncate the same way.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
CC: Thomas Huth &lt;thuth@redhat.com&gt;
CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>parallels: read header/BAT table in bounded chunks</title>
<updated>2026-07-28T14:42:45+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2026-07-22T16:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=af777e817a7c16d4eaf02989e838e8e0aaf173c5'/>
<id>urn:sha1:af777e817a7c16d4eaf02989e838e8e0aaf173c5</id>
<content type='text'>
parallels_open() read the whole header+BAT table with a single
bdrv_pread() call sized s-&gt;header_size. For an image whose catalog
approaches the "Catalog too large" bound (INT_MAX / sizeof(uint32_t)
entries), that size approaches BDRV_REQUEST_MAX_BYTES, and the block
layer legitimately refuses a single request that large, so the image
failed to open with a generic I/O error even though the catalog size
itself is within the format's documented limit.

Read the header and BAT table in fixed-size chunks instead, so the
maximum catalog size parallels_open() can actually address matches
the bound it already enforces, independent of the file's block-layer
alignment requirements.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
CC: Thomas Huth &lt;thuth@redhat.com&gt;
CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>parallels: fix integer overflow in header size calculation</title>
<updated>2026-07-27T12:42:24+00:00</updated>
<author>
<name>Denis V. Lunev</name>
<email>den@openvz.org</email>
</author>
<published>2026-07-22T16:54:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=21a77a215809beafad1c4bfd12e691ec058eb6d0'/>
<id>urn:sha1:21a77a215809beafad1c4bfd12e691ec058eb6d0</id>
<content type='text'>
parallels_open() caches bat_entry_off(s-&gt;bat_size) - a uint32_t -
in a plain int before it feeds into s-&gt;header_size. Near the
"Catalog too large" bound the value exceeds INT_MAX and overflows
on assignment.

Match the cached value's type to bat_entry_off()'s return type.

Signed-off-by: Denis V. Lunev &lt;den@openvz.org&gt;
CC: Thomas Huth &lt;thuth@redhat.com&gt;
CC: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Allow drivers to control protocol prefix at creation</title>
<updated>2025-11-11T21:06:09+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2025-09-15T21:37:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=1bd7bfbc2ba3ed767eaff3bd73f598e877b30f28'/>
<id>urn:sha1:1bd7bfbc2ba3ed767eaff3bd73f598e877b30f28</id>
<content type='text'>
This patch is pure refactoring: instead of hard-coding permission to
use a protocol prefix when creating an image, the drivers can now pass
in a parameter, comparable to what they could already do for opening a
pre-existing image.  This patch is purely mechanical (all drivers pass
in true for now), but it will enable the next patch to cater to
drivers that want to differ in behavior for the primary image vs. any
secondary images that are opened at the same time as creating the
primary image.

Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Message-ID: &lt;20250915213919.3121401-5-eblake@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Expand block status mode from bool to flags</title>
<updated>2025-05-14T20:33:34+00:00</updated>
<author>
<name>Eric Blake</name>
<email>eblake@redhat.com</email>
</author>
<published>2025-05-09T20:40:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=c33159dec79069514f78faecfe268439226b0f5b'/>
<id>urn:sha1:c33159dec79069514f78faecfe268439226b0f5b</id>
<content type='text'>
This patch is purely mechanical, changing bool want_zero into an
unsigned int for bitwise-or of flags.  As of this patch, all
implementations are unchanged (the old want_zero==true is now
mode==BDRV_WANT_PRECISE which is a superset of BDRV_WANT_ZERO); but
the callers in io.c that used to pass want_zero==false are now
prepared for future driver changes that can now distinguish bewteen
BDRV_WANT_ZERO vs. BDRV_WANT_ALLOCATED.  The next patch will actually
change the file-posix driver along those lines, now that we have
more-specific hints.

As for the background why this patch is useful: right now, the
file-posix driver recognizes that if allocation is being queried, the
entire image can be reported as allocated (there is no backing file to
refer to) - but this throws away information on whether the entire
image reads as zero (trivially true if lseek(SEEK_HOLE) at offset 0
returns -ENXIO, a bit more complicated to prove if the raw file was
created with 'qemu-img create' since we intentionally allocate a small
chunk of all-zero data to help with alignment probing).  Later patches
will add a generic algorithm for seeing if an entire file reads as
zeroes.

Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Message-ID: &lt;20250509204341.3553601-16-eblake@redhat.com&gt;
</content>
</entry>
<entry>
<title>qapi: Move include/qapi/qmp/ to include/qobject/</title>
<updated>2025-02-10T14:33:16+00:00</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2024-11-18T15:12:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=407bc4bf9027f7ac4333e47cd900d773b99a23e3'/>
<id>urn:sha1:407bc4bf9027f7ac4333e47cd900d773b99a23e3</id>
<content type='text'>
The general expectation is that header files should follow the same
file/path naming scheme as the corresponding source file. There are
various historical exceptions to this practice in QEMU, with one of
the most notable being the include/qapi/qmp/ directory. Most of the
headers there correspond to source files in qobject/.

This patch corrects most of that inconsistency by creating
include/qobject/ and moving the headers for qobject/ there.

This also fixes MAINTAINERS for include/qapi/qmp/dispatch.h:
scripts/get_maintainer.pl now reports "QAPI" instead of "No
maintainers found".

Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Reviewed-by: Zhao Liu &lt;zhao1.liu@intel.com&gt;
Acked-by: Halil Pasic &lt;pasic@linux.ibm.com&gt; #s390x
Signed-off-by: Markus Armbruster &lt;armbru@redhat.com&gt;
Message-ID: &lt;20241118151235.2665921-2-armbru@redhat.com&gt;
[Rebased]
</content>
</entry>
<entry>
<title>parallels: fix ext_off assertion failure due to overflow</title>
<updated>2025-01-30T20:22:28+00:00</updated>
<author>
<name>Denis Rastyogin</name>
<email>gerben@altlinux.org</email>
</author>
<published>2024-12-12T10:41:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=58607752d173438994d28dea7e2c2587726663e6'/>
<id>urn:sha1:58607752d173438994d28dea7e2c2587726663e6</id>
<content type='text'>
This error was discovered by fuzzing qemu-img.

When ph.ext_off has a sufficiently large value, the operation
le64_to_cpu(ph.ext_off) &lt;&lt; BDRV_SECTOR_BITS in
parallels_read_format_extension() can cause an overflow in int64_t.
This overflow triggers the assert(ext_off &gt; 0)
check in block/parallels-ext.c: parallels_read_format_extension(),
leading to a crash.

This commit adds a check to prevent overflow when shifting ph.ext_off
by BDRV_SECTOR_BITS, ensuring that the value remains within a valid range.

Reported-by: Leonid Reviakin &lt;L.reviakin@fobos-nt.ru&gt;
Signed-off-by: Denis Rastyogin &lt;gerben@altlinux.org&gt;
Reviewed-by: Denis V. Lunev &lt;den@openvz.org&gt;
Message-ID: &lt;20241212104212.513947-2-gerben@altlinux.org&gt;
Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
</content>
</entry>
<entry>
<title>include: Rename sysemu/ -&gt; system/</title>
<updated>2024-12-20T16:44:56+00:00</updated>
<author>
<name>Philippe Mathieu-Daudé</name>
<email>philmd@linaro.org</email>
</author>
<published>2024-12-03T14:20:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/virt/qemu/qemu.git/commit/?id=32cad1ffb81dcecf6f4a8af56d6e5892682839b1'/>
<id>urn:sha1:32cad1ffb81dcecf6f4a8af56d6e5892682839b1</id>
<content type='text'>
Headers in include/sysemu/ are not only related to system
*emulation*, they are also used by virtualization. Rename
as system/ which is clearer.

Files renamed manually then mechanical change using sed tool.

Signed-off-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Reviewed-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Tested-by: Lei Yang &lt;leiyang@redhat.com&gt;
Message-Id: &lt;20241203172445.28576-1-philmd@linaro.org&gt;
</content>
</entry>
</feed>
