Patchwork [25/55] ide/atapi: Switch from BlockDriverState's locked to own tray_locked

login
register
mail settings
Submitter Markus Armbruster
Date July 20, 2011, 4:23 p.m.
Message ID <1311179069-27882-26-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/105937/
State New
Headers show

Comments

Markus Armbruster - July 20, 2011, 4:23 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 hw/ide/atapi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Christoph Hellwig - July 26, 2011, 12:14 p.m.
On Wed, Jul 20, 2011 at 06:23:59PM +0200, Markus Armbruster wrote:
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  hw/ide/atapi.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 8634e6b..237657f 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -777,8 +777,9 @@  static void cmd_mode_sense(IDEState *s, uint8_t *buf)
             buf[12] = 0x71;
             buf[13] = 3 << 5;
             buf[14] = (1 << 0) | (1 << 3) | (1 << 5);
-            if (bdrv_is_locked(s->bs))
+            if (s->tray_locked) {
                 buf[6] |= 1 << 1;
+            }
             buf[15] = 0x00;
             cpu_to_ube16(&buf[16], 706);
             buf[18] = 0;