qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] question about block size and virtual disks


From: Chris Friesen
Subject: Re: [Qemu-devel] question about block size and virtual disks
Date: Fri, 21 Apr 2017 10:26:52 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 04/20/2017 03:21 PM, Eric Blake wrote:
On 04/20/2017 04:03 PM, Chris Friesen wrote:

Also, does the 4KB block size get "passed-through" to the guest somehow
so that the guest knows it needs to use 4KB blocks, or does that need to
be explicitly specified via virtio-blk-pci.logical_block_size and/or
virtio-blk-pci.physical_block_size parameters?  (Assuming I'm using
virtio-blk-pci.)

Again, qemu should be passing the advertisement of host properties down
to the guest insofar as possible (so a good guest will see that the
hardware is 4k only and will not try to make 512-byte requests), but at
the same time, qemu should handle guests that are so old that they are
blissfully unaware of the hardware advertisements and send 512-byte
requests anyway.  Of course, such guests are penalized with
read-modify-write delays when submitting 512-byte IO.  But explicitly
stating available parameters is always the wisest course of action, if
you don't want to rely on defaults changing underneath you.

I did an experiment with qemu-kvm-ev-2.6.0-28.el7_3.6.1, using -drive cache=none,aio=native and an LVM volume as the storage.

The guest saw the logical/physical block size as 512B, even though on the host both were 4KB.

Unless something is being lost in the LVM layer (which is possible) it appears that qemu defaults to 512B block size unless explicitly told otherwise.

Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]