From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td0IJ-0002lZ-8h for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:08:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Td0IC-0004w1-5f for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:08:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21558) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Td0IB-0004vt-Tl for qemu-devel@nongnu.org; Mon, 26 Nov 2012 10:08:16 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAQF8EOu028297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 26 Nov 2012 10:08:14 -0500 Message-ID: <50B385DC.6090208@redhat.com> Date: Mon, 26 Nov 2012 16:08:12 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <874219e1a97886317415a36b767920bd8eed0748.1353518053.git.phrdina@redhat.com> <50AF6776.3030503@redhat.com> <1353933816.3370.13.camel@antique-laptop> <50B374CD.3000404@redhat.com> <1353941774.3370.21.camel@antique-laptop> In-Reply-To: <1353941774.3370.21.camel@antique-laptop> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/1] atapi: make change media detection for guests easier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: qemu-devel@nongnu.org Am 26.11.2012 15:56, schrieb Pavel Hrdina: > On Mon, 2012-11-26 at 14:55 +0100, Kevin Wolf wrote: >> Am 26.11.2012 13:43, schrieb Pavel Hrdina: >>> On Fri, 2012-11-23 at 13:09 +0100, Kevin Wolf wrote: >>>> Another thing I would consider is using cdrom_changed = 0/1/2 instead of >>>> adding fake_cdrom_eject to add another state. Migration would >>>> automatically do the right thing for it, old versions would in both 1 >>>> and 2 state switch to ASC_MEDIUM_MAY_HAVE_CHANGED next, which is correct >>>> in the latter case and is in the former case the same bug as the old >>>> qemu we're migrating to has anyway. >>>> >>> >>> I do it that way at first, but then I rewrite it, because I thought that >>> using new state would be better. But if you agree with cdrom_changed = >>> 0/1/2, I'll change it. >> >> I think it's nicer to have only one state. And if I'm not mistaken, we >> can even do without the pre_save/post_load handlers then. >> >> Kevin > > I don't think that we can do it without the pre_save/post_load handlers, > because if the cdrom_changed could be set also to 2 then in case, that > you migrate immediately after the change from "buggy" qemu to the > "fixed" qemu we have in cdrom_changed state 1, but we need state 2. But you can't tell which is the right state anyway, because the buggy qemu on your source has only one "changed" state. Choosing state 1 seems fine to me. The worst thing that can happen is that you return ASC_MEDIUM_NOT_PRESENT twice - not a big deal. > And > otherwise, if you want to migrate from "fixed" qemu to "buggy" qemu > where version_id is lower then 3, you have to set the asc to > ASC_MEDIUM_MAY_HAVE_CHANGED. This part is true. However, I'm pretty sure that migration from 1.3 to 0.11 doesn't work anyway, so why bother? Kevin