All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhai, Edwin" <edwin.zhai@intel.com>
To: samuel.thibault@eu.citrix.com, Keir <Keir.Fraser@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: stubdom questions
Date: Tue, 19 Feb 2008 19:39:41 +0800	[thread overview]
Message-ID: <20080219113941.GF21201@edwin-srv.sh.intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4140 bytes --]

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

[-- Attachment #2: stubdom_fix.patch --]
[-- Type: text/plain, Size: 684 bytes --]

diff -r bdc4d718bef7 extras/mini-os/lib/math.c
--- a/extras/mini-os/lib/math.c	Tue Feb 19 16:19:51 2008 +0800
+++ b/extras/mini-os/lib/math.c	Tue Feb 19 17:00:34 2008 +0800
@@ -388,6 +388,23 @@ __umoddi3(u_quad_t a, u_quad_t b)
         return (r);
 }
 
+/*
+ * Remainder of signed quad division.
+ * Truncates towards zero, as required by C99:
+ *  11 %  5 =  1
+ * -11 %  5 = -1
+ *  11 % -5 =  1
+ * -11 % -5 =  1
+ */
+s64 __moddi3(s64 a, s64 b)
+{
+    u64 ua, ub, urem;
+    int neg = (a < 0);
+    ua = neg ? -(u64)a : a;
+    ub = (b < 0) ? -(u64)b : b;
+    __qdivrem(ua, ub, &urem);
+    return (neg ? -urem : urem);
+}
 #endif /* !defined(__ia64__) */
 
 #ifndef HAVE_LIBC

[-- Attachment #3: xmexamplestub --]
[-- Type: text/plain, Size: 7644 bytes --]

# Python configuration setup for 'xm create'.
# This script sets the parameters used when a domain is created using 'xm create'.
# You use a separate script for each domain you want to create, or 
# you can set the parameters for the domain on the xm command line.
#============================================================================

import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'

#----------------------------------------------------------------------------
# Kernel image file.
kernel = "/usr/lib/xen/boot/hvmloader"

# The domain build function. HVM domain uses 'hvm'.
builder='hvm'

# Initial memory allocation (in megabytes) for the new domain.
#
# WARNING: Creating a domain with insufficient memory may cause out of
#          memory errors. The domain needs enough memory to boot kernel
#          and modules. Allocating less than 32MBs is not recommended.
memory = 128

# Shadow pagetable memory for the domain, in MB.
# If not explicictly set, xend will pick an appropriate value.  
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
# shadow_memory = 8

# A name for your domain. All domains must have different names.
name = "EdwinHVMDomainVtd2"

# 128-bit UUID for the domain.  The default behavior is to generate a new UUID
# on each call to 'xm create'.
#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"

#-----------------------------------------------------------------------------
# The number of cpus guest platform has, default=1
#vcpus=2

# Enable/disable HVM guest PAE, default=1 (enabled)
pae=1

# Enable/disable HVM guest ACPI, default=1 (enabled)
acpi=1

# Enable/disable HVM APIC mode, default=1 (enabled)
# Note that this option is ignored if vcpus > 1
apic=1

# List of which CPUS this domain is allowed to use, default Xen picks
#cpus = ""         # leave to Xen to pick
#cpus = "0"        # all vcpus run on CPU0
#cpus = "0-3,5,^1" # run on cpus 0,2,3,5

# Optionally define mac and/or bridge for the network interfaces.
# Random MACs are assigned if not given.
#vif = [ 'type=ioemu, mac=00:16:3e:00:00:88, bridge=xenbr0' ]

#----------------------------------------------------------------------------
# Define the disk devices you want the domain to have access to, and
# what you want them accessible as.
# Each disk entry is of the form phy:UNAME,DEV,MODE
# where UNAME is the device, DEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.

#disk = [ 'file:/var/img/rhel5-ins.img,hda,w', ',hdc:cdrom,r' ]
#disk = [ 'file:/var/img/qcow/rhel4u2_ia32.img.vtd-lm.qcow,hda,w', ',hdc:cdrom,r' ]

#----------------------------------------------------------------------------
# Configure the behaviour when a domain exits.  There are three 'reasons'
# for a domain to stop: poweroff, reboot, and crash.  For each of these you
# may specify:
#
#   "destroy",        meaning that the domain is cleaned up as normal;
#   "restart",        meaning that a new domain is started in place of the old
#                     one;
#   "preserve",       meaning that no clean-up is done until the domain is
#                     manually destroyed (using xm destroy, for example); or
#   "rename-restart", meaning that the old domain is not cleaned up, but is
#                     renamed and a new domain started in its place.
#
# The default is
#
#   on_poweroff = 'destroy'
#   on_reboot   = 'restart'
#   on_crash    = 'restart'
#
# For backwards compatibility we also support the deprecated option restart
#
# restart = 'onreboot' means on_poweroff = 'destroy'
#                            on_reboot   = 'restart'
#                            on_crash    = 'destroy'
#
# restart = 'always'   means on_poweroff = 'restart'
#                            on_reboot   = 'restart'
#                            on_crash    = 'restart'
#
# restart = 'never'    means on_poweroff = 'destroy'
#                            on_reboot   = 'destroy'
#                            on_crash    = 'destroy'

#on_poweroff = 'destroy'
#on_reboot   = 'restart'
#on_crash    = 'restart'

#============================================================================

# New stuff
#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
device_model = '/boot/edwin/qemu-dm.debug'
#device_model = '/usr/lib/xen/bin/stubdom-dm'

#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d) 
# default: hard disk, cd-rom, floppy
#boot="cda"

#-----------------------------------------------------------------------------
#  write to temporary files instead of disk image files
#snapshot=1

#----------------------------------------------------------------------------
# enable SDL library for graphics, default = 0
sdl=0

#----------------------------------------------------------------------------
# enable VNC library for graphics, default = 1
vnc=1

#----------------------------------------------------------------------------
# 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"

#----------------------------------------------------------------------------
# set VNC display number, default = domid
#vncdisplay=1

#----------------------------------------------------------------------------
# try to find an unused port for the VNC server, default = 1
#vncunused=1

#----------------------------------------------------------------------------
# enable spawning vncviewer for domain's console
# (only valid when vnc=1), default = 0
#vncconsole=1

#----------------------------------------------------------------------------
# set password for domain's VNC console
# default is depents on vncpasswd in xend-config.sxp
vncpasswd=''

#----------------------------------------------------------------------------
# no graphics, use serial port
#nographic=0

#----------------------------------------------------------------------------
# enable stdvga, default = 0 (use cirrus logic device model)
stdvga=0

#-----------------------------------------------------------------------------
#   serial port re-direct to pty deivce, /dev/pts/n 
#   then xm console or minicom can connect
serial='pty'


#-----------------------------------------------------------------------------
#   Qemu Monitor, default is disable
#   Use ctrl-alt-2 to connect
monitor=1


#-----------------------------------------------------------------------------
#   enable sound card support, [sb16|es1370|all|..,..], default none
#soundhw='sb16'


#-----------------------------------------------------------------------------
#    set the real time clock to local time [default=0 i.e. set to utc]
#localtime=1


#-----------------------------------------------------------------------------
#    set the real time clock offset in seconds [default=0 i.e. same as dom0]
#rtc_timeoffset=3600

#-----------------------------------------------------------------------------
#    start in full screen
#full-screen=1   


#-----------------------------------------------------------------------------
#   Enable USB support (specific devices specified at runtime through the
#			monitor window)
#usb=1

#   Enable USB mouse support (only enable one of the following, `mouse' for
#			      PS/2 protocol relative mouse, `tablet' for
#			      absolute mouse)
#usbdevice='mouse'
#usbdevice='tablet'

#-----------------------------------------------------------------------------
#   Set keyboard layout, default is en-us keyboard. 
#keymap='ja'

[-- Attachment #4: stubdom-EdwinHVMDomainVtd2 --]
[-- Type: text/plain, Size: 327 bytes --]

kernel = "/usr/lib/xen/boot/stubdom.gz"


#vif = [ 'ip=10.239.36.188,', 'type=ioemu,  mac=00:16:3e:00:00:88, bridge=xenbr0' ]
vif = [ 'type=ioemu,  mac=00:16:3e:00:00:88, bridge=xenbr0' ]


disk = [ 'file:/var/img/rhel5-ins.img,hda,w', ',hdc:cdrom,r' ]
#disk = [ 'file:/var/img/qcow/rhel5-ins.img.qcow,hda,w', ',hdc:cdrom,r' ]

[-- Attachment #5: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2008-02-19 11:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19 11:39 Zhai, Edwin [this message]
2008-02-25 11:56 ` stubdom questions Samuel Thibault
2008-02-26 14:59   ` [PATCH] stubdom: log and documentation fixes Samuel Thibault
2008-02-26 15:01   ` [PATCH] stubdom: x86_32 compilation fix Samuel Thibault
2008-02-26 15:03     ` Samuel Thibault
2008-02-27  2:05   ` stubdom questions Zhai, Edwin
2008-02-27 11:12     ` Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2008-09-09  4:43 Lu, Guanqun
2010-11-09 10:44 Jan Beulich
2010-11-09 17:00 ` Ian Jackson
2010-11-09 17:05   ` Jan Beulich
2010-11-09 17:31     ` Stefano Stabellini
2010-11-10 10:01   ` Jan Beulich
2010-11-10 12:08     ` Gianni Tedesco
2010-11-10 13:55     ` Ian Jackson
2010-11-09 20:48 ` Samuel Thibault
2010-11-10  9:58   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080219113941.GF21201@edwin-srv.sh.intel.com \
    --to=edwin.zhai@intel.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=samuel.thibault@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.