From: Ian Campbell Subject: Re: incorrect disk numbering with qemu Date: Thu, 16 Jan 2014 10:58:10 +0000 Message-ID: <1389869890.6697.6.camel@kazak.uk.xensource.com> References: <20140115171244.GA2596@aepfle.de> <1389806527.3793.106.camel@kazak.uk.xensource.com> <20140115174510.GA5171@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140115174510.GA5171@aepfle.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: Anthony Perard , Stefano Stabellini , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2014-01-15 at 18:45 +0100, Olaf Hering wrote: > On Wed, Jan 15, Ian Campbell wrote: > > > On Wed, 2014-01-15 at 18:12 +0100, Olaf Hering wrote: > > > It seems qemu does not enumerate the configured disks correctly with a > > > config like this: > > > > > > disk=[ > > > 'raw:/some.iso,hda:cdrom,r', > > > 'raw:/some.raw,xvda,w', > > > ] > > > > > > With a PV guest it works fine, the guest has a hda and xvda device. > > > But a HVM guest fails to start: > > > qemu-system-i386: -drive file=/some.raw,if=ide,index=0,media=disk,format=raw,cache=writeback: drive with bus=0, unit=0 (index=0) exists > > > > > > I think that kind of config used to work with xend. > > > > Did it? I thought xvda and hda were effectively considered two faces of > > the same device, so I'm not so sure. I'd be particularly surprised if > > this worked by design rather than coincidence. > > Putting a 'device_model_version="qemu-xen-traditional"' into the config > fixes it for me. > > So the question is how it is supposed to work. My understanding is that > for HVM some sort of IDE is (or was?) required to let it boot from a > block device. Thats why I have hd[abcd] as device name. In addition to > that one could have as many disks named xvd[abc..], which are PV only. Not quite. Each xvd[a-d] creates both a PV and an emulated IDE device hd[a-d], which refer to the same underlying volume. This allows you to boot from hda, do an unplug and then switch to using xvda. If you want a pure PV disk you should label it xvde onwards as docs/misc/vbd-interface.txt suggests. I don't think there is a way to force xvd[a-d] to be pure PV. Obviously this precludes you explicitly asking for both xvda and hda, since there will be a clash. I don't know how/why qemu-trad lets this work. > After some testing it seems that today the guest will boot from xvda, > even with qemu-xen-traditional. So basically the bogus second definition of hda as a cdrom is ignored? > So either that got fixed with libxl, or > xend from 4.2 got it all wrong. > > So what should be done with such configs, if they really exist in the > wild? > The obvious workaround is device_model_version="qemu-xen-traditional". Yes, either that or switch the disk stuff around / delete the hda. General advice would be to stick with qemu-xen-traditional for vms which were created/installed with it, unless you know the in guest OS to be fine, I suppose that could extend to this case too. Ian.