qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 29/35] scsi-disk: remove cluster_size


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 29/35] scsi-disk: remove cluster_size
Date: Mon, 24 Oct 2011 17:36:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0

On 10/24/2011 05:10 PM, Kevin Wolf wrote:
>  -    bdrv_get_geometry(s->qdev.conf.bs,&nb_sectors);
>  -    nb_sectors /= s->cluster_size;
>  -    if (nb_sectors) {
>  -        nb_sectors--;
>  +    if (s->qdev.blocksize) {
When would it be 0? And wouldn't we crash with a zero blocksize anyway?

blocksize can be zero when passing through a removable medium and no medium has ever been inserted in the disk since the guest was started. In practice it won't crash because the guest will always send READ CAPACITY first, will see a unit attention condition, and will not attempt a read.

A more complete solution involves asking raw-posix for the logical block size (right now logical_block_size acts as both the emulated and host block size). This would also be useful to make cache=none work with 4k-sector disks without manually specifying logical_block_size. However, it's not 1.0 material.

Paolo



reply via email to

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