You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/include/system
Stefan Hajnoczi d704a13d2c block: use pwrite_zeroes_alignment when writing first sector
Since commit 5634622bcb ("file-posix: allow BLKZEROOUT with -t
writeback"), qemu-img create errors out on a Linux loop block device
with a 4 KB sector size:

  # dd if=/dev/zero of=blockfile bs=1M count=1024
  # losetup --sector-size 4096 /dev/loop0 blockfile
  # qemu-img create -f raw /dev/loop0 1G
  Formatting '/dev/loop0', fmt=raw size=1073741824
  qemu-img: /dev/loop0: Failed to clear the new image's first sector: Invalid argument

Use the pwrite_zeroes_alignment block limit to avoid misaligned
fallocate(2) or ioctl(BLKZEROOUT) in the block/file-posix.c block
driver.

Cc: qemu-stable@nongnu.org
Fixes: 5634622bcb ("file-posix: allow BLKZEROOUT with -t writeback")
Reported-by: Jean-Louis Dupond <jean-louis@dupond.be>
Buglink: https://gitlab.com/qemu-project/qemu/-/issues/3127
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20251007141700.71891-3-stefanha@redhat.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2 days ago
..
accel-blocker.h
accel-irq.h hw/intc: Generalize APIC helper names from kvm_* to accel_* 2 months ago
address-spaces.h include/system: Move exec/address-spaces.h to system/address-spaces.h 7 months ago
arch_init.h system: Replace arch_type global by qemu_arch_available() helper 9 months ago
balloon.h
block-backend-common.h
block-backend-global-state.h block-backend: mark blk_io_limits_disable() as GRAPH_UNLOCKED 5 months ago
block-backend-io.h block: use pwrite_zeroes_alignment when writing first sector 2 days ago
block-backend.h
block-ram-registrar.h
blockdev.h
confidential-guest-support.h backends/confidential-guest-support: Add set_guest_policy() function 5 months ago
cpu-throttle.h
cpu-timers-internal.h
cpu-timers.h include/exec: Split out icount.h 7 months ago
cpus.h bsd-user, linux-user: introduce qemu_process_cpu_events 2 months ago
cryptodev-vhost-user.h
cryptodev-vhost.h
cryptodev.h
device_tree.h hw: Centralize handling of -machine dumpdtb option 9 months ago
dirtylimit.h
dirtyrate.h
dma.h include/system: Move exec/address-spaces.h to system/address-spaces.h 7 months ago
dump-arch.h
dump.h
event-loop-base.h
host_iommu_device.h vfio/iommufd: Save vendor specific device info 6 months ago
hostmem.h include/system: Move exec/memory.h to system/memory.h 7 months ago
hvf.h accel/hvf: Restrict internal declarations 5 months ago
hvf_int.h accel/hvf: Restrict ARM specific fields of AccelCPUState 4 weeks ago
hw_accel.h qapi/accel: Allow to query mshv capabilities 2 months ago
igvm-cfg.h sev: Provide sev_features flags from IGVM VMSA to KVM_SEV_INIT2 5 months ago
igvm.h igvm: add support for initial register state load in native mode 3 weeks ago
iommufd.h system/iommufd: Use uint64_t type for IOVA mapping size 2 months ago
ioport.h include/system: Move exec/ioport.h to system/ioport.h 7 months ago
iothread.h
kvm.h accel/kvm: Introduce KvmPutState enum 1 month ago
kvm_int.h accel: Extract AccelClass definition to 'accel/accel-ops.h' 4 months ago
kvm_xen.h
memory.h system/physmem: Pass address space argument to cpu_flush_icache_range() 2 months ago
memory_mapping.h
mshv.h target/i386/mshv: Implement mshv_store_regs() 2 months ago
mshv_int.h target/i386/mshv: Use preallocated page for hvcall 2 months ago
numa.h
nvmm.h accel/nvmm: Expose nvmm_enabled() to common code 5 months ago
os-posix.h os: add an ability to lock memory on_fault 10 months ago
os-wasm.h include/qemu/osdep.h: Add Emscripten-specific OS dependencies 7 months ago
os-win32.h error: Kill @error_warn 2 months ago
physmem.h system/physmem: Extract API out of 'system/ram_addr.h' header 2 months ago
qtest.h char: rename CharBackend->CharFrontend 4 weeks ago
ram_addr.h system/physmem: Extract API out of 'system/ram_addr.h' header 2 months ago
ramblock.h system/ramblock: Move RAMBlock helpers out of "system/ram_addr.h" 2 months ago
replay.h audio: move audio.h under include/qemu/ 4 weeks ago
reset.h
rng-random.h
rng.h
rtc.h
runstate-action.h
runstate.h Accelerators patches 4 months ago
seccomp.h
spdm-socket.h spdm: define SPDM transport enum types 4 weeks ago
stats.h
system.h system: drop the -old-param option 2 months ago
tcg.h tcg: Move qemu_tcg_mttcg_enabled() to 'system/tcg.h' 7 months ago
tpm.h
tpm_backend.h
tpm_util.h
vhost-user-backend.h char: rename CharBackend->CharFrontend 4 weeks ago
watchdog.h
whpx.h accel/whpx: Expose whpx_enabled() to common code 5 months ago
xen-mapcache.h system/xen: remove inline stubs 7 months ago
xen.h meson: Only allow CONFIG_USER_ONLY from certain source sets 7 months ago