6 Commits

Author SHA1 Message Date
Asias He 27cead0dd2 kvm tools: Improve compat message format
---------
Before:
---------
*** Compatibility Warning ***

        virtio-blk device was not detected

While you have requested a virtio-blk device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_BLK=y enabled in its .config

*** Compatibility Warning ***

        virtio-net device was not detected

While you have requested a virtio-net device, the guest kernel did not initialize it.
Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in its .config

  # KVM session ended normally.

---------
After:
---------
  # KVM compatibility warning.
        virtio-blk device was not detected.
        While you have requested a virtio-blk device, the guest kernel did not initialize it.
        Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_BLK=y enabled in .config.

  # KVM compatibility warning.
        virtio-net device was not detected.
        While you have requested a virtio-net device, the guest kernel did not initialize it.
        Please make sure that the guest kernel was compiled with CONFIG_VIRTIO_NET=y enabled in .config.

  # KVM session ended normally.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:52 +01:00
Lai Jiangshan b24e316a7f kvm tools: remove duplicated code
Simple cleanup.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:49 +01:00
Lai Jiangshan f36b3554be kvm tools: protect shared global id in compat_mtx C.S.
The global id is shared, protect it when access it.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:49 +01:00
Lai Jiangshan 572d69b1a8 kvm tools: narrow the C.S. of compat_mtx
The allocation and the copy are not required in the C.S.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:49 +01:00
Sasha Levin 0026c9d48a kvm tools: Fix spelling mistake
Suggested-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:48 +01:00
Sasha Levin e669420730 kvm tools: Guest kernel compatability
The problem of users running kernel which wasn't built for kvm tools is
somewhat common. Usualy the result is a panic during boot and a user whos'
stuck and doesn't know what to do next.

Compatability checks try to solve this issue by giving the user a meaningfull
error message which can explain whats going on and how he can fix it.

The idea is to register the device during device init and unregister the
device when the device has been 'used'. In case the kernel didn't access
the device before the guest is shut down, the host will notify the user that
something is wrong.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
2015-06-01 16:39:47 +01:00