[libvirt PATCH 1/2] conf: add support for disk "rotation_rate" property

Daniel P. Berrangé berrange at redhat.com
Thu Apr 1 08:08:56 UTC 2021


On Thu, Apr 01, 2021 at 10:18:11AM +0800, Han Han wrote:
> On Wed, Mar 31, 2021 at 5:51 PM Daniel P. Berrangé <berrange at redhat.com>
> wrote:
> 
> > This lets the app expose the virtual SCSI or IDE disks as solid state
> > devices by setting a rate of '1', or rotational media by setting a
> > rate between 1025 and 65534.
> >
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > ---
> >  docs/formatdomain.rst         | 13 ++++++++++---
> >  docs/schemas/domaincommon.rng |  5 +++++
> >  src/conf/domain_conf.c        | 11 +++++++++++
> >  src/conf/domain_conf.h        |  1 +
> >  4 files changed, 27 insertions(+), 3 deletions(-)
> >
> > diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> > index 741130bf21..224f44a0a2 100644
> > --- a/docs/formatdomain.rst
> > +++ b/docs/formatdomain.rst
> > @@ -2372,7 +2372,7 @@ paravirtualized driver is specified via the ``disk``
> > element.
> >         <source protocol="tftp" name="url_path">
> >           <host name="hostname" port="69"/>
> >         </source>
> > -       <target dev='hdi' bus='ide' tray='open'/>
> > +       <target dev='hdi' bus='ide' tray='open' rotation_rate='7200'/>
> >         <readonly/>
> >       </disk>
> >       <disk type='block' device='lun'>
> > @@ -2385,7 +2385,7 @@ paravirtualized driver is specified via the ``disk``
> > element.
> >             <source type='unix' path='/path/to/qemu-pr-helper'
> > mode='client'/>
> >           </reservations>
> >         </source>
> > -       <target dev='sda' bus='scsi'/>
> > +       <target dev='sda' bus='scsi' rotation_rate='1'/>
> >         <address type='drive' controller='0' bus='0' target='3' unit='0'/>
> >       </disk>
> >       <disk type='block' device='disk'>
> > @@ -2885,10 +2885,17 @@ paravirtualized driver is specified via the
> > ``disk`` element.
> >     to "closed". NB, the value of ``tray`` could be updated while the
> > domain is
> >     running. The optional attribute ``removable`` sets the removable flag
> > for USB
> >     disks, and its value can be either "on" or "off", defaulting to "off".
> > +   The optional attribute ``rotation_rate`` sets the rotation rate of the
> > +   storage for disks on a SCSI, IDE, or SATA bus. Values in the range
> > 1025 to
> > +   65534 are used to indicate rotational media spee in revolutions per
> > minute.
> >
> I don't see any value range limitation in the libvirt code. Is it limited
> by qemu?

It isn't enforced by either, but these are the defined ranges in the
SCSI specs

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list