WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xen_emul_unplug on xen 4.1, HVM guest 2.6.38

To: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] xen_emul_unplug on xen 4.1, HVM guest 2.6.38
From: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
Date: Thu, 27 Oct 2011 16:46:55 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>, Alex Bligh <alex@xxxxxxxxxxx>, Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Thu, 27 Oct 2011 07:47:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <alpine.DEB.2.00.1110271522020.3519@kaball-desktop>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <0050AA2F452257584F0AAA0B@xxxxxxxxxxxx> <20111026134942.GB31609@xxxxxxxxxxxxxxxxxxx> <20111026141233.GJ12984@xxxxxxxxxxx> <F1E068D49F012116597572D1@xxxxxxxxxxxx> <1319641004.9436.35.camel@xxxxxxxxxxxxxxxxxxxxxx> <AEAE0D618F71583484DA951D@xxxxxxxxxxxx> <1319647412.9436.50.camel@xxxxxxxxxxxxxxxxxxxxxx> <4EA91023.5000201@xxxxxxxxxxxxx> <alpine.DEB.2.00.1110271436100.3519@kaball-desktop> <4EA96097.5000603@xxxxxxxxxxxxx> <alpine.DEB.2.00.1110271505010.3519@kaball-desktop> <4EA96711.9000302@xxxxxxxxxxxxx> <alpine.DEB.2.00.1110271522020.3519@kaball-desktop>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
On 27.10.2011 16:25, Stefano Stabellini wrote:
> On Thu, 27 Oct 2011, Stefan Bader wrote:
>> On 27.10.2011 16:08, Stefano Stabellini wrote:
>>> On Thu, 27 Oct 2011, Stefan Bader wrote:
>>>> 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.
>>>>
>>>
>>> Why are you passing xen_emul_unplug=unnecessary?
>>> The idea is that if you pass that option you have to use the emulated
>>> path to access your disk unless you esplicitely add an xvd disk to your
>>> config.
>>> (and force the blkfront to get loaded but that is some other patches missing
>>> In the normal case, if you don't specify xen_emul_unplug, you are going
>>> to get xvda for your hda disk.
>>> Then if you use LABEL or UUID in your root= argument, you don't need to
>>> change any configuration to make it work.
>>
>> Because of the above I have to specify the xen_emul_unplug to get *any* 
>> device.
> 
> Why?
> If you do *not* specify xen_emul_unplug, you should get /dev/xvda
> (provided you have blkfront available and hda in your disk config line).
> 
Ah! Sorry, yes. I think I remember now how my confusion started. While trying to
find the lost interrupt problem for the network devices I had two of them
configured (8139cp and e1000) and during those tests there was no way I was able
to get any xvd device. But that was because for some reason with both NICs the
pci device would fail to get an IRQ, so xenbus was never started.

Removing the second NIC made the pci device work, but then with allowing unplug,
there was still some problem with the pv nic not working. So I probably ended up
with the unnecessary, and when the disk finally worked when defined as xvda, and
I was already too confused by other things to realize that that segment only
applies for the unecessary case. :/

> 
>> If I do not specify anything, then (because pci and pv driver are available) 
>> the
>> emulated disk gets unplugged. Ok. But then the probe does not give me any xvd
>> because the major does not match.
> 
> that is only because you passed xen_emul_unplug=unnecessary; you
> shouldn't do that
> 
>> The only form I could make this work was: use xvda in the config file.
> 
> you should use hda in the disk config line, and then configure the guest
> kernel root= argument with /dev/xvda1 directly or LABEL or UUID
> (better).


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>