qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 17/27] ide/atapi: Preserve tray state on migr


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 17/27] ide/atapi: Preserve tray state on migration
Date: Wed, 07 Sep 2011 09:14:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

On 09/06/2011 06:58 PM, Markus Armbruster wrote:
Use a subsection, so that migration to older version still works,
provided the tray is closed and unlocked.

Signed-off-by: Markus Armbruster<address@hidden>
---
  hw/ide/core.c |   32 ++++++++++++++++++++++++++++++++
  1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index b1a73ee..30cb7de 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2058,6 +2058,22 @@ static bool ide_drive_pio_state_needed(void *opaque)
          || (s->bus->error_status&  BM_STATUS_PIO_RETRY);
  }

+static int ide_tray_state_post_load(void *opaque, int version_id)
+{
+    IDEState *s = opaque;
+
+    bdrv_eject(s->bs, s->tray_open);
+    bdrv_lock_medium(s->bs, s->tray_locked);
+    return 0;
+}
+
+static bool ide_tray_state_needed(void *opaque)
+{
+    IDEState *s = opaque;
+
+    return s->tray_open || s->tray_locked;

I wonder if the most common case is this, or rather "tray closed and locked". Perhaps it depends (for Windows it is likely unlocked, for Linux locked). In any case there's time before 1.0 to fix this, so

Reviewed-by: Paolo Bonzini <address@hidden>

Paolo



reply via email to

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