* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
@ 2010-04-14 20:19 ` Kay Sievers
2010-04-14 21:55 ` Shi Jin
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Kay Sievers @ 2010-04-14 20:19 UTC (permalink / raw)
To: linux-hotplug
On Wed, Apr 14, 2010 at 21:10, Shi Jin <jinzishuai@gmail.com> wrote:
> I am running KVM virtual machines and with libvirt, I am able to
> attach volumes to the running VM instance.
> However, it turned out that different latest Linux distributions have
> different results on getting the volume live.
>
> I've tried Fedora Core 12, Ubuntu 9.10 and CentOS 5.4. Only FC12 is
> able to see the attached volume right away.
> Ubuntu and CentOS need to be rebooted to see the newly attached volumes.
>
> In my understanding, all three distributions are running udev now and
> I think udev is what is responsible for hot plug devices.
> Am I right?
>
> I suspected this is caused by the udev kernel configurations.
> Therefore, I obtained the FC12 kernel source and build them and
> installed the newly built kernel onto my Ubuntu 9.10 and CentOS 5.4
> VMs and viola, they both work with live attached volumes seen
> immediately, no need for reboot.
>
> So it is confirmed it is the kernel that matters here, instead of user
> space software. However, I googled around and found that to enable
> udev, we need the following kernel options:
Check "dmsg" if the kernel sees the new device. If it does, it's
probably a pure userspace issue.
Kay
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
2010-04-14 20:19 ` Kay Sievers
@ 2010-04-14 21:55 ` Shi Jin
2010-04-15 4:47 ` Kay Sievers
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Shi Jin @ 2010-04-14 21:55 UTC (permalink / raw)
To: linux-hotplug
>
> Check "dmsg" if the kernel sees the new device. If it does, it's
> probably a pure userspace issue.
>
> Kay
>
Thank Kay. Yes, I did check dmesg. In fact, this is how I know it when
hot plug works.
On ubuntu 9.10 and centos 5.4, the dmesg shows nothing while in FC12,
it shows messages like
[265565.693825] pci 0000:00:06.0: reg 10 io port: [0x00-0x3f]
[265565.694573] pci 0000:00:02.0: BAR 6: bogus alignment [0x0-0x0] flags 0x2
[265565.694640] decode_hpp: Could not get hotplug parameters. Use defaults
[265565.701747] virtio-pci 0000:00:06.0: enabling device (0000 -> 0001)
[265565.702059] ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
[265565.702077] virtio-pci 0000:00:06.0: PCI INT A -> Link[LNKB] ->
GSI 11 (level, high) -> IRQ 11
[265565.702634] vdb: vdb1 vdb2
Thanks.
--
Shi Jin, Ph.D.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
2010-04-14 20:19 ` Kay Sievers
2010-04-14 21:55 ` Shi Jin
@ 2010-04-15 4:47 ` Kay Sievers
2010-04-15 14:37 ` Shi Jin
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Kay Sievers @ 2010-04-15 4:47 UTC (permalink / raw)
To: linux-hotplug
On Wed, Apr 14, 2010 at 23:55, Shi Jin <jinzishuai@gmail.com> wrote:
> Thank Kay. Yes, I did check dmesg. In fact, this is how I know it when
> hot plug works.
> On ubuntu 9.10 and centos 5.4, the dmesg shows nothing while in FC12,
> it shows messages like
> [265565.693825] pci 0000:00:06.0: reg 10 io port: [0x00-0x3f]
> [265565.694573] pci 0000:00:02.0: BAR 6: bogus alignment [0x0-0x0] flags 0x2
> [265565.694640] decode_hpp: Could not get hotplug parameters. Use defaults
> [265565.701747] virtio-pci 0000:00:06.0: enabling device (0000 -> 0001)
> [265565.702059] ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11
> [265565.702077] virtio-pci 0000:00:06.0: PCI INT A -> Link[LNKB] ->
> GSI 11 (level, high) -> IRQ 11
> [265565.702634] Â vdb: vdb1 vdb2
You can run:
udevadm monitor
add a volume to the host and check if you get events for new block
devices. If you do, it's an issue with userspace in the system.
Kay
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (2 preceding siblings ...)
2010-04-15 4:47 ` Kay Sievers
@ 2010-04-15 14:37 ` Shi Jin
2010-04-15 15:21 ` Kay Sievers
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Shi Jin @ 2010-04-15 14:37 UTC (permalink / raw)
To: linux-hotplug
> You can run:
> Â udevadm monitor
> add a volume to the host and check if you get events for new block
> devices. If you do, it's an issue with userspace in the system.
>
> Kay
>
Thank you Kay.
This is useful tool but it again confirmed my conjecture of this being
an kernel issue.
On FC12 where it is working, I do the a add and remove messages.
But on Ubuntu 9.10 and CentOS 5.4, I don't see any message.
So it is a kernel problem. Anything I can do?
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (3 preceding siblings ...)
2010-04-15 14:37 ` Shi Jin
@ 2010-04-15 15:21 ` Kay Sievers
2010-04-15 18:28 ` Jim Paris
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Kay Sievers @ 2010-04-15 15:21 UTC (permalink / raw)
To: linux-hotplug
On Thu, Apr 15, 2010 at 16:37, Shi Jin <jinzishuai@gmail.com> wrote:
>> You can run:
>> Â udevadm monitor
>> add a volume to the host and check if you get events for new block
>> devices. If you do, it's an issue with userspace in the system.
> Thank you Kay.
> This is useful tool but it again confirmed my conjecture of this being
> an kernel issue.
> On FC12 where it is working, I do the a add and remove messages.
> But on Ubuntu 9.10 and CentOS 5.4, I don't see any message.
>
> So it is a kernel problem. Anything I can do?
Yeah, looks like some kernel hotplug driver issue. Probably related to
the virtio driver or something related to that infrastructure. There
is not much on the generic part which plugs in udev which can be
configured in the kernel.
Kay
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (4 preceding siblings ...)
2010-04-15 15:21 ` Kay Sievers
@ 2010-04-15 18:28 ` Jim Paris
2010-04-15 18:35 ` Shi Jin
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jim Paris @ 2010-04-15 18:28 UTC (permalink / raw)
To: linux-hotplug
Shi Jin wrote:
> > You can run:
> > udevadm monitor
> > add a volume to the host and check if you get events for new block
> > devices. If you do, it's an issue with userspace in the system.
> >
> > Kay
> >
>
> Thank you Kay.
> This is useful tool but it again confirmed my conjecture of this being
> an kernel issue.
> On FC12 where it is working, I do the a add and remove messages.
> But on Ubuntu 9.10 and CentOS 5.4, I don't see any message.
>
> So it is a kernel problem. Anything I can do?
Check that PCI hotplug is enabled in your guest kernels?
-jim
> Thanks.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (5 preceding siblings ...)
2010-04-15 18:28 ` Jim Paris
@ 2010-04-15 18:35 ` Shi Jin
2010-04-15 18:42 ` Jim Paris
2010-04-15 19:10 ` Shi Jin
8 siblings, 0 replies; 10+ messages in thread
From: Shi Jin @ 2010-04-15 18:35 UTC (permalink / raw)
To: linux-hotplug
> Check that PCI hotplug is enabled in your guest kernels?
>
> -jim
>
Thanks Jim.
The things I think import are all checked. Here is what the
config-2.6.28-14-generic for the ubuntu 9.10 kernel
[cloudadmin@node2 ubuntu9.04]$ grep UEVENT config-2.6.28-14-generic
CONFIG_DM_UEVENT=y
CONFIG_UEVENT_HELPER_PATH=""
[cloudadmin@node2 ubuntu9.04]$ grep SYSFS config-2.6.28-14-generic
CONFIG_ACPI_SYSFS_POWER=y
CONFIG_GPIO_SYSFS=y
CONFIG_RTC_INTF_SYSFS=y
CONFIG_SYSFS=y
# CONFIG_SYSFS_DEPRECATED_V2 is not set
CONFIG_VIDEO_PVRUSB2_SYSFS=y
CONFIG_WIRELESS_EXT_SYSFS=y
[cloudadmin@node2 ubuntu9.04]$ grep HOTPLUG_PCI config-2.6.28-14-generic
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=m
CONFIG_HOTPLUG_PCI_ACPI_IBM=m
CONFIG_HOTPLUG_PCI_COMPAQ=m
CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y
CONFIG_HOTPLUG_PCI_CPCI=y
CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
CONFIG_HOTPLUG_PCI_FAKE=m
CONFIG_HOTPLUG_PCI_IBM=m
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_HOTPLUG_PCI_SHPC=m
[cloudadmin@node2 ubuntu9.04]$ grep HOTPLUG= config-2.6.28-14-generic
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_HOTPLUG=y
Do you see anything that should have been there in order for the udev to work?
Thank you very much.
Shi
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (6 preceding siblings ...)
2010-04-15 18:35 ` Shi Jin
@ 2010-04-15 18:42 ` Jim Paris
2010-04-15 19:10 ` Shi Jin
8 siblings, 0 replies; 10+ messages in thread
From: Jim Paris @ 2010-04-15 18:42 UTC (permalink / raw)
To: linux-hotplug
Shi Jin wrote:
> [cloudadmin@node2 ubuntu9.04]$ grep HOTPLUG_PCI config-2.6.28-14-generic
> CONFIG_HOTPLUG_PCI=y
> CONFIG_HOTPLUG_PCI_ACPI=m
> CONFIG_HOTPLUG_PCI_ACPI_IBM=m
> CONFIG_HOTPLUG_PCI_COMPAQ=m
> CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=y
> CONFIG_HOTPLUG_PCI_CPCI=y
> CONFIG_HOTPLUG_PCI_CPCI_GENERIC=m
> CONFIG_HOTPLUG_PCI_CPCI_ZT5550=m
> CONFIG_HOTPLUG_PCI_FAKE=m
> CONFIG_HOTPLUG_PCI_IBM=m
> CONFIG_HOTPLUG_PCI_PCIE=y
> CONFIG_HOTPLUG_PCI_SHPC=m
..
> Do you see anything that should have been there in order for the udev to work?
Make sure those things built as modules are actually loaded (probably
acpi_pcihp for the kvm case). Other than that, you have a working
kernel config and a non-working kernel config, so by changing them one
step at a time to be more in sync (including loaded module lists), you
should eventually be able to track down the difference...
-jim
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: hotplug virtual disk to a Linux guest virtual machine with udev
2010-04-14 19:10 hotplug virtual disk to a Linux guest virtual machine with udev Shi Jin
` (7 preceding siblings ...)
2010-04-15 18:42 ` Jim Paris
@ 2010-04-15 19:10 ` Shi Jin
8 siblings, 0 replies; 10+ messages in thread
From: Shi Jin @ 2010-04-15 19:10 UTC (permalink / raw)
To: linux-hotplug
> Make sure those things built as modules are actually loaded (probably
> acpi_pcihp for the kvm case). Â Other than that, you have a working
> kernel config and a non-working kernel config, so by changing them one
> step at a time to be more in sync (including loaded module lists), you
> should eventually be able to track down the difference...
>
> -jim
>
Thank you very much Jim. You are right on.
If I simply do a "modprobe acpiphp" before plugging the volumes, it works.
Thanks everyone.
--
Shi Jin, Ph.D.
^ permalink raw reply [flat|nested] 10+ messages in thread