samuel, I have a try with HVM stubdomain on r17062, but failed to make on 32b platform. Attached patch can fix it, but don''t know if okay. After installation, I failed to start stubdom. So I created it manually and got following debug mesg(both HVMdomain and stubdom are created) Can you give some lights on following questions: 1. I use default vnclisten. Does it matter? 2. Seems qemu in stubdom has some issue and couldn''t update the ''vnc-port'' in xenstore. Or the stubdom didn''t run at all. How can I debug it? 3. "Create /etc/xen/stubdom-hvmconfig" in readme -- seems "hvmconfig" should match the domain name rather than config file. Thanks, =================== running error ============================# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 1813 2 r----- 2489.0 EdwinHVMDomainVtd2 44 128 1 ------ 0.0 stubdom-EdwinHVMDomainVtd2 45 32 1 -b---- 0.0 [root@vt-gang32 ~]# /usr/lib/xen/bin/stubdom-dm -d 44 -domain-name EdwinHVMDomai nVtd2 -m 128 -vnc 127.0.0.1:0 -vncunused -monitor vc -vcpus 1 -boot c -serial pt y -acpi -M xenfv xenstore-read: couldn''t read path /local/domain/44/console/vnc-port Using config file "./stubdom-EdwinHVMDomainVtd2". Started domain stubdom-EdwinHVMDomainVtd2 xenstore-read: couldn''t read path /local/domain/44/console/vnc-port Failed to read /local/domain/0/backend/vbd/45/768/feature-flush-cache. 16777216 sectors of 512 bytes ************************** blk_open(/local/domain/45/device/vbd/768) -> 5 xs_read(/local/domain/45/device/vbd/5632/phantom_vbd): ENOENT xs_watch(/local/domain/0/backend/vbd/45/5632/params, hdc) ******************* BLKFRONT for /local/domain/45/device/vbd/5632 ********** backend at /local/domain/0/backend/vbd/45/5632 xenstore-read: couldn''t read path /local/domain/44/console/vnc-port xenstore-read: couldn''t read path /local/domain/44/console/vnc-port xenstore-read: couldn''t read path /local/domain/44/console/vnc-port =================================================================== ================== compile error ==================================make[2]: Entering directory `/home/another/gzhai/srcs/hg/xen-dev/hv/extras/mini-os/arch/x86'' make[2]: Nothing to be done for `all''. make[2]: Leaving directory `/home/another/gzhai/srcs/hg/xen-dev/hv/extras/mini-os/arch/x86'' i686-xen-elf-ld -r -m elf_i386 arch/x86/x86_32.o blkfront.o events.o fs-front.o gnttab.o hypervisor.o kernel.o main.o mm.o netfront.o sched.o lib/ctype.o lib/math.o lib/printf.o lib/string.o lib/sys.o lib/xmalloc.o lib/xs.o xenbus/xenbus.o console/console.o console/xencons_ring.o lwip.a /home/another/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/i386-dm-stubdom/qemu.a /home/another/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/i386-dm-stubdom/libqemu.a -Larch/x86 -lx86_32 -L../../stubdom/libxc -lxenctrl -lxenguest -lpci -lz -lc -o mini-os.o i686-xen-elf-objcopy -w -G xenos_* -G _start mini-os.o mini-os.o i686-xen-elf-ld -m elf_i386 -T arch/x86/minios-x86_32.lds mini-os.o -o mini-os mini-os.o: In function `bdrv_snapshot_dump'': /home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block.c:1042: undefined reference to `__moddi3'' /home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block.c:1042: undefined reference to `__moddi3'' mini-os.o: In function `vmdk_is_allocated'': /home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block-vmdk.c:547: undefined reference to `__moddi3'' mini-os.o: In function `vmdk_read'': /home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block-vmdk.c:563: undefined reference to `__moddi3'' mini-os.o: In function `cloop_read'': /home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block-cloop.c:143: undefined reference to `__moddi3'' mini-os.o:/home/gzhai/srcs/hg/xen-dev/hv/stubdom/ioemu/block-bochs.c:182: more undefined references to `__moddi3'' follow make[1]: *** [mini-os] Error 1 make[1]: Leaving directory `/home/another/gzhai/srcs/hg/xen-dev/hv/extras/mini-os'' make: *** [qemu-stubdom] Error 2 ================================================================== -- best rgds, edwin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hello, Zhai, Edwin, le Tue 19 Feb 2008 19:39:41 +0800, a écrit :> I have a try with HVM stubdomain on r17062, but failed to make on 32b platform. > Attached patch can fix it, but don''t know if okay.That is how such issues have usually been solved so I guess in principle it is. Is your code coming from freebsd too?> After installation, I failed to start stubdom. So I created it manuallySee the commented "xm create" line in the stubdom-dm script, to enable debugging.> 1. I use default vnclisten. Does it matter?Yes:> #---------------------------------------------------------------------------- > # address that should be listened on for the VNC server if vnc is set. > # default is to use ''vnc-listen'' setting from /etc/xen/xend-config.sxp > #vnclisten="localhost"So if your vnc-listen setting is e.g. localhost, the VNC server of the stubdom will be restricted to the stub domain itself, and you won''t be able to connect.> 2. Seems qemu in stubdom has some issue and couldn''t update the ''vnc-port'' in > xenstore.Actually mini-os has no name resolving support so that it won''t be able to understand the default "localhost" for vnclisten and hence not start VNC.> Or the stubdom didn''t run at all.It did: messages like ******************* BLKFRONT for /local/domain/45/device/vbd/5632 ********** come from Mini-OS and mean that qemu is currently connecting to the block backend.> 3. "Create /etc/xen/stubdom-hvmconfig" in readme -- seems "hvmconfig" should > match the domain name rather than config file.Oh indeed, here is a patch to fix that and other documentation/debugging issues: - Document that for vnclisten names and 127.0.0.1 should not be used. - Documentation cosmetic fixes - Dump qemu output to the usual logs Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> diff -r e85399173769 stubdom/README --- a/stubdom/README Tue Feb 12 16:59:08 2008 +0000 +++ b/stubdom/README Mon Feb 25 11:51:48 2008 +0000 @@ -16,10 +16,12 @@ In your HVM config "hvmconfig", -- use VNC, set vnclisten to "172.30.206.1" for instance: +- use VNC, set vnclisten to "172.30.206.1" for instance. Do not use a host name +as Mini-OS does not have a name resolver. Do not use 127.0.0.1 since then you +will not be able to connect to it. -vnc=1 -vnclisten="172.30.206.1" +vnc = 1 +vnclisten = "172.30.206.1" - use /usr/lib/xen/bin/stubdom-dm as dm script @@ -28,14 +30,15 @@ - comment the disk statement: #disk = [ ''file:/tmp/install.iso,hdc:cdrom,r'', ''phy:/dev/sda6,hda,w'', ''file:/tmp/test,hdb,r'' ] -Create /etc/xen/stubdom-hvmconfig ("hvmconfig" must match your main config file) -with +Create /etc/xen/stubdom-hvmconfig (where "hvmconfig" is your HVM guest domain +name) with -kernel="/usr/lib/xen/boot/stubdom.gz" -vif=[ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] +kernel = "/usr/lib/xen/boot/stubdom.gz" +vif = [ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] disk = [ ''file:/tmp/install.iso,hdc:cdrom,r'', ''phy:/dev/sda6,hda,w'', ''file:/tmp/test,hdb,r'' ] where - 172.30.206.1 is the IP for vnc, -- ''ip=10.0.1.1,mac='' is the same net configuration as in the hvmconfig script, +- ''ip=10.0.1.1,mac= etc...'' is the same net configuration as in the hvmconfig +script, - and disk = is the same block configuration as in the hvmconfig script. --- a/stubdom/stubdom-dm Tue Feb 12 16:59:08 2008 +0000 +++ b/stubdom/stubdom-dm Mon Feb 25 11:51:48 2008 +0000 @@ -62,11 +62,12 @@ creation="xm create -c stubdom-$domname target=$domid memory=32" -(while true ; do sleep 60 ; done) | $creation & +(while true ; do sleep 60 ; done) | $creation > /var/log/xen/qemu-dm-$domid.log & #xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to shut down ; read" & consolepid=$! +# Wait for vnc server to appear while ! vnc_port=`xenstore-read /local/domain/$domid/console/vnc-port` do # Check that the stubdom job is still alive _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel Thibault
2008-Feb-26 14:59 UTC
[Xen-devel] [PATCH] stubdom: log and documentation fixes
- Document that for vnclisten names and 127.0.0.1 should not be used. - Documentation cosmetic fixes - Dump qemu output to the usual logs Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> diff -r e85399173769 stubdom/README --- a/stubdom/README Tue Feb 12 16:59:08 2008 +0000 +++ b/stubdom/README Mon Feb 25 11:51:48 2008 +0000 @@ -16,10 +16,12 @@ In your HVM config "hvmconfig", -- use VNC, set vnclisten to "172.30.206.1" for instance: +- use VNC, set vnclisten to "172.30.206.1" for instance. Do not use a host name +as Mini-OS does not have a name resolver. Do not use 127.0.0.1 since then you +will not be able to connect to it. -vnc=1 -vnclisten="172.30.206.1" +vnc = 1 +vnclisten = "172.30.206.1" - use /usr/lib/xen/bin/stubdom-dm as dm script @@ -28,14 +30,15 @@ - comment the disk statement: #disk = [ ''file:/tmp/install.iso,hdc:cdrom,r'', ''phy:/dev/sda6,hda,w'', ''file:/tmp/test,hdb,r'' ] -Create /etc/xen/stubdom-hvmconfig ("hvmconfig" must match your main config file) -with +Create /etc/xen/stubdom-hvmconfig (where "hvmconfig" is your HVM guest domain +name) with -kernel="/usr/lib/xen/boot/stubdom.gz" -vif=[ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] +kernel = "/usr/lib/xen/boot/stubdom.gz" +vif = [ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] disk = [ ''file:/tmp/install.iso,hdc:cdrom,r'', ''phy:/dev/sda6,hda,w'', ''file:/tmp/test,hdb,r'' ] where - 172.30.206.1 is the IP for vnc, -- ''ip=10.0.1.1,mac='' is the same net configuration as in the hvmconfig script, +- ''ip=10.0.1.1,mac= etc...'' is the same net configuration as in the hvmconfig +script, - and disk = is the same block configuration as in the hvmconfig script. --- a/stubdom/stubdom-dm Tue Feb 12 16:59:08 2008 +0000 +++ b/stubdom/stubdom-dm Mon Feb 25 11:51:48 2008 +0000 @@ -62,11 +62,12 @@ creation="xm create -c stubdom-$domname target=$domid memory=32" -(while true ; do sleep 60 ; done) | $creation & +(while true ; do sleep 60 ; done) | $creation > /var/log/xen/qemu-dm-$domid.log & #xterm -geometry +0+0 -e /bin/sh -c "$creation ; echo ; echo press ENTER to shut down ; read" & consolepid=$! +# Wait for vnc server to appear while ! vnc_port=`xenstore-read /local/domain/$domid/console/vnc-port` do # Check that the stubdom job is still alive _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
stubdom: fix x86_32 compilation by __moddi3 from FreeBSD (like has been done previously for umoddi3 etc.) Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> diff -r 09af1b46f89f extras/mini-os/lib/math.c --- a/extras/mini-os/lib/math.c Tue Feb 26 13:12:55 2008 +0000 +++ b/extras/mini-os/lib/math.c Tue Feb 26 14:57:50 2008 +0000 @@ -388,6 +388,30 @@ __umoddi3(u_quad_t a, u_quad_t b) return (r); } +/* + * Return remainder after dividing two signed quads. + * + * XXX + * If -1/2 should produce -1 on this machine, this code is wrong. + */ +quad_t +__moddi3(a, b) + quad_t a, b; +{ + u_quad_t ua, ub, ur; + int neg; + + if (a < 0) + ua = -(u_quad_t)a, neg = 1; + else + ua = a, neg = 0; + if (b < 0) + ub = -(u_quad_t)b; + else + ub = b; + (void)__qdivrem(ua, ub, &ur); + return (neg ? -ur : ur); +} #endif /* !defined(__ia64__) */ #ifndef HAVE_LIBC _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel Thibault
2008-Feb-26 15:03 UTC
[Xen-devel] Re: [PATCH] stubdom: x86_32 compilation fix
Samuel Thibault, le Tue 26 Feb 2008 15:01:31 +0000, a écrit :> stubdom: fix x86_32 compilation by __moddi3 from FreeBSD > (like has been done previously for umoddi3 etc.)Oops, sorry, that was the unfixed version, here is the fixed one: stubdom: fix x86_32 compilation by __moddi3 from FreeBSD (like has been done previously for umoddi3 etc.) Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> diff -r 09af1b46f89f extras/mini-os/lib/math.c --- a/extras/mini-os/lib/math.c Tue Feb 26 13:12:55 2008 +0000 +++ b/extras/mini-os/lib/math.c Tue Feb 26 14:57:50 2008 +0000 @@ -388,6 +388,29 @@ __umoddi3(u_quad_t a, u_quad_t b) return (r); } +/* + * Return remainder after dividing two signed quads. + * + * XXX + * If -1/2 should produce -1 on this machine, this code is wrong. + */ +quad_t +__moddi3(quad_t a, quad_t b) +{ + u_quad_t ua, ub, ur; + int neg; + + if (a < 0) + ua = -(u_quad_t)a, neg = 1; + else + ua = a, neg = 0; + if (b < 0) + ub = -(u_quad_t)b; + else + ub = b; + (void)__qdivrem(ua, ub, &ur); + return (neg ? -ur : ur); +} #endif /* !defined(__ia64__) */ #ifndef HAVE_LIBC _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Samuel, Thanks for your reply. On Mon, Feb 25, 2008 at 12:56:35PM +0100, Samuel Thibault wrote:> Hello, > > Zhai, Edwin, le Tue 19 Feb 2008 19:39:41 +0800, a écrit : > > I have a try with HVM stubdomain on r17062, but failed to make on 32b platform. > > Attached patch can fix it, but don''t know if okay. > > That is how such issues have usually been solved so I guess in principle > it is. Is your code coming from freebsd too?Maybe. I copy this code from xen/common/lib.c> > > After installation, I failed to start stubdom. So I created it manually > > See the commented "xm create" line in the stubdom-dm script, to enable > debugging. >I have enabled this to pop up a xterm for debug, but got same result.> > 1. I use default vnclisten. Does it matter? > > Yes: > > > #---------------------------------------------------------------------------- > > # address that should be listened on for the VNC server if vnc is set. > > # default is to use ''vnc-listen'' setting from /etc/xen/xend-config.sxp > > #vnclisten="localhost" > > So if your vnc-listen setting is e.g. localhost, the VNC server of the > stubdom will be restricted to the stub domain itself, and you won''t be > able to connect.vnclisten = "172.30.206.1"" I still have issue with the IP addr. How to select it, the dom0 ip or whatever in the subnet? vif = [ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] Does it mean the stubdom would create an extra vnif with the ip and start a VNC server on it? So I need ping 172.30.206.1 first to see if the vnif works? I saw "changeset 17122 -- minios: add PVFB support". Is it a must for stubdom vnc?> > > > 2. Seems qemu in stubdom has some issue and couldn''t update the ''vnc-port'' in > > xenstore. > > Actually mini-os has no name resolving support so that it won''t be able > to understand the default "localhost" for vnclisten and hence not start > VNC. > > > Or the stubdom didn''t run at all. > > It did: messages like > > ******************* BLKFRONT for /local/domain/45/device/vbd/5632 ********** > > come from Mini-OS and mean that qemu is currently connecting to the > block backend. > > > 3. "Create /etc/xen/stubdom-hvmconfig" in readme -- seems "hvmconfig" should > > match the domain name rather than config file. > > Oh indeed, here is a patch to fix that and other documentation/debugging > issues: > >-- best rgds, edwin _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Hello, Zhai, Edwin, le Wed 27 Feb 2008 10:05:13 +0800, a écrit :> > > After installation, I failed to start stubdom. So I created it manually > > > > See the commented "xm create" line in the stubdom-dm script, to enable > > debugging. > > > > I have enabled this to pop up a xterm for debug, but got same result.Well, that was expected :) The popup of xterm is just to make it easier to get the logs.> > > 1. I use default vnclisten. Does it matter? > > > > Yes: > > > > > #---------------------------------------------------------------------------- > > > # address that should be listened on for the VNC server if vnc is set. > > > # default is to use ''vnc-listen'' setting from /etc/xen/xend-config.sxp > > > #vnclisten="localhost" > > > > So if your vnc-listen setting is e.g. localhost, the VNC server of the > > stubdom will be restricted to the stub domain itself, and you won''t be > > able to connect. > > vnclisten = "172.30.206.1"" > I still have issue with the IP addr. How to select it, the dom0 ip or whatever > in the subnet?That depends on your network configuration. You need to be able to connect to it.> vif = [ ''ip=172.30.206.1'', ''ip=10.0.1.1,mac=aa:00:00:12:23:34''] > Does it mean the stubdom would create an extra vnif with the ip and start a VNC > server on it?Yes.> So I need ping 172.30.206.1 first to see if the vnif works?For instance yes.> I saw "changeset 17122 -- minios: add PVFB support". Is it a must for stubdom > vnc?No. Samuel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel