From patchwork Tue Apr 12 09:27:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 90754 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (unknown [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6BEE9B6F3A for ; Tue, 12 Apr 2011 19:30:19 +1000 (EST) Received: from localhost ([::1]:42687 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9ZvL-0004pr-7u for incoming@patchwork.ozlabs.org; Tue, 12 Apr 2011 05:30:15 -0400 Received: from eggs.gnu.org ([140.186.70.92]:59126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9ZtN-0002In-9R for qemu-devel@nongnu.org; Tue, 12 Apr 2011 05:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q9ZtM-0002VM-Eh for qemu-devel@nongnu.org; Tue, 12 Apr 2011 05:28:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q9ZtL-0002VH-VM for qemu-devel@nongnu.org; Tue, 12 Apr 2011 05:28:12 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3C9S9Q4006886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Apr 2011 05:28:09 -0400 Received: from localhost (dhcp193-58.pnq.redhat.com [10.65.193.58]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3C9S7K2021441; Tue, 12 Apr 2011 05:28:08 -0400 From: Amit Shah To: qemu list Date: Tue, 12 Apr 2011 14:57:44 +0530 Message-Id: <618d52d111bc5657efc46d78e76f15c80d077ac4.1302600061.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Juan Quintela , Stefan Hajnoczi , Markus Armbruster , Amit Shah , Paolo Bonzini Subject: [Qemu-devel] [PATCH v2 6/6] atapi: Save / load the new GESN event states during migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a new subsection to save and restore the events state for the GET_EVENT_STATUS_NOTIFICATION command. Signed-off-by: Amit Shah --- hw/ide/core.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 2683070..7043341 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2882,6 +2882,25 @@ static bool ide_drive_pio_state_needed(void *opaque) return (s->status & DRQ_STAT) != 0; } +static bool ide_atapi_gesn_needed(void *opaque) +{ + IDEState *s = opaque; + + return s->events.new_media || s->events.eject_request; +} + +/* Fields for GET_EVENT_STATUS_NOTIFICATION ATAPI command */ +const VMStateDescription vmstate_ide_atapi_gesn_state = { + .name ="ide_drive/atapi/gesn_state", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField []) { + VMSTATE_BOOL(events.new_media, IDEState), + VMSTATE_BOOL(events.eject_request, IDEState), + } +}; + const VMStateDescription vmstate_ide_drive_pio_state = { .name = "ide_drive/pio_state", .version_id = 1, @@ -2936,6 +2955,9 @@ const VMStateDescription vmstate_ide_drive = { .vmsd = &vmstate_ide_drive_pio_state, .needed = ide_drive_pio_state_needed, }, { + .vmsd = &vmstate_ide_atapi_gesn_state, + .needed = ide_atapi_gesn_needed, + }, { /* empty */ } }