Skip to contentSkip to conversation

KVM: s390: Module autoloading.

PATCH New Cornelia Huck 3 participants 6 messages May 27, 2013 – Jun 3, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: s390: Module autoloading.

This patch enables automatically loading the kvm module when /dev/kvm is opened, allowing distros to stop loading the module statically.

I think it is trivial enough for 3.10; otherwise, please queue this for 3.11.

Cornelia Huck (1):
KVM: s390: Add "devname:kvm" alias.

 arch/s390/kvm/kvm-s390.c | 9 +++++++++
 1 file changed, 9 insertions(+)
Signature · 1 line
1.8.1.6
#1 lore raw

PATCH 1/1 KVM: s390: Add "devname:kvm" alias.

Providing a "devname:kvm" module alias enables automatic loading of the kvm module when /dev/kvm is opened.

---
 arch/s390/kvm/kvm-s390.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/s390/kvm/kvm-s390.c +9 -0
index 93444c4..3b597e5 100644
@@ -1138,3 +1138,12 @@ static void __exit kvm_s390_exit(void)
 
 module_init(kvm_s390_init);
 module_exit(kvm_s390_exit);
+
+/*
+ * Enable autoloading of the kvm module.
+ * Note that we add the module alias here instead of virt/kvm/kvm_main.c
+ * since x86 takes a different approach.
+ */
+#include <linux/miscdevice.h>
+MODULE_ALIAS_MISCDEV(KVM_MINOR);
+MODULE_ALIAS("devname:kvm");
Signature · 1 line
1.8.1.6
maintainer
#2 lore raw

Re: [PATCH] KVM: s390: Add "devname:kvm" alias.

Il 27/05/2013 18:42, Cornelia Huck ha scritto:

Quoted 16 lines

Providing a "devname:kvm" module alias enables automatic loading of the kvm module when /dev/kvm is opened.

---
 arch/s390/kvm/kvm-s390.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/s390/kvm/kvm-s390.c +0 -0
index 93444c4..3b597e5 100644
@@ -1138,3 +1138,12 @@ static void __exit kvm_s390_exit(void)
 
 module_init(kvm_s390_init);

arch/s390/kvm/kvm-s390.c static void __exit kvm_s390_exit(void) · line 1149

Quoted 10 lines
arch/s390/kvm/kvm-s390.c +9 -0
 module_exit(kvm_s390_exit);
+
+/*
+ * Enable autoloading of the kvm module.
+ * Note that we add the module alias here instead of virt/kvm/kvm_main.c
+ * since x86 takes a different approach.
+ */
+#include <linux/miscdevice.h>
+MODULE_ALIAS_MISCDEV(KVM_MINOR);
+MODULE_ALIAS("devname:kvm");

Looks good for 3.10. Should I take this since Alex is on holiday, or should I wait for him to come back?

Paolo

maintainer Applied
#4 lore raw

Re: [PATCH] KVM: s390: Add "devname:kvm" alias.

In reply to Cornelia Huck

Il 27/05/2013 18:42, Cornelia Huck ha scritto:

Quoted 16 lines

Providing a "devname:kvm" module alias enables automatic loading of the kvm module when /dev/kvm is opened.

---
 arch/s390/kvm/kvm-s390.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/s390/kvm/kvm-s390.c +0 -0
index 93444c4..3b597e5 100644
@@ -1138,3 +1138,12 @@ static void __exit kvm_s390_exit(void)
 
 module_init(kvm_s390_init);

arch/s390/kvm/kvm-s390.c static void __exit kvm_s390_exit(void) · line 1149

Quoted 10 lines
arch/s390/kvm/kvm-s390.c +9 -0
 module_exit(kvm_s390_exit);
+
+/*
+ * Enable autoloading of the kvm module.
+ * Note that we add the module alias here instead of virt/kvm/kvm_main.c
+ * since x86 takes a different approach.
+ */
+#include <linux/miscdevice.h>
+MODULE_ALIAS_MISCDEV(KVM_MINOR);
+MODULE_ALIAS("devname:kvm");

Applied, thanks.

Paolo

maintainer
#5 lore raw

Re: [PATCH] KVM: s390: Add "devname:kvm" alias.

Il 28/05/2013 12:44, Paolo Bonzini ha scritto:

Quoted 15 lines

Il 27/05/2013 18:42, Cornelia Huck ha scritto:

Quoted 14 lines

Providing a "devname:kvm" module alias enables automatic loading of the kvm module when /dev/kvm is opened.

---
 arch/s390/kvm/kvm-s390.c | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/s390/kvm/kvm-s390.c +0 -0
index 93444c4..3b597e5 100644
@@ -1138,3 +1138,12 @@ static void __exit kvm_s390_exit(void)
 
Quoted 14 lines

arch/s390/kvm/kvm-s390.c static void __exit kvm_s390_exit(void) · line 1149

Quoted 12 lines
arch/s390/kvm/kvm-s390.c +9 -0
 module_init(kvm_s390_init);
 module_exit(kvm_s390_exit);
+
+/*
+ * Enable autoloading of the kvm module.
+ * Note that we add the module alias here instead of virt/kvm/kvm_main.c
+ * since x86 takes a different approach.
+ */
+#include <linux/miscdevice.h>
+MODULE_ALIAS_MISCDEV(KVM_MINOR);
+MODULE_ALIAS("devname:kvm");

Applied, thanks.

After discussion with Gleb, we have decided to postpone this patch to 3.11. Thanks for your understanding. :)

I'll push pending patches to master and queue soon.

Paolo