qemu-devel
[Top][All Lists]
Advanced

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

Re: Questions about online resizing a lun passthrough disk with virtio-s


From: Lin Ma
Subject: Re: Questions about online resizing a lun passthrough disk with virtio-scsi
Date: Thu, 09 Jul 2020 11:52:27 +0000
User-agent: Roundcube Webmail

On 2020-07-08 15:11, Paolo Bonzini wrote:
On 08/07/20 16:44, lma wrote:

Is the 'block_resize' mandatory to notify guest os after online resizing a lun passed through disk? I'm curious it because I found there're couple
of ways can make guest os realize the disk capacity change.
e.g:
* run 'block_resize' via qmp to let virtio-scsi notify the frontend about
  capacity change.
* run 'rescan-scsi-bus.sh -s' inside guest.
* run 'sg_readcap --16 /dev/sda' inside guest.

I knew that the purpose of 'block_resize' is not only to notify guest os, but also to update some internal structure's member, say bs->total_sectors. What if I forgot to run 'block_resize', but run 'rescan-scsi-bus.sh -s'
in guest?

Request start and length are checked even for passthrough disks (see
scsi_disk_dma_command in hw/scsi/scsi-disk.c, called by
scsi_block_dma_command), but the maximum LBA is snooped from READ
CAPACITY commands (see scsi_read_complete in hw/scsi/scsi-generic.c).
So as long as rescan-scsi-bus.sh results in a READ CAPACITY command, it
should work.

Yeah, the rescan-scsi-bus.sh does result in a READ CAPACITY command.

It's not recommended however, because block_resize will report the
change to the guest directly with a CAPACITY HAS CHANGED unit attention
condition.

Got it, The 'block_resize' is the recommended or necessary step, Even for
passthrough disk online resizing.

Thanks for your information,
Lin



reply via email to

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