[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] how to acces a virtual device to a posix shared memory in

From: dykelin
Subject: [Qemu-discuss] how to acces a virtual device to a posix shared memory in the kernel module?
Date: Fri, 3 Feb 2012 22:49:42 +0800

Every one!
Does anyone read this page:


it create an pci device(vmshm) for guest linux ,and access to an posix
shared memory(share-with-qemu) on host linux,then can communication between
guest processes and host processes, on the guest there is a driver, than
when use can use like this:( userspace )

int fd = open("/dev/vshm0", O_RDWR);
if(fd < 0) {
    fprintf(stderr, "Cannot open device.\n");
if(ioctl(fd, 0, "/shared-with-qemu") != 0) {
    fprintf(stderr, "Cannot map host's shared memory object.\n");
char *shm = mmap(NULL, 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd,

my question is if I want to use this in kernel module, how to come true? I
think we can use filp_open() to open the vmshm0, right? If so ,how to
"ioctl"(how to access to the posix shared memory)? it seems not a qemu
question , if we can not ask this question here ,please forgive me .

reply via email to

[Prev in Thread] Current Thread [Next in Thread]