# system init issue...KVM heartburn (ok, now resolved)

## dvh

I initially posted my issue at the tail end of the discussion of another problem I had resolved.  Bad idea...I think my current issue was hidden behind a lot of the previous exchange.  I have a current issue related to system startup, which seems to have to do with the creation of the /sys directory...

so I have had KVM working great for a few days now, on a dual-boot Mac mini. I rebooted into OSX to take care of some other documentation task, and when I reboot now into my Gentoo-supported KVM system, I can no longer start a VM that was working prior...and I don't believe that I changed ANYTHING. when I try to start a VM, I get this message: 

```
gentoo-64-kvm dvh # virsh start a64-vdi 

error: Failed to start domain a64-vdi 

error: internal error Process exited while reading console log output: libvir: error : cannot open /sys/devices/system/cpu/cpu1/online: No such file or directory 
```

looking at the subject directory, I see this: 

```
gentoo-64-kvm cpu # pwd 

/sys/devices/system/cpu 

gentoo-64-kvm cpu # ls 

cpu0  cpu1  cpufreq  cpuidle  kernel_max  offline  online  perf_events  possible  present 
```

then... 

```
gentoo-64-kvm cpu1 # pwd 

/sys/devices/system/cpu/cpu1 

gentoo-64-kvm cpu1 # ls 

cache  cpufreq  cpuidle  microcode  thermal_throttle  topology 
```

so you can see that the target file "online" does not exist in this directory. I am reasonably sure that it DID exist in the past, as my VMs started fine. I believe that this entire /sys directory is created on startup using the products of I think udev. what I don't understand is why I see "online" at the cpu parent directory, but not where qemu-kvm expects it, at the cpu1 child directory. just what is it that triggers the generation of these files...and what would change that generation? if I grep the dmesg for any CPU indications, I see: 

```
dvh@gentoo-64-kvm ~ $ dmesg | grep CPU 

[    0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs 

[    0.000000] setup_percpu: NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:2 nr_node_ids:1 

[    0.000000] PERCPU: Embedded 28 pages/cpu @ffff880001a00000 s82536 r8192 d23960 u1048576 

[    0.000000] SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 

[    0.000000] RCU-based detection of stalled CPUs is enabled. 

[    0.001196] CPU: Physical Processor ID: 0 

[    0.001200] CPU: Processor Core ID: 0 

[    0.001205] mce: CPU supports 6 MCE banks 

[    0.001215] CPU0: Thermal monitoring enabled (TM2) 

[    0.018829] CPU0: Intel(R) Core(TM)2 CPU         T5600  @ 1.83GHz stepping 02 

[    0.094014] Brought up 2 CPUs 

[    0.198242] microcode: CPU0 sig=0x6f2, pf=0x20, revision=0x57 

[    0.198253] microcode: CPU1 sig=0x6f2, pf=0x20, revision=0x57 
```

so I believe that the startup process is indeed seeing two CPUs. Any ideas what might be causing this? 

-dvhLast edited by dvh on Wed Oct 20, 2010 12:39 am; edited 2 times in total

----------

## dvh

update on this issue...I reverted my version of libvirt to 0.8.3-r1, and all now seems well.  during a normal system update (emerge -puvD world) my version of libvirt was upgraded to 0.8.4.  I did not think I updated anything, but I must have.  in any case, it looks like 0.8.4 is not compatible with the kernel I am running (gentoo-2.6.34).  Does anyone know what the deal is with libvirt?

-dvh

----------

## jlandru

 *dvh wrote:*   

> update on this issue...I reverted my version of libvirt to 0.8.3-r1, and all now seems well.  during a normal system update (emerge -puvD world) my version of libvirt was upgraded to 0.8.4.  I did not think I updated anything, but I must have.  in any case, it looks like 0.8.4 is not compatible with the kernel I am running (gentoo-2.6.34).  Does anyone know what the deal is with libvirt?
> 
> -dvh

 

Recompiling the kernel with CONFIG_HOTPLUG_CPU=y solved the problem for me. 

J. Landru

----------

## dvh

thanks.  I will try this when I get back home.

----------

## dvh

...would that be the host kernel or the guest kernel?

----------

## dvh

so I recompiled the host kernel as suggested, and now I do see the file:

 *Quote:*   

> /sys/devices/system/cpu/cpu1/online

 

so it would appear that you have fixed my problem.  Thanks very much.  I have not yet updated libvirt...I think I will wait for the next stable release before I try that.

-dvh

----------

