Skip to contentSkip to conversation

KQemu - devfs patch

Qemu-devel Michael Geddes 1 participant 1 message Mar 27, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

I have been very impressed with qemu, and in particular KQemu, and have got WinXP up and running (after some aborted attempts last year) with no trouble this time.

Anyway, I'm a devfs user, and until udev is a little more mature, will remain
so. Here's a wee patch to make the /dev/kqemu device appear under devfs.

Does there also need to be a sysfs patch to provide the 'dev' entry to assist with udev?

I'm not really sure of the S_IFCHR|S_IRUGO|S_IWUGO options to the devfs_mk_cdev, but it seems to work.

//.ichael G.

*** ../../kqemu/kmod.c 2005-02-11 09:09:09.000000000 +1100
--- kmod.c 2005-03-25 09:33:14.000000000 +1100
***************
*** 15,20 ****
--- 15,21 ----
#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/io.h>
+ #include <linux/devfs_fs_kernel.h>

  #include "kqemu.h"

***************
*** 303,312 ****
--- 304,315 ----
printk("KQEMU installed, max_instances=%d max_locked_mem=%dkB.\n",
KQEMU_MAX_INSTANCES,
max_locked_pages * 4);

+     devfs_mk_cdev(MKDEV(KQEMU_MAJOR,0), S_IFCHR|S_IRUGO|S_IWUGO, "kqemu");
      return 0;

}

void cleanup_module(void)

  {
      unregister_chrdev(KQEMU_MAJOR, "kqemu");

+ devfs_remove("kqemu");
}