From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45822 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5YZj-0005cb-9Y for qemu-devel@nongnu.org; Fri, 01 Apr 2011 03:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5YZh-0003Ca-Ll for qemu-devel@nongnu.org; Fri, 01 Apr 2011 03:15:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5YZh-0003CV-A4 for qemu-devel@nongnu.org; Fri, 01 Apr 2011 03:15:17 -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 p317FDIY027871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Apr 2011 03:15:13 -0400 Message-ID: <4D957B7D.3060802@redhat.com> Date: Fri, 01 Apr 2011 09:15:09 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1301638940-22372-1-git-send-email-jasowang@redhat.com> In-Reply-To: <1301638940-22372-1-git-send-email-jasowang@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, quintela@redhat.com On 04/01/2011 08:22 AM, Jason Wang wrote: > + > + if (drive->bs == NULL) { > + return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no floppy? (The "media_changed == 2" in my sample code was basically a way to save the "media present" state of the drive on the source). > + } else { > + drive->bs->media_changed = drive->media_changed; > + return 0; > + } The code is also missing the case of a pc-0.14 machine. The problem here is that the pc-0.15 machine hasn't been created yet, you get the honor. :( Paolo