From: Paolo Bonzini <pbonzini@redhat.com>
To: lma <lma@suse.de>, qemu-devel@nongnu.org
Subject: Re: Questions about online resizing a lun passthrough disk with virtio-scsi
Date: Wed, 8 Jul 2020 17:11:46 +0200 [thread overview]
Message-ID: <a1d96da7-444e-d3b0-abd5-63cdab92e869@redhat.com> (raw)
In-Reply-To: <af3e33e4a5bb15d9f0b30c8de4941a37@suse.de>
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.
It's not recommended however, because block_resize will report the
change to the guest directly with a CAPACITY HAS CHANGED unit attention
condition.
Thanks,
Paolo
next prev parent reply other threads:[~2020-07-08 22:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 14:44 Questions about online resizing a lun passthrough disk with virtio-scsi lma
2020-07-08 15:11 ` Paolo Bonzini [this message]
2020-07-09 11:52 ` Lin Ma
2020-07-09 12:00 ` Paolo Bonzini
2020-07-09 12:07 ` Lin Ma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a1d96da7-444e-d3b0-abd5-63cdab92e869@redhat.com \
--to=pbonzini@redhat.com \
--cc=lma@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).