From patchwork Thu Aug 4 21:00:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 108570 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [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 01BE2B6F62 for ; Fri, 5 Aug 2011 07:01:04 +1000 (EST) Received: from localhost ([::1]:44793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp52L-0005ju-Mu for incoming@patchwork.ozlabs.org; Thu, 04 Aug 2011 17:01:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp52G-0005jd-8g for qemu-devel@nongnu.org; Thu, 04 Aug 2011 17:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qp52F-0000YF-3x for qemu-devel@nongnu.org; Thu, 04 Aug 2011 17:00:56 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:41719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp52E-0000Xl-TU for qemu-devel@nongnu.org; Thu, 04 Aug 2011 17:00:55 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e33.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p74KqweY012200 for ; Thu, 4 Aug 2011 14:52:58 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id p74L0QHa005854 for ; Thu, 4 Aug 2011 15:00:44 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p74F0G4t031227 for ; Thu, 4 Aug 2011 09:00:16 -0600 Received: from titi.austin.ibm.com (titi.austin.ibm.com [9.53.41.164]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p74F0FOI031107; Thu, 4 Aug 2011 09:00:15 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Thu, 4 Aug 2011 16:00:14 -0500 Message-Id: <1312491614-6933-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 32.97.110.151 Cc: Paolo Bonzini , Jason Wang , Anthony Liguori , Juan Quintela Subject: [Qemu-devel] [PATCH] Revert "floppy: save and restore DIR register" 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 This reverts commit 7d905f716bea633f2836e1d661387983aacdc6d6. The use of subsections by this commit are broken because of a fundamental limitations of subsections in the current protocol. Signed-off-by: Anthony Liguori --- hw/fdc.c | 51 +-------------------------------------------------- 1 files changed, 1 insertions(+), 50 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index edf0360..9fdbc75 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -36,7 +36,6 @@ #include "qdev-addr.h" #include "blockdev.h" #include "sysemu.h" -#include "block_int.h" /********************************************************/ /* debug Floppy devices */ @@ -83,7 +82,6 @@ typedef struct FDrive { uint8_t max_track; /* Nb of tracks */ uint16_t bps; /* Bytes per sector */ uint8_t ro; /* Is read-only */ - uint8_t media_changed; /* Is media changed */ } FDrive; static void fd_init(FDrive *drv) @@ -535,63 +533,16 @@ static CPUWriteMemoryFunc * const fdctrl_mem_write_strict[3] = { NULL, }; -static void fdrive_media_changed_pre_save(void *opaque) -{ - FDrive *drive = opaque; - - drive->media_changed = drive->bs->media_changed; -} - -static int fdrive_media_changed_post_load(void *opaque, int version_id) -{ - FDrive *drive = opaque; - - if (drive->bs != NULL) { - drive->bs->media_changed = drive->media_changed; - } - - /* User ejected the floppy when drive->bs == NULL */ - return 0; -} - -static bool fdrive_media_changed_needed(void *opaque) -{ - FDrive *drive = opaque; - - return (drive->bs != NULL && drive->bs->media_changed != 1); -} - -static const VMStateDescription vmstate_fdrive_media_changed = { - .name = "fdrive/media_changed", - .version_id = 1, - .minimum_version_id = 1, - .minimum_version_id_old = 1, - .pre_save = fdrive_media_changed_pre_save, - .post_load = fdrive_media_changed_post_load, - .fields = (VMStateField[]) { - VMSTATE_UINT8(media_changed, FDrive), - VMSTATE_END_OF_LIST() - } -}; - static const VMStateDescription vmstate_fdrive = { .name = "fdrive", .version_id = 1, .minimum_version_id = 1, .minimum_version_id_old = 1, - .fields = (VMStateField[]) { + .fields = (VMStateField []) { VMSTATE_UINT8(head, FDrive), VMSTATE_UINT8(track, FDrive), VMSTATE_UINT8(sect, FDrive), VMSTATE_END_OF_LIST() - }, - .subsections = (VMStateSubsection[]) { - { - .vmsd = &vmstate_fdrive_media_changed, - .needed = &fdrive_media_changed_needed, - } , { - /* empty */ - } } };