Skip to contentSkip to conversation

CD-ROM size not updated when switching CD-ROM images.

DISCUSSION Alex Davis 1 participant 1 message Oct 20, 2010 KVM

lore
Share & tools
lore

Alex Davis

author
#0 lore raw

I code, therefore I am

Quoted 41 lines · Alex Davis

From: Alex Davis <[email protected]>
Subject: Re: CD-ROM size not updated when switching CD-ROM images.
To: "Stefan Hajnoczi" <[email protected]>
Cc: [email protected]
Date: Tuesday, October 19, 2010, 8:03 PM
I code, therefore I am

--- On Tue, 10/19/10, Stefan Hajnoczi <[email protected]>

Quoted 2 lines · wrote:

From: Stefan Hajnoczi <[email protected]>
Subject: Re: CD-ROM size not updated when switching

CD-ROM images.

Quoted 8 lines

To: "Alex Davis" <[email protected]>
Cc: [email protected]
Date: Tuesday, October 19, 2010, 4:31 AM

Quoted 2 lines · Alex Davis

Steps to reproduce:
) Download the first two Slackware-13.1 32-bit

CD-ROM

Quoted 10 lines

ISO images.

Quoted 3 lines

) Start KVM with the following command
  qemu-system-x86_64 -m 1024M \
    -cdrom < full path of 1st install disk

\

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.

Quoted 1 line

You ejected the CD-ROM on the QEMU side, the guest

doesn't

Quoted 4 lines

necessarily
know about the medium change.  What happens when you use "eject
/dev/sr0" inside the guest instead?

Quoted 13 lines

I get a 'no medium found' error from the 'dd..' command. After
going into the the monitor, ejecting and reloading the disk,
I still get the size of the first disk in the guest.

Quoted 6 lines

I don't know how CD-ROM media change works on real hardware, but that
is the behavior that QEMU should be following.

Stefan

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.