From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Amit Shah 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: Subject: [Qemu-devel] [PATCH v2 6/6] atapi: Save / load the new GESN event states during migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu list Cc: Kevin Wolf , Juan Quintela , Stefan Hajnoczi , Markus Armbruster , Amit Shah , Paolo Bonzini 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 */ } } -- 1.7.4.2