From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Bader Subject: Re: xen_emul_unplug on xen 4.1, HVM guest 2.6.38 Date: Thu, 27 Oct 2011 15:45:59 +0200 Message-ID: <4EA96097.5000603@canonical.com> References: <0050AA2F452257584F0AAA0B@nimrod.local> <20111026134942.GB31609@phenom.dumpdata.com> <20111026141233.GJ12984@reaktio.net> <1319641004.9436.35.camel@zakaz.uk.xensource.com> <1319647412.9436.50.camel@zakaz.uk.xensource.com> <4EA91023.5000201@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , "Konrad@rly45j.srv.mailcontrol.com" , Ian Campbell , Alex Bligh , Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On 27.10.2011 15:42, Stefano Stabellini wrote: > I take we are still talking about PV on HVM guests here. > > On Thu, 27 Oct 2011, Stefan Bader wrote: >> At least one part is not Ubuntu specific. And that is that the unplug logic >> decides to unplug emulated devices based on having the pci and the blkfront >> driver *available* (built-in or module). But later on the blkfront driver >> ignores all devices that are not *named* in a way to map to the xvd major. >> Which leaves you without any usable devices when you named your disk hda in >> the config file and you do not prevent unplugging. > > If you name your disk hda (as you should), blkfront is going to create > /dev/xvda in your guest. > It is not ignoring your disk, it just using "xvd" to name the device in > the guest. > > >> Still I would love to see this unplug handling become a bit more obvious. If >> unplug was successful, then blkfront should not ignore the devices. Or maybe >> just make the config more what-you-write-is-what-you-get and having hd or sd >> there only gives you emulated devices and xvd gives you pv devices. > > Yes, if the unplug is unsuccessful blkfront should not ignore the > device: it is going to create a /dev/xvd* for you. The problem I saw in my test was that in blkfront_probe the following case was hit when the device name was hda in the cfg: if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY) { int major; if (!VDEV_IS_EXTENDED(vdevice)) major = BLKIF_MAJOR(vdevice); else major = XENVBD_MAJOR; if (major != XENVBD_MAJOR) { printk(KERN_INFO "%s: HVM does not support vbd %d as xen block device\n", __FUNCTION__, vdevice); return -ENODEV; } } So major is not XENVBD_MAJOR and the device is ignored. -Stefan