From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Davis Subject: Re: CD-ROM size not updated when switching CD-ROM images. Date: Tue, 19 Oct 2010 17:03:12 -0700 (PDT) Message-ID: <511807.4805.qm@web50208.mail.re2.yahoo.com> References: 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 nm24-vm0.bullet.mail.ac4.yahoo.com ([98.139.53.222]:32183 "HELO nm24-vm0.bullet.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752840Ab0JTAJh convert rfc822-to-8bit (ORCPT ); Tue, 19 Oct 2010 20:09:37 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: I code, therefore I am --- On Tue, 10/19/10, Stefan Hajnoczi wrote: > 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 > > \ > > =A0 =A0 -boot d > > ) Hit return when prompted for extra boot parameters. > > ) Hit return when asked to select a keyboard map. > > ) Hit return at the login prompt. > > ) cat /sys/block/sr0/size: this should return > 1209360. > > ) Press Alt-Ctrl-2 to access the monitor > > ) eject ide1-cd0 > > ) change ide1-cd0 < full path name of 2nd install > disk > > > ) Press Alt-Ctrl-1 to return to the guest. > > ) dd if=3D/dev/sr0 of=3D/dev/null bs=3D512 skip=3D1209360 > count=3D3 > > =A0this should return > > =A0 3+0 records in > > =A0 3+0 records out. > > =A0instead it returns 0+0.... > > ) cat /sys/block/sr0/size: this still returns 1209360; > it should return 1376736. > > > > Oddly, when "mount /dev/sr0 ...." is =A0executed in the > guest, ls of the mounted directory shows the correct > contents for the 2nd CD. >=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. > 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