All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Bader <stefan.bader@canonical.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Alex Bligh <alex@alex.org.uk>,
	Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: xen_emul_unplug on xen 4.1, HVM guest 2.6.38
Date: Thu, 27 Oct 2011 16:46:55 +0200	[thread overview]
Message-ID: <4EA96EDF.1020107@canonical.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1110271522020.3519@kaball-desktop>

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).

  reply	other threads:[~2011-10-27 14:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-26 13:17 xen_emul_unplug on xen 4.1, HVM guest 2.6.38 Alex Bligh
2011-10-26 13:49 ` Konrad Rzeszutek Wilk
2011-10-26 14:12   ` Pasi Kärkkäinen
2011-10-26 14:47     ` Alex Bligh
2011-10-26 14:56       ` Ian Campbell
2011-10-26 15:59         ` Pasi Kärkkäinen
2011-10-26 16:22           ` Ian Campbell
2011-10-26 16:25         ` Alex Bligh
2011-10-26 16:43           ` Ian Campbell
2011-10-27  8:02             ` Stefan Bader
2011-10-27 13:42               ` Stefano Stabellini
2011-10-27 13:45                 ` Stefan Bader
2011-10-27 14:08                   ` Stefano Stabellini
2011-10-27 14:13                     ` Stefan Bader
2011-10-27 14:25                       ` Stefano Stabellini
2011-10-27 14:46                         ` Stefan Bader [this message]
2011-10-27 13:48                 ` Stefan Bader
2011-10-27 14:09                   ` Stefano Stabellini
2011-10-26 15:54       ` Pasi Kärkkäinen
  -- strict thread matches above, loose matches on Subject: below --
2011-10-26 17:43 Alex Bligh
2011-10-27  9:27 ` Ian Campbell
2011-10-27 13:13   ` Konrad Rzeszutek Wilk
2011-10-27 13:27     ` Stefano Stabellini
2011-10-27 13:35     ` Ian Campbell
2011-10-27 13:18   ` Alex Bligh
2011-10-27 13:35     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA96EDF.1020107@canonical.com \
    --to=stefan.bader@canonical.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=alex@alex.org.uk \
    --cc=konrad.wilk@oracle.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.