WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] modules and hypercall

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] modules and hypercall
From: Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxxxx>
Date: Tue, 9 Dec 2003 02:49:22 -0500
Delivery-date: Tue, 09 Dec 2003 07:50:14 +0000
Envelope-to: steven.hand@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: Internet Messaging Program (IMP) 3.1
Hello,

I'm trying to write a module to play with hypercall. So I wrote the following
module:

-------------------------xvifgetinfo.c----------------
/*
 * xvifgetinfo.c
 * 
 * The routines in this file are used to get information about virtual
 * network interface provide by Xen. 
 * 
 */

#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>

#include <hypervisor-ifs/hypervisor-if.h>
#include <hypervisor-ifs/network.h>

/**
 * init_xvifgetinfo() - this function is called when module is loaded
 * 
 * Description: We try to get information concerning the vif #1 
 *              in domain #0
 */
static int __init init_xvifgetinfo(void)
{
        network_op_t netop;
        long res;

        printk(KERN_INFO "init_xvifgetinfo: Loaded\n");

        netop.cmd = NETWORK_OP_VIFGETINFO;
        netop.u.vif_getinfo.domain = 0;
        netop.u.vif_getinfo.vif = 1;

        res = HYPERVISOR_network_op(&netop);
        if (res < 0) {
                printk(KERN_INFO "init_xvifgetinfo: HYPERVISOR_network_op error
%ld\n", res)
;
                return res;
        }

        return 0;
}

/**
 * cleanup_xvifgetinfo() - this function is called when the module 
 *                    is unloading. 
 */
static void __exit cleanup_xvifgetinfo(void)
{
        /* Nothing to do */
        printk(KERN_INFO "init_xvifgetinfo: Unloaded\n");
}

module_init(init_xvifgetinfo);
module_exit(cleanup_xvifgetinfo);

-------------------------xvifgetinfo.c----------------

I compiled with the following command:
cc -D__KERNEL__  \
   -DMODULE -I/home/guill/dcl/xeno/xeno-unstable.bk/linux-2.4.22/include \
   -I/home/guill/dcl/xeno/xeno-unstable.bk/xen/include \
   -Wall   -c -o xvifgetinfo.o xvifgetinfo.c

The following error is raised when I load the module from domain0:

init_xvifgetinfo: Loaded
init_xvifgetinfo: HYPERVISOR_network_op error -38

Error 38 means that function is not implemented. However, it seems that
the function is implemented. Is it possible to use a module that uses 
hypercall? 

Thanks 
Guillaume




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>