From: "ashutosh mehra" Subject: Re: Unable to include xen/sched.h Date: Wed, 14 Nov 2007 16:51:51 +0530 Message-ID: References: <200711140934.lAE9YK3x020070@fjmscan501.ms.jp.fujitsu.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1235086785==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Atsushi SAKAI , xen-devel@lists.xensource.com, Akio Takebe List-Id: xen-devel@lists.xenproject.org --===============1235086785== Content-Type: multipart/alternative; boundary="----=_Part_24523_30849751.1195039311952" ------=_Part_24523_30849751.1195039311952 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I tried #include but I get an error: #error "domctl operations are intended for use by node control tools only" Keir, how do I add a watch on an entire path, e.g. /local/domain/? More importantly, how can I get the list of domains/domainIds of the currently running domains in a module running in dom0 kernel?? Please help, I'm looking for an answer to this since quite a few days! Thanks, Ashutosh On Nov 14, 2007 4:41 PM, Keir Fraser wrote: > But it's not particularly recommended to use domctl or sysctl interfaces > in > the dom0 kernel. Those interfaces can change. This might be acceptable for > you however, depending on your purpose. > > -- Keir > > On 14/11/07 09:34, "Atsushi SAKAI" wrote: > > > try using > > include/xen/interface/sysctl.h > > on PV kernel. > > > > Thanks > > Atsushi SAKAI > > > > > > > > "ashutosh mehra" wrote: > > > >> Any answers to this? > >> > >> On Nov 13, 2007 3:37 PM, ashutosh mehra wrote: > >> > >>> Hi, > >>> > >>> I tried including public/sysctl.h for XEN_SYSCTL_getdomaininfolist, > but > >>> I get an error: public/sysctl.h: No such file or directory. > >>> > >>> Even if the above problem is solved, how will I get the list/domainIds > of > >>> all the domUs running without using for_each_domain defined in > xen/sched.h? > >>> I get the same error for this file as well. And what should be the > >>> parameters to make for this? Currently my Makefile is obj-m := > mymodule.oand > >>> I'm running make with the parameters make -C > >>> /lib/modules/2.6.18-xen/build/ modules M=`pwd` V=1 > >>> > >>> > >>> This is the output from make: > >>> > >>> > >>> make: Entering directory > >>> `/usr/local/src/xen-3.1.0-src /build-linux-2.6.18-xen_x86_32' > >>> make -C /usr/local/src/xen-3.1.0-src/linux-2.6.18-xen > >>> O=/usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32 modules > >>> make -C /usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32 \ > >>> KBUILD_SRC=/usr/local/src/xen-3.1.0-src/linux-2.6.18-xen \ > >>> KBUILD_EXTMOD="/home/ashu/Desktop/xenmodule" -f > >>> /usr/local/src/xen-3.1.0-src/linux-2.6.18-xen/Makefile modules > >>> test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( > >>> \ > >>> echo; > \ > >>> echo " ERROR: Kernel configuration is invalid."; > \ > >>> echo " include/linux/autoconf.h or > >>> include/config/auto.conf are missing."; \ > >>> echo " Run 'make oldconfig && make prepare' on kernel > >>> src to fix it."; \ > >>> echo; > \ > >>> /bin/false) > >>> mkdir -p /home/ashu/Desktop/xenmodule/.tmp_versions > >>> rm -f /home/ashu/Desktop/xenmodule/.tmp_versions/* > >>> make -f /usr/local/src/xen-3.1.0-src/linux-2.6.18-xen > >>> /scripts/Makefile.build > >>> obj=/home/ashu/Desktop/xenmodule > >>> gcc -m32 -Wp,-MD,/home/ashu/Desktop/xenmodule/.mymodule.o.d > >>> -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.1.2/include > >>> -Iinclude2/asm/mach-xen -D__KERNEL__ -Iinclude -Iinclude2 > >>> -I/usr/local/src/xen-3.1.0-src /linux-2.6.18-xen/include -include > >>> include/linux/autoconf.h -D__XEN_INTERFACE_VERSION__=0x00030205 > >>> -I/home/ashu/Desktop/xenmodule -Wall -Wundef -Wstrict-prototypes > >>> -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float > >>> -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mregparm=3 > >>> -ffreestanding -I/usr/local/src/xen-3.1.0-src/linux-2.6.18-xen > >>> /include/asm-i386/mach-xen > >>> -Iinclude/asm-i386/mach-xen > >>> -I/usr/local/src/xen-3.1.0-src /linux-2.6.18-xen > >>> /include/asm-i386/mach-default > >>> -Iinclude/asm-i386/mach-default -fomit-frame-pointer > >>> -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign > >>> -DMODULE -D"KBUILD_STR(s)=#s" > >>> -D"KBUILD_BASENAME=KBUILD_STR(mymodule)" > >>> -D"KBUILD_MODNAME=KBUILD_STR(mymodule)" -c -o > >>> /home/ashu/Desktop/xenmodule/.tmp_mymodule.o > >>> /home/ashu/Desktop/xenmodule/mymodule.c > >>> /home/ashu/Desktop/xenmodule/mymodule.c:15:27: error: > >>> public/sysctl.h: No such file or directory > >>> /home/ashu/Desktop/xenmodule/mymodule.c:16:23: error: > >>> xen/sched.h: No such file or directory > >>> make[3]: *** [/home/ashu/Desktop/xenmodule/mymodule.o] Error 1 > >>> make[2]: *** [_module_/home/ashu/Desktop/xenmodule] Error 2 > >>> make[1]: *** [modules] Error 2 > >>> make: *** [modules] Error 2 > >>> make: Leaving directory > >>> `/usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32' > >>> > >>> > >>> > >>> > >>> > >>> Thanks, > >>> Ashutosh > >>> > >>> > >>> > >>> > >>> On Nov 13, 2007 1:35 AM, Akio Takebe > wrote: > >>> > >>>> Hi, > >>>> > >>>>> But is there any way to get domain id of each active domain in guest > >>>> kernel? > >>>>> > >>>> Is your module for dom0? > >>>> If dom0, you can use hypercall of XEN_SYSCTL_getdomaininfolist. > >>>> But If other, you cannot access it. > >>>> > >>>> Best Regards, > >>>> > >>>> Akio Takebe > >>>> > >>>> > >>> > > > > > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel > > > ------=_Part_24523_30849751.1195039311952 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I tried #include<xen/interface/sysctl.h> but I get an error: #error "domctl operations are intended for use by node control tools only"

Keir, how do I add a watch on an entire path, e.g. /local/domain/? More importantly, how can I get the list of domains/domainIds of the currently running domains in a module running in dom0 kernel?? Please help, I'm looking for an answer to this since quite a few days!

Thanks,
Ashutosh

On Nov 14, 2007 4:41 PM, Keir Fraser <Keir.Fraser@cl.cam.ac.uk> wrote:
But it's not particularly recommended to use domctl or sysctl interfaces in
the dom0 kernel. Those interfaces can change. This might be acceptable for
you however, depending on your purpose.

 -- Keir

On 14/11/07 09:34, "Atsushi SAKAI" <sakaia@jp.fujitsu.com> wrote:

> try using
> include/xen/interface/sysctl.h
> on PV kernel.
>
> Thanks
> Atsushi SAKAI
>
>
>
> "ashutosh mehra" <ashutosh.xen@gmail.com> wrote:
>
>> Any answers to this?
>>
>> On Nov 13, 2007 3:37 PM, ashutosh mehra <ashutosh.xen@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I tried including public/sysctl.h for  XEN_SYSCTL_getdomaininfolist, but
>>> I get an error: public/sysctl.h: No such file or directory.
>>>
>>> Even if the above problem is solved, how will I get the list/domainIds of
>>> all the domUs running without using for_each_domain defined in xen/sched.h?
>>> I get the same error for this file as well. And what should be the
>>> parameters to make for this? Currently my Makefile is obj-m := mymodule.oand
>>> I'm running make with the parameters make -C
>>> /lib/modules/2.6.18-xen/build/ modules M=`pwd` V=1
>>>
>>>
>>> This is the output from make:
>>>
>>>
>>> make: Entering directory
>>> `/usr/local/src/xen-3.1.0-src /build-linux-2.6.18-xen_x86_32'
>>> make -C /usr/local/src/xen-3.1.0-src/linux-2.6.18-xen
>>> O=/usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32 modules
>>> make -C /usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32 \
>>>        KBUILD_SRC=/usr/local/src/xen-3.1.0-src/linux-2.6.18-xen \
>>>        KBUILD_EXTMOD="/home/ashu/Desktop/xenmodule" -f
>>> /usr/local/src/xen-3.1.0-src/linux-2.6.18-xen/Makefile modules
>>> test -e include/linux/autoconf.h -a -e include/config/auto.conf || (
>>>         \
>>>        echo;                                                           \
>>>        echo "  ERROR: Kernel configuration is invalid.";               \
>>>        echo "         include/linux/autoconf.h or
>>> include/config/auto.conf are missing.";      \
>>>        echo "         Run 'make oldconfig && make prepare' on kernel
>>> src to fix it.";  \
>>>        echo;                                                           \
>>>        /bin/false)
>>> mkdir -p /home/ashu/Desktop/xenmodule/.tmp_versions
>>> rm -f /home/ashu/Desktop/xenmodule/.tmp_versions/*
>>> make -f /usr/local/src/xen-3.1.0-src /linux-2.6.18-xen
>>> /scripts/Makefile.build
>>> obj=/home/ashu/Desktop/xenmodule
>>>  gcc -m32 -Wp,-MD,/home/ashu/Desktop/xenmodule/.mymodule.o.d
>>> -nostdinc -isystem /usr/lib/gcc/i486-linux-gnu/4.1.2/include
>>> -Iinclude2/asm/mach-xen -D__KERNEL__ -Iinclude -Iinclude2
>>> -I/usr/local/src/xen-3.1.0-src /linux-2.6.18-xen/include -include
>>> include/linux/autoconf.h -D__XEN_INTERFACE_VERSION__=0x00030205
>>> -I/home/ashu/Desktop/xenmodule -Wall -Wundef -Wstrict-prototypes
>>> -Wno-trigraphs -fno-strict-aliasing -fno-common -O2 -pipe -msoft-float
>>> -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mregparm=3
>>> -ffreestanding -I/usr/local/src/xen-3.1.0-src/linux-2.6.18-xen
>>> /include/asm-i386/mach-xen
>>> -Iinclude/asm-i386/mach-xen
>>> -I/usr/local/src/xen-3.1.0-src /linux- 2.6.18-xen
>>> /include/asm-i386/mach-default
>>> -Iinclude/asm-i386/mach-default -fomit-frame-pointer
>>> -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
>>> -DMODULE -D"KBUILD_STR(s)=#s"
>>> -D"KBUILD_BASENAME=KBUILD_STR(mymodule)"
>>> -D"KBUILD_MODNAME=KBUILD_STR(mymodule)" -c -o
>>> /home/ashu/Desktop/xenmodule/.tmp_mymodule.o
>>> /home/ashu/Desktop/xenmodule/mymodule.c
>>> /home/ashu/Desktop/xenmodule/mymodule.c:15:27: error:
>>> public/sysctl.h: No such file or directory
>>> /home/ashu/Desktop/xenmodule/mymodule.c:16:23: error:
>>> xen/sched.h: No such file or directory
>>> make[3]: *** [/home/ashu/Desktop/xenmodule/mymodule.o] Error 1
>>> make[2]: *** [_module_/home/ashu/Desktop/xenmodule] Error 2
>>> make[1]: *** [modules] Error 2
>>> make: *** [modules] Error 2
>>> make: Leaving directory
>>> `/usr/local/src/xen-3.1.0-src/build-linux-2.6.18-xen_x86_32'
>>>
>>>
>>>
>>>
>>>
>>> Thanks,
>>> Ashutosh
>>>
>>>
>>>
>>>
>>> On Nov 13, 2007 1:35 AM, Akio Takebe <takebe_akio@jp.fujitsu.com > wrote:
>>>
>>>> Hi,
>>>>
>>>>> But is there any way to get domain id of each active domain in guest
>>>> kernel?
>>>>>
>>>> Is your module for dom0?
>>>> If dom0, you can use hypercall of XEN_SYSCTL_getdomaininfolist.
>>>> But If other, you cannot access it.
>>>>
>>>> Best Regards,
>>>>
>>>> Akio Takebe
>>>>
>>>>
>>>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel



------=_Part_24523_30849751.1195039311952-- --===============1235086785== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1235086785==--