From: Alex Davis Subject: Re: CD-ROM size not updated when switching CD-ROM images. Date: Wed, 20 Oct 2010 05:50:50 -0700 (PDT) Message-ID: <626617.71094.qm@web50202.mail.re2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: Stefan Hajnoczi Return-path: Received: from nm22.bullet.mail.ac4.yahoo.com ([98.139.52.219]:27725 "HELO nm22.bullet.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752369Ab0JTMuw convert rfc822-to-8bit (ORCPT ); Wed, 20 Oct 2010 08:50:52 -0400 Sender: kvm-owner@vger.kernel.org List-ID: I code, therefore I am --- On Tue, 10/19/10, Alex Davis wrote: > From: Alex Davis > Subject: Re: CD-ROM size not updated when switching CD-ROM images. > To: "Stefan Hajnoczi" > Cc: kvm@vger.kernel.org > Date: Tuesday, October 19, 2010, 8:03 PM > I code, therefore I am >=20 >=20 > --- On Tue, 10/19/10, Stefan Hajnoczi > wrote: >=20 > > From: Stefan Hajnoczi > > Subject: Re: CD-ROM size not updated when switching > CD-ROM images. > > To: "Alex Davis" > > Cc: kvm@vger.kernel.org > > Date: Tuesday, October 19, 2010, 4:31 AM > > On Tue, Oct 19, 2010 at 4:43 AM, Alex > > Davis > > wrote: > > > Steps to reproduce: > > > ) Download the first two Slackware-13.1 32-bit > CD-ROM > > ISO images. > > > ) Start KVM with the following command > > > =A0 qemu-system-x86_64 -m 1024M \ > > > =A0 =A0 -cdrom < full path of 1st install disk > > > > \ > >=20 > > After changing the CD-ROM, does running "blockdev > > --rereadpt /dev/sr0" > > update the size as expected? > The install CD does not have the blockdev command. >=20 > > You ejected the CD-ROM on the QEMU side, the guest > doesn't > > necessarily > > know about the medium change.=A0 What happens when you > > use "eject > > /dev/sr0" inside the guest instead? > I get a 'no medium found' error from the 'dd..' command. > After > going into the the monitor, ejecting and reloading the > disk,=20 > I still get the size of the first disk in the guest. > >=20 > > I don't know how CD-ROM media change works on real > > hardware, but that > > is the behavior that QEMU should be following. > >=20 > > Stefan >=20 >=20 I attempted some debugging by putting a printf in the cdrom_change_cb method in hw/ide/core.c to output nr_sectors after the CD-ROM has been changed: the value is correct. So the problem seems to be that the new value isn't being propagated to the guest. =20