diff mbox

[3/3] ide: export rotational qdev property

Message ID 20170506124314.23354-3-aurelien@aurel32.net (mailing list archive)
State New, archived
Headers show

Commit Message

Aurelien Jarno May 6, 2017, 12:43 p.m. UTC
Export the rotational qdev property in the IDENTIFY request.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 hw/ide/core.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Philippe Mathieu-Daudé May 6, 2017, 4:11 p.m. UTC | #1
On 05/06/2017 09:43 AM, Aurelien Jarno wrote:
> Export the rotational qdev property in the IDENTIFY request.
>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  hw/ide/core.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 0b48b64d3a..1aa76b0d90 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -191,6 +191,9 @@ static void ide_identify(IDEState *s)
>      if (dev && dev->conf.discard_granularity) {
>          put_le16(p + 169, 1); /* TRIM support */
>      }
> +    if (dev && !dev->conf.rotational) {
> +        put_le16(p + 217, 1); /* non-rotating device */
> +    }
>
>      ide_identify_size(s);
>      s->identify_set = 1;
>
John Snow May 8, 2017, 2:50 p.m. UTC | #2
On 05/06/2017 08:43 AM, Aurelien Jarno wrote:
> Export the rotational qdev property in the IDENTIFY request.
> 
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  hw/ide/core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 0b48b64d3a..1aa76b0d90 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -191,6 +191,9 @@ static void ide_identify(IDEState *s)
>      if (dev && dev->conf.discard_granularity) {
>          put_le16(p + 169, 1); /* TRIM support */
>      }
> +    if (dev && !dev->conf.rotational) {
> +        put_le16(p + 217, 1); /* non-rotating device */
> +    }
>  
>      ide_identify_size(s);
>      s->identify_set = 1;
> 

7.16.7.80 Word 217: Nominal media rotation rate
Word 217 is a copy of Nominal Media Rotation Rate (see A.11.5.4).

*flips page like it's a choose-your-own-adventure book*

OK, so 0x0001 just means "Non-rotational." I guess it probably does not
matter that our default is "Rate not reported."

Looks like there's no relevant bits for packet identify data either, so:

Acked-by: John Snow <jsnow@redhat.com>


A question about the series as a whole, though: if by default rotational
is set to false, we will newly be setting this bit in IDENTIFY data with
identical CLI invocations. Why is that OK?
diff mbox

Patch

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 0b48b64d3a..1aa76b0d90 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -191,6 +191,9 @@  static void ide_identify(IDEState *s)
     if (dev && dev->conf.discard_granularity) {
         put_le16(p + 169, 1); /* TRIM support */
     }
+    if (dev && !dev->conf.rotational) {
+        put_le16(p + 217, 1); /* non-rotating device */
+    }
 
     ide_identify_size(s);
     s->identify_set = 1;