From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1CKr-0007YK-Bo for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R1CKq-0004aH-E1 for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:14:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R1CKq-0004aA-5M for qemu-devel@nongnu.org; Wed, 07 Sep 2011 03:14:12 -0400 Message-ID: <4E6719BB.802@redhat.com> Date: Wed, 07 Sep 2011 09:14:03 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1315328340-6192-1-git-send-email-armbru@redhat.com> <1315328340-6192-18-git-send-email-armbru@redhat.com> In-Reply-To: <1315328340-6192-18-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 17/27] ide/atapi: Preserve tray state on migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com, hch@lst.de 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 > --- > 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 Paolo