Skip to contentSkip to conversation

Documentation updates

PATCH Superseded Ian Campbell 3 participants 30 messages Nov 17, 2011 – Nov 25, 2011

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation updates

The following series flushes my documentation queue and replaces previous postings of those patches.

The main difference is that the xl cfg file is now formatted using POD instead of markdown and presented as a manpage.

I have setup a cron job to build docs/html and publish it at
http://xenbits.xen.org/docs/unstable/ (it's a bit bare right now).

The motivation for some of these patches e.g. creating an index was more to support this use case although it is probably useful for packaging /usr/share/doc/xen etc.

#1 lore raw

PATCH 1/1 Replace references to old wiki with ones to new

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540451 0
# Node ID 14a8af47bf11e9e4be35a0000336b49da95d9860 # Parent dbdc840f8f62db58321b5009e5e0f7833066386f Replace references to old wiki with ones to new.

I have confirmed that the relevant pages have been transitioned.

What remains is pages which have not yet been moved over:

$ rgrep xenwiki *
docs/misc/xenstore.txt:	See http://wiki.xensource.com/xenwiki/XenBus section
tools/libxen/README:http://wiki.xensource.com/xenwiki/XenApi
tools/xenballoon/xenballoond.README:http://wiki.xensource.com/xenwiki/Open_Topics_For_Discussion?action=AttachFile&do=get&target=Memory+Overcommit.pdf

Note that "PythonInXlConfig" never existed in the old wiki and does not exist in the new. This reference was introduced by 22735:cb94dbe20f97 and was supposed to have been written prior to the 4.1 release. I have transitioned it anyway but it's not clear how valuable the message actually is. Perhaps we should just remove that aspect of it?

README +2 -2
diff -r dbdc840f8f62 -r 14a8af47bf11 README
@@ -59,10 +59,10 @@ provided by your OS distributor:
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
 no suitable kernel is available from your OS distributor then refer to
-http://wiki.xen.org/xenwiki/XenDom0Kernels for suggestions for
+http://wiki.xen.org/wiki/XenDom0Kernels for suggestions for
 suitable kernels to use.
 If you are looking to compile a Dom0 kernel from source, please refer to
-http://wiki.xensource.com/xenwiki/XenParavirtOps.
+http://wiki.xensource.com/wiki/XenParavirtOps.
 
 [NB. Unless noted otherwise, all the following steps should be
 performed with root privileges.]
docs/misc/vtd.txt +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 docs/misc/vtd.txt
@@ -184,7 +184,7 @@ http://www.dell.com/content/products/cat
 - HP Compaq:  DC7800
 http://h10010.www1.hp.com/wwpc/us/en/en/WF04a/12454-12454-64287-321860-3328898.html
 
-For more information, pls refer to http://wiki.xensource.com/xenwiki/VTdHowTo.
+For more information, pls refer to http://wiki.xensource.com/wiki/VTdHowTo.
 
 
 Assigning devices to HVM domains
docs/misc/xl-network-configuration.markdown +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 docs/misc/xl-network-configuration.markdown
@@ -123,4 +123,4 @@ defaults to domain 0. Specifying another
 driver domain which is outside the scope of this document.
 
 [oui]: http://en.wikipedia.org/wiki/Organizationally_Unique_Identifier
-[net]: http://wiki.xen.org/xenwiki/HostConfiguration/Networking
+[net]: http://wiki.xen.org/wiki/HostConfiguration/Networking
docs/src/interface.tex +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 docs/src/interface.tex
@@ -1579,7 +1579,7 @@ This contains links to the latest versio
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xensource.com/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
docs/src/user.tex +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 docs/src/user.tex
@@ -2349,7 +2349,7 @@ This contains links to the latest versio
 documentation, including the latest version of the FAQ.
 
 Information regarding Xen is also available at the Xen Wiki at
-\begin{quote} {\tt http://wiki.xensource.com/xenwiki/}\end{quote}
+\begin{quote} {\tt http://wiki.xensource.com/wiki/}\end{quote}
 The Xen project uses Bugzilla as its bug tracking system. You'll find
 the Xen Bugzilla at http://bugzilla.xensource.com/bugzilla/.
 
tools/libxl/libxlu_cfg.c +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 tools/libxl/libxlu_cfg.c
@@ -72,7 +72,7 @@ static void parse(CfgParseContext *ctx) 
         fputs(
  "warning: Config file looks like it contains Python code.\n"
  "warning:  Arbitrary Python is no longer supported.\n"
- "warning:  See http://wiki.xen.org/xenwiki/PythonInXlConfig\n",
+ "warning:  See http://wiki.xen.org/wiki/PythonInXlConfig\n",
               ctx->cfg->report);
     }
 }
xen/common/sched_credit2.c +1 -1
diff -r dbdc840f8f62 -r 14a8af47bf11 xen/common/sched_credit2.c
@@ -51,7 +51,7 @@
 /*
  * WARNING: This is still in an experimental phase.  Status and work can be found at the
  * credit2 wiki page:
- *  http://wiki.xensource.com/xenwiki/Credit2_Scheduler_Development
+ *  http://wiki.xensource.com/wiki/Credit2_Scheduler_Development
  * TODO:
  * + Immediate bug-fixes
  *  - Do per-runqueue, grab proper lock for dump debugkey
#2 lore raw

PATCH 1/1 docs: xlexample.hvm is missing "builder = 'hvm'"

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540451 0
# Node ID 5e3e5757de0fcd0b826d0ca8330db7fa1cfccba4 # Parent 14a8af47bf11e9e4be35a0000336b49da95d9860
docs: xlexample.hvm is missing "builder = 'hvm'"

This is rather critical...

tools/examples/xlexample.hvm +3 -0
diff -r 14a8af47bf11 -r 5e3e5757de0f tools/examples/xlexample.hvm
@@ -5,6 +5,9 @@
 # This is a fairly minimal example of what is required for an
 # HVM guest. For a more complete guide see <XXX Document TBD>
 
+# This configures an HVM rather than PV guest
+builder = "hvm"
+
 # Guest name
 name = "example.hvm"
#3 lore raw

PATCH 1/1 README: add markdown to dependency list

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540451 0
# Node ID e8f0094323d0edcf8e35573f37b74beab5694bd3 # Parent 5e3e5757de0fcd0b826d0ca8330db7fa1cfccba4
README: add markdown to dependency list

although this tool is strictly speaking optional we are providing various user docs in this format so increase the changes that they will install it.

README +1 -0
diff -r 5e3e5757de0f -r e8f0094323d0 README
@@ -55,6 +55,7 @@ provided by your OS distributor:
     * GNU gettext
     * 16-bit x86 assembler, loader and compiler (dev86 rpm or bin86 & bcc debs)
     * ACPI ASL compiler (iasl)
+    * markdown
 
 Second, you need to acquire a suitable kernel for use in domain 0. If
 possible you should use a kernel provided by your OS distributor. If
#4 lore raw

PATCH 1/1 docs: install html and txt versions of manpages

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540451 0
# Node ID f3fc909a083ddcea05cd0c9ab51a7241e573f6a6 # Parent e8f0094323d0edcf8e35573f37b74beab5694bd3
docs: install html and txt versions of manpages

docs/Docs.mk +2 -0
diff -r e8f0094323d0 -r f3fc909a083d docs/Docs.mk
@@ -5,6 +5,8 @@ FIG2DEV		:= fig2dev
 LATEX2HTML	:= latex2html
 DOXYGEN		:= doxygen
 POD2MAN		:= pod2man
+POD2HTML	:= pod2html
+POD2TEXT	:= pod2text
 DOT		:= dot
 NEATO		:= neato
 MARKDOWN	:= markdown
docs/Makefile +28 -3
diff -r e8f0094323d0 -r f3fc909a083d docs/Makefile
@@ -15,9 +15,13 @@ DOC_MARKDOWN	:= $(wildcard misc/*.markdo
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
 DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
-		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
+		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
+		   $(patsubst man/%.pod.5,txt/man/%.5.txt,$(DOC_MAN5SRC))
 
 GFX = $(patsubst %.fig, %.eps, $(wildcard figs/*.fig))
 
@@ -76,7 +80,7 @@ clean:
 	$(MAKE) -C xen-api clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak core
-	rm -rf $(GFX) ps pdf html
+	rm -rf $(GFX) ps pdf html txt
 	rm -rf api
 	rm -rf man5
 	rm -rf man1
@@ -132,6 +136,16 @@ html/%.html: %.markdown
 	$(call move-if-changed,[email protected],$@) ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/man/%.1.html: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< [email protected]
+	$(call move-if-changed,[email protected],$@)
+
+html/man/%.5.html: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2HTML) --infile=$< [email protected]
+	$(call move-if-changed,[email protected],$@)
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< [email protected]
@@ -141,3 +155,14 @@ txt/%.txt: %.markdown
 	$(INSTALL_DIR) $(@D)
 	cp $< [email protected]
 	$(call move-if-changed,[email protected],$@)
+
+txt/man/%.1.txt: man/%.pod.1 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< [email protected]
+	$(call move-if-changed,[email protected],$@)
+
+txt/man/%.5.txt: man/%.pod.5 Makefile
+	$(INSTALL_DIR) $(@D)
+	$(POD2TEXT) $< [email protected]
+	$(call move-if-changed,[email protected],$@)
+
#5 lore raw

PATCH 1/1 docs: add a document describing the xl cfg file syntax

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540524 0
# Node ID c88ff1ac24170a7d2a3c8824735ef9311eb95fe0 # Parent f3fc909a083ddcea05cd0c9ab51a7241e573f6a6
docs: add a document describing the xl cfg file syntax

Based on an initial version by Ian Jackson.

I believe that all keys are now present in the document although there are are various omissions in the actual documentation of them. Hopefully however this covers the majority of the most interesting keys.

Spice section:

The rest:

docs/man/xl.cfg.pod.5 new file +844 -0
diff -r f3fc909a083d -r c88ff1ac2417 docs/man/xl.cfg.pod.5
@@ -0,0 +1,844 @@
+=head1 NAME
+
+xl.cfg - XL Domain Configuration File Syntax
+
+=head1 SYNOPSIS
+
+ /etc/xen/xldomain
+
+=head1 DESCRIPTION
+
+To create a VM (a domain in Xen terminology, sometimes called a guest)
+with xl requires the provision of a domain config file.  Typically
+these live in `/etc/xen/DOMAIN.cfg` where DOMAIN is the name of the
+domain.
+
+=head1 SYNTAX
+
+A domain config file consists of a series of C<KEY=VALUE> pairs.
+
+Some C<KEY>s are mandatory, others are global options which apply to
+any guest type while others relate only to specific guest types
+(e.g. PV or HVM guests).
+
+A value C<VALUE> is one of:
+
+=over 4
+
+=item B<"STRING">
+
+A string, surrounded by either single or double quotes.
+
+=item B<NUMBER>
+
+A number, in either decimal, octal (using a C<0> prefix) or
+hexadecimal (using an C<0x> prefix).
+
+=item B<BOOLEAN>
+
+A C<NUMBER> interpreted as C<False> (C<0>) or C<True> (any other
+value).
+
+=item B<[ VALUE, VALUE, ... ]>
+
+A list of C<VALUES> of the above types. Lists are homogeneous and are
+not nested.
+
+=back
+
+The semantics of each C<KEY> defines which form of C<VALUE> is required.
+
+=head1 OPTIONS
+
+=head2 Mandatory Configuration Items
+
+The following key is mandatory for any guest type:
+
+=over 4
+
+=item B<name="NAME">
+
+Specifies the name of the domain.  Names of domains existing on a
+single host must be unique.
+
+=back
+
+=head2 Selecting Guest Type
+
+=over 4
+
+=item B<builder="generic">
+
+Specifies that this is to be a PV domain. This is the default.
+
+=item B<builder="hvm">
+
+Specifies that this is to be an HVM domain.  That is, a fully
+virtualised computer with emulated BIOS, disk and network peripherals,
+etc.  The default is a PV domain, suitable for hosting Xen-aware guest
+operating systems.
+
+=back
+
+=head2 Global Options
+
+The following options apply to guests of any type.
+
+=over 4
+
+=item B<uuid="UUID">
+
+Specifies the UUID of the domain.  If not specified, a fresh unique
+UUID will be generated.
+
+=item B<pool="CPUPOOLNAME">
+
+Put the guest's vcpus into the named cpu pool.
+
+=item B<vcpus=N>
+
+Start the guest with N vcpus initially online.
+
+=item B<maxvcpus=M>
+
+Allow the guest to bring up a maximum of M vcpus. At start of day if
+`vcpus=N` is less than `maxvcpus=M` then the first `N` vcpus will be
+created online and the remainder will be offline.
+
+=item B<memory=MBYTES>
+
+Start the guest with MBYTES megabytes of RAM.
+
+=item B<on_poweroff="ACTION">
+
+Specifies what should be done with the domain if it shuts itself down.
+The C<ACTION>s are:
+
+=over 4
+
+=item B<destroy>
+
+destroy the domain
+     
+=item B<restart>
+
+destroy the domain and immediately create a new domain with the same
+configuration
+        
+=item B<rename-restart>
+
+rename the domain which terminated, and thenimmediately create a new
+domain with the same configuration as the original
+
+=item B<preserve>
+
+keep the domain.  It can be examined, and later destroyed with `xl
+destroy`.
+
+=item B<coredump-destroy>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+destroy the domain.
+
+=item B<coredump-restart>
+
+write a "coredump" of the domain to F</var/xen/dump/NAME> and then
+restart the domain.
+
+=back
+
+The default for C<on_poweroff> is C<destroy>.
+
+=item B<on_reboot="ACTION">
+
+Action to take if the domain shuts down with a reason code requesting
+a reboot.  Default is C<restart>.
+
+=item B<on_watchdog="ACTION">
+
+Action to take if the domain shuts down due to a Xen watchdog timeout.
+Default is C<destroy>.
+
+=item B<on_crash="ACTION">
+
+Action to take if the domain crashes.  Default is C<destroy>.
+
+=item B<seclabel="LABEL">
+
+Assign an XSM security label to this domain.
+
+=back
+
+=head2 Devices
+
+The following options define the paravirtual, emulated and physical
+devices which the guest will contain.
+
+=over 4
+
+=item B<disk=[ "DISK_SPEC_STRING", "DISK_SPEC_STRING", ...]>
+
+Specifies the disks (both emulated disks and Xen virtual block
+devices) which are to be provided to the guest, and what objects on
+the they should map to.  See F<docs/misc/xl-disk-configuration.txt>.
+
+=item B<vif=[ "NET_SPEC_STRING", "NET_SPEC_STRING", ...]>
+
+Specifies the networking provision (both emulated network adapters,
+and Xen virtual interfaces) to provided to the guest.  See
+F<docs/misc/xl-network-configuration.markdown>.
+
+=item B<vfb=[ "VFB_SPEC_STRING", "VFB_SPEC_STRING", ...]>
+
+Specifies the paravirtual framebuffer devices which should be supplied
+to the domain.
+
+This options does not control the emulated graphics card presented to
+an HVM guest. See L<Emulated VGA Graphics Device> below for how to
+configure the emulated device.
+
+Each B<VFB_SPEC_STRING> is a comma-separated list of C<KEY=VALUE>
+settings, from the following list:
+
+=over 4
+
+=item C<vnc=BOOLEAN>
+
+Allow access to the display via the VNC protocol.  This enables the
+other VNC-related settings.  The default is to enable this.
+
+=item C<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item C<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use.  The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item C<vncunused=BOOLEAN>
+
+Requests that the VNC display setup search for a free TCP port to use.
+The actual display used can be accessed with C<xl vncviewer>.
+
+=item C<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=item C<sdl=BOOLEAN>
+
+Specifies that the display should be presented via an X window (using
+Simple DirectMedia Layer). The default is to not enable this mode
+
+=item C<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using C<device_model_version="qemu-xen-traditonal"> and only if the
+device-model was compiled with OpenGL support. Disabled by default.
+
+=item C<keymap="LANG">
+
+Configure the keymap to use for the keyboard associated with this
+display. If the input method does not easily support raw keycodes
+(e.g. this is often the case when using VNC) then this allows us to
+correctly map the input keys into keycodes seen by the guest. The
+specific values which are accepted are defined by the version of the
+device-model which you are using. See L<Keymaps> below or consult the
+L<qemu(1)> manpage. The default is B<en-us>.
+
+=item C<display=XXX>
+
+XXX written to xenstore backend for vfb but does not appear to be used
+anywhere?
+
+=item C<authority=XXX>
+
+XXX written to xenstore backend for vfb but does not appear to be used
+anywhere?
+
+=back
+
+=item B<pci=[ "PCI_SPEC_STRING", "PCI_SPEC_STRING", ... ]>
+
+Specifies the host PCI devices to passthrough to this guest. Each B<PCI_SPEC_STRING>
+has the form C<[DDDD:]BB:DD.F[@VSLOT],KEY=VALUE,KEY=VALUE,...> where:
+
+=over 4
+
+=item B<DDDD:BB:DD.F>
+
+identifies the PCI device from the host perspective in domain
+(B<DDDD>), Bus (B<BB>), Device (B<DD>) and Function (B<F>) syntax. This is
+the same scheme as used in the output of C<lspci> for the device in
+question. Note: By default C<lspci> will omit the domain (B<DDDD>) if it
+is zero and it is optional here also. You may specify the function
+(B<F>) as B<*> to indicate all functions.
+
+=item B<@VSLOT>
+
+specifies the virtual device where the guest will see this
+device. This is equivalent to the B<DD> which the guest sees. In a
+guest B<DDDD> and B<BB> are C<0000:00>. XXX how does this really work?
+
+=item B<KEY=VALUE>
+
+Posible B<KEY>s are:
+
+=over 4
+
+=item B<msitranslate=BOOLEAN>
+
+XXX
+
+=item B<power_mgmt=BOOLEAN>
+
+XXX
+
+=back
+
+=back
+
+=back
+
+=head2 Paravirtualised (PV) Guest Specific Options
+
+The following options apply only to Paravirtual guests.
+
+=over 4
+
+=item B<kernel="PATHNAME">
+
+Load the specified file as the kernel image.  Either B<kernel> or
+B<bootloader> must be specified for PV guests.
+
+=item B<ramdisk="PATHNAME">
+
+Load the specified file as the ramdisk.
+
+=item B<bootloader="PROGRAM">
+
+Run C<PROGRAM> to find the kernel image and ramdisk to use.  Normally
+C<PROGRAM> would be C<pygrub>, which is an emulation of
+grub/grub2/syslinux.
+
+=item B<bootloader_args=STRING>
+
+Append B<STRING> (split into words at whitespace) to the arguments to
+the B<bootloader> program.  XXX this should be a list of strings.
+
+=item B<root="STRING">
+
+Append B<root="STRING"> to the kernel command line (Note: it is guest
+specific what meaning this has).
+
+=item B<extra="STRING">
+
+Append B<STRING> to the kernel command line. Note: it is guest
+specific what meaning this has).
+
+=item B<e820_host=BOOLEAN>
+
+Selects whether to expose the host e820 (memory map) to the guest via
+the virtual e820. When this option is false the guest psuedo-physical
+address space consists of a single contiguous RAM region. When this
+option is specified the virtual e820 instead reflects the host e820
+and contains the same PCI holes. The total amount of RAM represented
+by the memory map is always the same, this option configures only how
+it is layed out.
+
+Exposing the host e820 to the guest gives the guest kernel the
+opportunity to set aside the required part of its pseudo-physical
+address space in order to provide address space to map passedthrough
+PCI devices. It is guest Operaring System dependant whether this
+option is required, specifically it is required when using a mainline
+Linux ("pvops") kernel. This option defaults to true if any PCI
+passthrough devices are configued and false otherwise. If you do not
+configure any passthrough devices at domain creation time but expect
+to hotplug devices later then you should set this option. Conversely
+if your particular guest kernel does not require this behaviour then
+it is safe to allow this to be enabled but you may wish to disable it
+anyway.
+
+=back
+
+=head2 Fully-virtualised (HVM) Guest Specific Options
+
+The following options apply only to HVM guests.
+
+=head3 Boot Device
+
+=over 4
+
+=item B<boot=[c|d|n]>
+
+Selects the emulated virtual device to boot from. Options are hard
+disk (B<c>), cd-rom (B<d>) or network/PXE (B<n>). Multiple options can be
+given and will be attempted in the order they are given. e.g. to boot
+from cd-rom but fallback to the hard disk you can give B<dc>. The
+default is B<cd>.
+
+=back
+
+=head3 Paging
+
+The following options control the mechanisms used to virtualise guest
+memory.  The defaults are selected to give the best results for the
+common case and so you should normally leave these options
+unspecified.
+
+=over 4
+
+=item B<hap=BOOLEAN>
+
+Turns "hardware assisted paging" (the use of the hardware nested page
+table feature) on or off.  This feature is called EPT (Extended Page
+Tables) by Intel and NPT (Nested Page Tables) or RVI (Rapid
+Virtualisation Indexing) by AMD.  Affects HVM guests only.  If turned
+off, Xen will run the guest in "shadow page table" mode where the
+guest's page table updates and/or TLB flushes etc. will be emulated.
+Use of HAP is the default when available.
+
+=item B<oos=BOOLEAN>
+
+Turns "out of sync pagetables" on or off.  When running in shadow page
+table mode, the guest's page table updates may be deferred as
+specified in the Intel/AMD architecture manuals.  However this may
+expose unexpected bugs in the guest, or find bugs in Xen, so it is
+possible to disable this feature.  Use of out of sync page tables,
+when Xen thinks it appropriate, is the default.
+
+=item B<shadow_memory=MBYTES>
+
+Number of megabytes to set aside for shadowing guest pagetable pages
+(effectively acting as a cache of translated pages) or to use for HAP
+state. By default this is 1MB per guest vcpu plus 8KB per MB of guest
+RAM. You should not normally need to adjust this value. However if you
+are not using hardware assisted paging (i.e. you are using shadow
+mode) and your guest workload consists of a a very large number of
+similar processes then increasing this value may improve performance.
+
+=back
+
+=head3 Processor and Platform Features
+
+The following options allow various processor and platform level
+features to be hidden or exposed from the guest's point of view. This
+can be useful when running older guest Operating Systems which may
+misbehave when faced with more modern features. In general you should
+accept the defaults for these options wherever possible.
+
+=over 4
+
+=item B<pae=BOOLEAN>
+
+Hide or expose the IA32 Physical Address Extensions. These extensions
+make it possible for a 32 bit guest Operating System to access more
+than 4GB of RAM. Enabling PAE also enabled other features such as
+NX. PAE is required if you wish to run a 64-bit guest Operating
+System. In general you should leave this enabled and allow the guest
+Operating System to choose whether or not to use PAE. (X86 only)
+
+=item B<acpi=BOOLEAN>
+
+Expose ACPI (Advanced Configuration and Power Interface) tables from
+the virtual firmware to the guest Operating System. ACPI is required
+by most modern guest Operating Systems. This option is enabled by
+default and usually you should omit it. However it may be necessary to
+disable ACPI for compatibility with some guest Operating Systems.
+
+=item B<apic=BOOLEAN>
+
+Include information regarding APIC (Advanced Programmable Interrupt
+Controller) in the firmware/BIOS tables on a single processor
+guest. This causes the MP (multiprocessor) and PIR (PCI Interrupt
+Routing) tables to be exported by the virtual firmware. This option
+has no effect on a guest with multiple virtual CPUS as they must
+always include these tables. This option is enabled by default and you
+should usually omit it but it may be necessary to disable these
+firmware tables when using certain older guest Operating
+Systems. These tables have been superceded by newer constructs within
+the ACPI tables. (X86 only)
+
+=item B<nx=BOOLEAN>
+
+Hides or exposes the No-eXecute capability. This allows a guest
+Operating system to map pages such that they cannot be executed which
+can enhance security. This options requires that PAE also be
+enabled. (X86 only)
+
+=item B<hpet=BOOLEAN>
+
+Enables or disables HPET (High Precision Event Timer). This option is
+enabled by default and you should usually omit it. It may be necessary
+to disable the HPET in order to improve compatibility with guest
+Operating Systems (X86 only)
+
+=item B<nestedhvm=BOOLEAN>
+
+Enable or disables guest access to hardware virtualisation features,
+e.g. it allows a guest Operating System to also function as a
+hypervisor. This option is disabled by default. You may want this
+option if you want to run another hypervisor (including another copy
+of Xen) within a Xen guest or to support a guest Operating System
+which uses hardware virtualisation extensions (e.g. Windows XP
+compatibility mode on more modern Windows OS).
+
+=back 
+
+=head3 Guest Virtual Time Controls
+
+=over 4
+
+=item B<tsc_mode="MODE">
+
+Specifies how the TSC (Time Stamp Counter) should be provided to the
+guest.  XXX ???
+
+=back
+
+=head3 Support for Paravirtualisation of HVM Guests
+
+The following options allow Paravirtualised features (such as devices)
+to be exposed to the guest Operating System in an HVM guest.
+Utilising these features requires specific guest support but when
+available they will result in improved performance.
+
+=over 4
+
+=item B<xen_platform_pci=BOOLEAN>
+
+Enable or disable the Xen platform PCI device.  The presence of this
+virtual device enables a guest Operating System (subject to the
+availability of suitable drivers) to make use of paravirtualisation
+features such as disk and network devices etc. Enabling these drivers
+improves performance and is strongly recommended when available. PV
+drivers are available for various Operating Systems including HVM
+Linux L<http://wiki.xen.org/wiki/XenLinuxPVonHVMdrivers> and Microsoft
+Windows L<http://wiki.xen.org/wiki/XenWindowsGplPv>.
+
+=item B<viridian=BOOLEAN>
+
+Turns on or off the exposure of MicroSoft Hyper-V (AKA viridian)
+compatible enlightenments to the guest.  These can improve performance
+of Microsoft Windows guests (XXX which versions of Windows benefit?)
+
+=back
+
+=head3 Emulated VGA Graphics Device
+
+The following options control the features of the emulated graphics
+device.  Many of these options behave similarly to the equivalent key
+in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
+(see above).
+
+=over 4
+
+=item B<videoram=MBYTES>
+
+Sets the amount of RAM which the emulated video card will contain,
+which in turn limits the resolutions and bit depths which will be
+available. This option is only available when using the B<stdvga>
+option (see below). The default is 8MB which is sufficient for
+e.g. 1600x1200 at 32bpp. When not using the B<stdvga> option the
+amount of video ram is fixed at 4MB which is sufficient for 1024x768
+at 32 bpp.
+
+=item B<stdvga=BOOLEAN>
+
+Select a standard VGA card with VBE (VESA BIOS Extensions) as the
+emulated graphics device. The default is false which means to emulate
+a Cirrus Logic GD5446 VGA card. If your guest supports VBE 2.0 or
+later (e.g. Windows XP onwards) then you should enable this.
+
+=item B<vnc=BOOLEAN>
+
+Allow access to the display via the VNC protocol.  This enables the
+other VNC-related settings.  The default is to enable this.
+
+=item B<vnclisten="ADDRESS[:DISPLAYNUM]">
+
+Specifies the IP address, and optionally VNC display number, to use.
+
+=item B<vncdisplay=DISPLAYNUM>
+
+Specifies the VNC display number to use. The actual TCP port number
+will be DISPLAYNUM+5900.
+
+=item B<vncunused=BOOLEAN>
+
+Requests that the VNC display setup search for a free TCP port to use.
+The actual display used can be accessed with C<xl vncviewer>.
+
+=item B<vncpasswd="PASSWORD">
+
+Specifies the password for the VNC server.
+
+=item B<keymap="LANG">
+
+Configure the keymap to use for the keyboard associated with this
+display. If the input method does not easily support raw keycodes
+(e.g. this is often the case when using VNC) then this allows us to
+correctly map the input keys into keycodes seen by the guest. The
+specific values which are accepted are defined by the version of the
+device-model which you are using. See L<Keymaps> below of consult the
+L<qemu(1)> manpage. The default is B<en-us>.
+
+=item B<sdl=BOOLEAN>
+
+Specifies that the display should be presented via an X window (using
+Simple DirectMedia Layer). The default is not to enable this mode.
+
+=item B<opengl=BOOLEAN>
+
+Enable OpenGL acceleration of the SDL display. Only effects machines
+using B<device_model_version="qemu-xen-traditonal"> and only if the
+device-model was compiled with OpenGL support. Disabled by default.
+
+=item B<nographic=BOOLEAN>
+
+Enable or disable the virtual graphics device.  The default is to
+provide a VGA graphics device but this option can be used to disable
+it.
+
+=back
+
+=head3 Spice Graphics Support
+
+The following options control the features of SPICE.
+
+=over 4
+
+=item B<spice=BOOLEAN>
+
+Allow access to the display via the SPICE protocol.  This enables the
+other SPICE-related settings.
+
+=item B<spicehost="ADDRESS">
+
+Specify the interface address to listen on if given, otherwise any
+interface.
+
+=item B<spiceport=NUMBER>
+
+Specify the port to listen on by the SPICE server if the SPICE is
+enabled.
+
+=item B<spicetls_port=NUMBER>
+
+Specify the secure port to listen on by the SPICE server if the SPICE
+is enabled. At least one of the spiceport or spicetls_port must be
+given if SPICE is enabled.  NB. the options depending on spicetls_port
+have not been supported.
+
+=item B<spicedisable_ticketing=BOOLEAN>
+
+Enable client connection without password. The default is false. If
+it's false (set to 0), spicepasswd must be set.
+
+=item B<spicepasswd="PASSWORD">
+
+Specify the ticket password which is used by a client for connection.
+
+=item B<spiceagent_mouse=BOOLEAN>
+
+Whether SPICE agent is used for client mouse mode. The default is true
+(turn on)
+
+=back
+
+=head3 Miscellaneous Emulated Hardware
+
+=over 4
+
+=item B<serial=DEVICE>
+
+Redirect the virtual serial port to B<DEVICE>. Please see the
+B<-serial> option in the L<qemu(1)> manpage for details of the valid
+B<DEVICE> options. Default is B<vc> when in graphical mode and
+B<stdio> if B<nographics=1> is used.
+
+=item B<soundhw=DEVICE>
+
+Select the virtual sound card to expose to the guest. The valid
+devices are defined by the device model configuration, please see the
+L<qemu(1)> manpage for details. The default is not to export any sound
+device.
+
+=item B<usb=BOOLEAN>
+
+Enables or disables a USB bus in the guest.
+
+=item B<usbdevice=DEVICE>
+
+Adds B<DEVICE> to the USB bus. The USB bus must also be enabled using
+B<usb=1>. The most common use for this option is B<usbdevice=tablet>
+which adds pointer device using absolute coordinates. Such devices
+function better than relative coordinate devices (such as a standard
+mouse) since many methods of exporting guest graphics (such as VNC)
+work better in this mode. Note that this is independent of the actual
+pointer device you are using on the host/client side. XXX should/could
+be a list of devices.
+
+=back
+
+=head3 Unclassified HVM Specific Options
+
+These HVM specific options have not yet been documented or
+classified. They almost certainly belong in a more appropriate
+section.
+
+=over 4
+
+=item B<vpt_align=BOOLEAN>
+
+Align the Virtual Platform Timer ??? XXX Reduces interrupts?
+
+=item B<timer_mode=NUMBER>
+
+Set mode for Virtual Timers XXX ??? should be an enum of particular
+values. See C<HVM_PARAM_TIMER_MODE> in
+F<xen/include/public/hvm/params.h>.
+
+=back
+
+=head2 Device-Model Options
+
+The following options control the selection of the device-model.  This
+is the component which provides emulation of the virtual devices to an
+HVM guest.  For a PV guest a device-model is sometimes used to provide
+backends for certain PV devices (most usually a virtual framebuffer
+device).
+
+=over 4
+
+=item B<device_model_version="DEVICE-MODEL">
+
+Selects which variant of the device-model should be used for this
+guest. Valid values are:
+
+=over 4
+
+=item B<qemu-xen-traditional>
+
+Use the device-model based upon the historical Xen fork of Qemu.  This
+device-model is currently the default.
+
+=item B<qemu-xen>
+
+use the device-model merged into the upstream Qemu project.  This
+device-model will become the default in a future version of Xen.
+
+=back
+
+It is recommended to accept the default value for new guests.  If
+you have existing guests then, depeending on the nature of the guest
+Operating System, you may wish to force them to use the device
+model which they were installed with.
+
+=item B<device_model_override="PATH">
+
+Override the path to the binary to be used as the device-model. The
+binary provided here MUST be consistent with the
+`device_model_version` which you have specified. You should not
+normally need to specify this option.
+
+=item B<device_model_stubdomain_override=BOOLEAN>
+
+Override the use of stubdomain based device-model.  Normally this will
+be automatically selected based upon the other features and options
+you have selected.
+
+=item B<device_model_args=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the devide-model command
+line. Each element in the list is passed as an option to the
+device-model.
+
+=item B<device_model_args_pv=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the devide-model command line for
+a PV device model only. Each element in the list is passed as an
+option to the device-model.
+
+=item B<device_model_args_hvm=[ "ARG", "ARG", ...]>
+
+Pass additional arbitrary options on the devide-model command line for
+an HVM device model only. Each element in the list is passed as an
+option to the device-model.
+
+=back
+
+=head2 Unclassified General Options
+
+These have not yet been fully documented or classified. They almost
+certainly belong in a more appropriate section.
+
+=over 4
+
+=item B<gfx_passthrough=BOOLEAN>
+
+Enable graphics device PCI passthrough. XXX which device is passed through ?
+
+=item B<nomigrate=BOOLEAN>
+
+Disable migration of this domain.  This enables certain other features
+which are incompatible with migration (currently certain TSC modes XXX
+?).
+
+=item B<pci_msitranslate=BOOLEAN>
+
+XXX
+
+=item B<pci_power_mgmt=BOOLEAN>
+
+XXX
+
+=item B<cpuid=XXX>
+
+XXX
+
+=back
+
+=head2 Keymaps
+
+The keymaps available are defined by the device-model which you are
+using. Commonly this includes:
+
+        ar  de-ch  es  fo     fr-ca  hu  ja  mk     no  pt-br  sv
+        da  en-gb  et  fr     fr-ch  is  lt  nl     pl  ru     th
+        de  en-us  fi  fr-be  hr     it  lv  nl-be  pt  sl     tr
+
+The default is B<en-us>.
+
+See L<qemu(1)> for more information.
+
+=head1 SEE ALSO
+
+=over 4
+
+=item L<xl(1)>
+
+=item F<xl-disk-configuration>
+
+=item F<xl-network-configuration>
+
+=back
+
+=head1 FILES
+
+F</etc/xen/NAME.cfg>
+F</var/xen/dump/NAME>
+F<docs/misc/tscmode.txt>
+
+=head1 BUGS
+
+This document is a work in progress and contains items which require
+further documentation and which are generally incomplete (marked with
+XXX).  However all options are included here whether or not they are
+fully documented.
+
+Patches to improve incomplete items (or any other item) would be
+greatfully received on the [email protected] mailing
+list. Please see L<http://wiki.xen.org/wiki/SubmittingXenPatches> for
+information on how to submit a patch to Xen.
+
docs/man/xl.pod.1 +12 -12
diff -r f3fc909a083d -r c88ff1ac2417 docs/man/xl.pod.1
@@ -54,7 +54,7 @@ previously, most commands take I<domain-
 
 =item B<create> [I<OPTIONS>] I<configfile>
 
-The create subcommand requires a config file: see L<xldomain.cfg> for
+The create subcommand requires a config file: see L<xl.cfg(5)> for
 full details of that file format and possible options.
 
 I<configfile> can either be an absolute path to a file, or a relative
@@ -232,7 +232,7 @@ FIXME: Why would you ever see this state
 
 The domain has crashed, which is always a violent ending.  Usually
 this state can only occur if the domain has been configured not to
-restart on crash.  See L<xldomain.cfg> for more info.
+restart on crash.  See L<xl.cfg(5)> for more info.
 
 =item B<d - dying>
 
@@ -319,8 +319,8 @@ executed the reboot action, which may be
 domain actually reboots.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_reboot> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_reboot> parameter of the domain configuration file when the
+domain was created.
 
 =item B<restore> [I<OPTIONS>] [I<ConfigFile>] I<CheckpointFile>
 
@@ -372,8 +372,8 @@ services must be shutdown in the domain.
 immediately after signally the domain unless that B<-w> flag is used.
 
 The behavior of what happens to a domain when it reboots is set by the
-B<on_shutdown> parameter of the xldomain.cfg file when the domain was
-created.
+B<on_shutdown> parameter of the domain configuration file when the
+domain was created.
 
 B<OPTIONS>
 
@@ -699,7 +699,7 @@ The domain id of the guest domain that t
 =item I<disc-spec-component>
 
 A disc specification in the same format used for the B<disk> variable in
-the domain config file. See L<xldomain.cfg>.
+the domain config file. See F<xl-disk-configuration>.
 
 =back
 
@@ -733,9 +733,9 @@ How the device should be presented to th
 
 =item I<be-dev>
 
-the device in the backend domain (usually domain 0) to be exported; it can be a
-path to a file (file://path/to/file.iso). See B<disk> in L<xldomain.cfg> for the
-details.
+the device in the backend domain (usually domain 0) to be exported; it
+can be a path to a file (file://path/to/file.iso). See B<disk> in
+L<xl.cfg(5)> for the details.
 
 =back
 
@@ -754,7 +754,7 @@ I<VirtualDevice> is the cdrom device in 
 
 Creates a new network device in the domain specified by I<domain-id>.
 I<network-device> describes the device to attach, using the same format as the
-B<vif> string in the domain config file. See L<xldomain.cfg> for the
+B<vif> string in the domain config file. See L<xl.cfg(5)> for the
 description.
 
 =item B<network-detach> I<domain-id> I<devid|mac>
@@ -795,7 +795,7 @@ List pass-through pci devices for a doma
 
 =head1 SEE ALSO
 
-B<xldomain.cfg>(5), B<xlcpupool.cfg>(5), B<xentop>(1)
+L<xl.cfg(5)>, L<xlcpupool.cfg(5)>, B<xentop(1)>
 
 =head1 AUTHOR
 
tools/examples/xlexample.hvm +1 -1
diff -r f3fc909a083d -r c88ff1ac2417 tools/examples/xlexample.hvm
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for an
-# HVM guest. For a more complete guide see <XXX Document TBD>
+# HVM guest. For a more complete guide see xl.cfg(5)
 
 # This configures an HVM rather than PV guest
 builder = "hvm"
tools/examples/xlexample.pvlinux +1 -1
diff -r f3fc909a083d -r c88ff1ac2417 tools/examples/xlexample.pvlinux
@@ -3,7 +3,7 @@
 # =====================================================================
 #
 # This is a fairly minimal example of what is required for a
-# Paravirtualised Linux guest. For a more complete guide see <XXX Document TBD>
+# Paravirtualised Linux guest. For a more complete guide see xl.cfg(5)
 
 # Guest name
 name = "example.pvlinux"
#6 lore raw

PATCH 1/1 xl: the name field in a guest config file is mandatory

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540536 0
# Node ID 22264859117b883d37b563ddad14515d80568a4e # Parent c88ff1ac24170a7d2a3c8824735ef9311eb95fe0
xl: the name field in a guest config file is mandatory

tools/libxl/xl_cmdimpl.c +4 -2
diff -r c88ff1ac2417 -r 22264859117b tools/libxl/xl_cmdimpl.c
@@ -575,8 +575,10 @@ static void parse_config_data(const char
     if (!xlu_cfg_get_long (config, "hap", &l))
         c_info->hap = l;
 
-    if (xlu_cfg_replace_string (config, "name", &c_info->name))
-        c_info->name = strdup("test");
+    if (xlu_cfg_replace_string (config, "name", &c_info->name)) {
+        fprintf(stderr, "Domain name must be specified.");
+        exit(1);
+    }
 
     if (!xlu_cfg_get_string (config, "uuid", &buf) ) {
         if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
#7 lore raw

PATCH 1/1 docs: generate docs direct into final filename

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540536 0
# Node ID f1464f6fba419acc019c824cea4aefb97b2360f6 # Parent 22264859117b883d37b563ddad14515d80568a4e
docs: generate docs direct into final filename

Nothing depends on the final document so there is not much point in generating to a tempfile and move-if-changed.

docs/Makefile +7 -14
diff -r 22264859117b -r f1464f6fba41 docs/Makefile
@@ -132,37 +132,30 @@ html/%.html: %.markdown
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
 	echo "Running markdown to generate $*.html ... "; \
-	$(MARKDOWN) $< > [email protected] ; \
-	$(call move-if-changed,[email protected],$@) ; else \
+	$(MARKDOWN) $< > $@ ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
 html/man/%.1.html: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
-	$(POD2HTML) --infile=$< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	$(POD2HTML) --infile=$< --outfile=$@
 
 html/man/%.5.html: man/%.pod.5 Makefile
 	$(INSTALL_DIR) $(@D)
-	$(POD2HTML) --infile=$< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	$(POD2HTML) --infile=$< --outfile=$@
 
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
-	cp $< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	cp $< $@
 
 txt/%.txt: %.markdown
 	$(INSTALL_DIR) $(@D)
-	cp $< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	cp $< $@
 
 txt/man/%.1.txt: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
-	$(POD2TEXT) $< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	$(POD2TEXT) $< $@
 
 txt/man/%.5.txt: man/%.pod.5 Makefile
 	$(INSTALL_DIR) $(@D)
-	$(POD2TEXT) $< [email protected]
-	$(call move-if-changed,[email protected],$@)
+	$(POD2TEXT) $< $@
#8 lore raw

Re: [PATCH 07 of 17] docs: generate docs direct into final filename

Ian Campbell writes ("[Xen-devel] [PATCH 07 of 17] docs: generate docs direct into final filename"):

Quoted 3 lines

docs: generate docs direct into final filename

Nothing depends on the final document

... except the user.

Quoted 2 lines

so there is not much point in generating
to a tempfile and move-if-changed.

We don't want to leave half-generated documents lying around which aren't fixed by "make", regardless of further dependencies, surely ?

Ian.

#9 lore raw

Re: [PATCH 07 of 17] docs: generate docs direct into final filename

Quoted 6 lines · Ian Jackson

Ian Campbell writes ("[Xen-devel] [PATCH 07 of 17] docs: generate docs direct into final filename"):

Quoted 3 lines

docs: generate docs direct into final filename

Nothing depends on the final document

... except the user.

OK, nothing about the build depends...

Quoted 5 lines
Quoted 2 lines

so there is not much point in generating
to a tempfile and move-if-changed.

We don't want to leave half-generated documents lying around which aren't fixed by "make", regardless of further dependencies, surely ?

Doesn't make automatically delete the targets if the command fails?

Ian.

#10 lore raw

Re: [PATCH 07 of 17] docs: generate docs direct into final filename

Ian Campbell writes ("Re: [Xen-devel] [PATCH 07 of 17] docs: generate docs direct into final filename"):

Quoted 5 lines · Ian Jackson
Quoted 2 lines

We don't want to leave half-generated documents lying around which aren't fixed by "make", regardless of further dependencies, surely ?

Doesn't make automatically delete the targets if the command fails?

Crash-only software. Or in other words, to write reliable software, do not rely on actions which are supposed to happen on error cleanup or exit.

Ian.

#11 lore raw

Re: [PATCH 07 of 17] docs: generate docs direct into final filename

Quoted 10 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH 07 of 17] docs: generate docs direct into final filename"):

Quoted 5 lines · Ian Jackson
Quoted 2 lines

We don't want to leave half-generated documents lying around which aren't fixed by "make", regardless of further dependencies, surely ?

Doesn't make automatically delete the targets if the command fails?

Crash-only software. Or in other words, to write reliable software, do not rely on actions which are supposed to happen on error cleanup or exit.

Also, my experiments suggest that make doesn't do this anyway (perhaps it's only for implicit intermediaries or something).

Do you want to pickup what you can from this series having dropped this patch and I'll repost the rest or shall I just repost the whole lot?

Ian.

#12 lore raw

Re: [PATCH 07 of 17] docs: generate docs direct into final filename

Quoted 12 lines · Ian Campbell
Quoted 10 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH 07 of 17] docs: generate docs direct into final filename"):

Quoted 5 lines · Ian Jackson
Quoted 2 lines

We don't want to leave half-generated documents lying around which aren't fixed by "make", regardless of further dependencies, surely ?

Doesn't make automatically delete the targets if the command fails?

Crash-only software. Or in other words, to write reliable software, do not rely on actions which are supposed to happen on error cleanup or exit.

Quoted 5 lines

Also, my experiments suggest that make doesn't do this anyway (perhaps it's only for implicit intermediaries or something).

Do you want to pickup what you can from this series having dropped this patch and I'll repost the rest or shall I just repost the whole lot?

I needed to rebase so I could get to work on your comments to patch 13 so I may as well repost.

Ian.

#13 lore raw

PATCH 1/1 xlu: add "dont_warn" to xlu_cfg_*

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540537 0
# Node ID 6911d1235f82e52b0b16eeb505ebf80054e47f40 # Parent f1464f6fba419acc019c824cea4aefb97b2360f6
xlu: add "dont_warn" to xlu_cfg_*

I want it for get_long but we might as well have it everywhere.

tools/libxl/libxlu_cfg.c +21 -18
diff -r f1464f6fba41 -r 6911d1235f82 tools/libxl/libxlu_cfg.c
@@ -165,17 +165,18 @@ static XLU_ConfigSetting *find(const XLU
 }
 
 static int find_atom(const XLU_Config *cfg, const char *n,
-                     XLU_ConfigSetting **set_r) {
+                     XLU_ConfigSetting **set_r, int dont_warn) {
     XLU_ConfigSetting *set;
 
     set= find(cfg,n);
     if (!set) return ESRCH;
 
     if (set->avalues!=1) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is"
-                " a list but should be a single value\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is"
+                    " a list but should be a single value\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *set_r= set;
@@ -183,49 +184,51 @@ static int find_atom(const XLU_Config *c
 }
 
 int xlu_cfg_get_string(const XLU_Config *cfg, const char *n,
-                       const char **value_r) {
+                       const char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     *value_r= set->values[0];
     return 0;
 }
 
 int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
-                           char **value_r) {
+                           char **value_r, int dont_warn) {
     XLU_ConfigSetting *set;
     int e;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     free(*value_r);
     *value_r= strdup(set->values[0]);
     return 0;
 }
 
 int xlu_cfg_get_long(const XLU_Config *cfg, const char *n,
-                     long *value_r) {
+                     long *value_r, int dont_warn) {
     long l;
     XLU_ConfigSetting *set;
     int e;
     char *ep;
 
-    e= find_atom(cfg,n,&set);  if (e) return e;
+    e= find_atom(cfg,n,&set,dont_warn);  if (e) return e;
     errno= 0; l= strtol(set->values[0], &ep, 0);
     e= errno;
     if (errno) {
         e= errno;
         assert(e==EINVAL || e==ERANGE);
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' could not be parsed"
-                " as a number: %s\n",
-                cfg->filename, set->lineno, n, strerror(e));
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' could not be parsed"
+                    " as a number: %s\n",
+                    cfg->filename, set->lineno, n, strerror(e));
         return e;
     }
     if (*ep || ep==set->values[0]) {
-        fprintf(cfg->report,
-                "%s:%d: warning: parameter `%s' is not a valid number\n",
-                cfg->filename, set->lineno, n);
+        if (!dont_warn)
+            fprintf(cfg->report,
+                    "%s:%d: warning: parameter `%s' is not a valid number\n",
+                    cfg->filename, set->lineno, n);
         return EINVAL;
     }
     *value_r= l;
tools/libxl/libxlutil.h +8 -4
diff -r f1464f6fba41 -r 6911d1235f82 tools/libxl/libxlutil.h
@@ -41,13 +41,17 @@ void xlu_cfg_destroy(XLU_Config*);
  * Return values are:
  *   0        OK
  *   ESRCH    not defined
- *   EINVAL   value found but wrong format for request (prints warning)
+ *   EINVAL   value found but wrong format for request (prints warning unless dont_warn=true)
  *   ERANGE   value out of range (from strtol)
  */
 
-int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r);
-int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n, char **value_r); /* free/strdup version */
-int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r);
+int xlu_cfg_get_string(const XLU_Config*, const char *n, const char **value_r,
+                       int dont_warn);
+/* free/strdup version */
+int xlu_cfg_replace_string(const XLU_Config *cfg, const char *n,
+                           char **value_r, int dont_warn);
+int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
tools/libxl/xl.c +3 -3
diff -r f1464f6fba41 -r 6911d1235f82 tools/libxl/xl.c
@@ -62,10 +62,10 @@ static void parse_global_config(const ch
         exit(1);
     }
 
-    if (!xlu_cfg_get_long (config, "autoballoon", &l))
+    if (!xlu_cfg_get_long (config, "autoballoon", &l, 0))
         autoballoon = l;
 
-    if (!xlu_cfg_get_string (config, "lockfile", &buf))
+    if (!xlu_cfg_get_string (config, "lockfile", &buf, 0))
         lockfile = strdup(buf);
     else {
         e = asprintf(&lockfile, "%s/xl", (char *)libxl_lock_dir_path());
@@ -75,7 +75,7 @@ static void parse_global_config(const ch
         }
     }
 
-    if (!xlu_cfg_get_string (config, "vifscript", &buf))
+    if (!xlu_cfg_get_string (config, "vifscript", &buf, 0))
         default_vifscript = strdup(buf);
 
     xlu_cfg_destroy(config);
tools/libxl/xl_cmdimpl.c +76 -74

335 lines not on this page · raw message

#14 lore raw

PATCH 1/1 libxl: use named options for tsc_mode

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321540537 0
# Node ID c4571d33f5829bac2e1da169f9d1398810c0b7d2 # Parent 6911d1235f82e52b0b16eeb505ebf80054e47f40
libxl: use named options for tsc_mode.

Add an enum at the libxl level with a hopefully descriptive set of names. Deprecate the use of an integer in xl cfg files.

Signed-off-by Ian Campbell
docs/man/xl.cfg.pod.5 +35 -1
diff -r 6911d1235f82 -r c4571d33f582 docs/man/xl.cfg.pod.5
@@ -491,11 +491,45 @@ compatibility mode on more modern Window
 
 =item B<tsc_mode="MODE">
 
+
 Specifies how the TSC (Time Stamp Counter) should be provided to the
-guest.  XXX ???
+guest (X86 only). Specifying this option as a number is
+deprecated. Options are:
+
+=over 4
+
+=item B<"default">
+
+Guest rdtsc/p executed natively when monotonicity can be guaranteed
+and emulated otherwise (with frequency scaled if necessary).
+
+=item B<"always_emulate">
+
+Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p
+always emulated and the virtual TSC will appear to increment (kernel
+and user) at a fixed 1GHz rate, regardless of the PCPU HZ rate or
+power state; Although there is an overhead associated with emulation
+this will NOT affect underlying CPU performance.
+
+=item B<"native">
+
+Guest rdtsc always executed natively (no monotonicity/frequency
+guarantees); guest rdtscp emulated at native frequency if unsupported
+by h/w, else executed natively.
+
+=item B<"native_paravirt">
+
+Same as B<native>, except xen manages TSC_AUX register so guest can
+determine when a restore/migration has occurred and assumes guest
+obtains/uses pvclock-like mechanism to adjust for monotonicity and
+frequency changes.
 
 =back
 
+=back
+
+Please see F<docs/misc/tscmode.txt> for more information on this option.
+
 =head3 Support for Paravirtualisation of HVM Guests
 
 The following options allow Paravirtualised features (such as devices)
tools/libxl/libxl_dom.c +18 -1
diff -r 6911d1235f82 -r c4571d33f582 tools/libxl/libxl_dom.c
@@ -73,12 +73,29 @@ int libxl__build_pre(libxl__gc *gc, uint
               libxl_domain_build_info *info, libxl__domain_build_state *state)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
+    int tsc_mode;
     xc_domain_max_vcpus(ctx->xch, domid, info->max_vcpus);
     xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb + LIBXL_MAXMEM_CONSTANT);
     if (info->type == LIBXL_DOMAIN_TYPE_PV)
         xc_domain_set_memmap_limit(ctx->xch, domid,
                 (info->max_memkb + info->u.pv.slack_memkb));
-    xc_domain_set_tsc_info(ctx->xch, domid, info->tsc_mode, 0, 0, 0);
+    switch (info->tsc_mode) {
+    case LIBXL_TSC_MODE_DEFAULT:
+        tsc_mode = 0;
+        break;
+    case LIBXL_TSC_MODE_ALWAYS_EMULATE:
+        tsc_mode = 1;
+        break;
+    case LIBXL_TSC_MODE_NATIVE:
+        tsc_mode = 2;
+        break;
+    case LIBXL_TSC_MODE_NATIVE_PARAVIRT:
+        tsc_mode = 3;
+        break;
+    default:
+        abort();
+    }
+    xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
     if ( info->disable_migrate )
         xc_domain_disable_migrate(ctx->xch, domid);
 
tools/libxl/libxl_types.idl +8 -1
diff -r 6911d1235f82 -r c4571d33f582 tools/libxl/libxl_types.idl
@@ -85,6 +85,13 @@ libxl_button = Enumeration("button", [
     (2, "SLEEP"),
     ])
 
+libxl_tsc_mode = Enumeration("tsc_mode", [
+    (0, "default"),
+    (1, "always_emulate"),
+    (2, "native"),
+    (3, "native_paravirt"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -154,7 +161,7 @@ libxl_domain_create_info = Struct("domai
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("cur_vcpus",       integer),
-    ("tsc_mode",        integer),
+    ("tsc_mode",        libxl_tsc_mode),
     ("max_memkb",       uint32),
     ("target_memkb",    uint32),
     ("video_memkb",     uint32),
tools/libxl/xl_cmdimpl.c +22 -2
diff -r 6911d1235f82 -r c4571d33f582 tools/libxl/xl_cmdimpl.c
@@ -328,7 +328,7 @@ static void printf_info(int domid,
 
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
-    printf("\t(tsc_mode %d)\n", b_info->tsc_mode);
+    printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
     printf("\t(max_memkb %d)\n", b_info->max_memkb);
     printf("\t(target_memkb %d)\n", b_info->target_memkb);
     printf("\t(nomigrate %d)\n", b_info->disable_migrate);
@@ -662,8 +662,28 @@ static void parse_config_data(const char
     if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
         b_info->disable_migrate = l;
 
-    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 0))
+    if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
+        const char *s = libxl_tsc_mode_to_string(l);
+        fprintf(stderr, "WARNING: specifying \"tsc_mode\" as an integer is deprecated. "
+                "Please use the named parameter variant. %s%s%s\n",
+                s ? "e.g. tsc_mode=\"" : "",
+                s ? s : "",
+                s ? "\"" : "");
+
+        if (l < LIBXL_TSC_MODE_DEFAULT ||
+            l > LIBXL_TSC_MODE_NATIVE_PARAVIRT) {
+            fprintf(stderr, "ERROR: invalid value %ld for \"tsc_mode\"\n", l);
+            exit (1);
+        }
         b_info->tsc_mode = l;
+    } else if (!xlu_cfg_get_string(config, "tsc_mode", &buf, 0)) {
+        fprintf(stderr, "got a tsc mode string: \"%s\"\n", buf);
+        if (libxl_tsc_mode_from_string(buf, &b_info->tsc_mode)) {
+            fprintf(stderr, "ERROR: invalid value \"%s\" for \"tsc_mode\"\n",
+                    buf);
+            exit (1);
+        }
+    }
 
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
#15 lore raw

PATCH 1/1 docs: remove non-breaking spaces from sedf_scheduler_mini-HOWTO.txt

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1321541652 0
# Node ID 617f5d6e9e69b4f6362df91f078b7dc2abdbd80a
# Parent c4571d33f5829bac2e1da169f9d1398810c0b7d2
docs: remove non-breaking spaces from sedf_scheduler_mini-HOWTO.txt

This document contains several 0xa0 characters (non-breaking spaces). These do not display correctly in (some) terminals or when the document is rendered by (some) browsers. Re-encode them as spaces.

I'm not confident that this change will make it through being encoded as a patch and sent through email. Its effect can be replicated with:

perl -i -p -e 's/\xa0/ /g' docs/misc/sedf_scheduler_mini-HOWTO.txt

docs/misc/sedf_scheduler_mini-HOWTO.txt +25 -25
diff -r c4571d33f582 -r 617f5d6e9e69 docs/misc/sedf_scheduler_mini-HOWTO.txt
@@ -8,37 +8,37 @@ Overview:
   uses realtime-algorithms to ensure time guarantees.
 
 Usage:
-   -add "sched=sedf" on Xen's boot command-line
-   -create domains as usual
-   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
-    Where:
-      -period/slice are the normal EDF scheduling parameters in nanosecs
-      -latency-hint is the scaled period in case the domain is doing heavy I/O
+   -add "sched=sedf" on Xen's boot command-line
+   -create domains as usual
+   -use "xm sched-sedf <dom-id> <period> <slice> <latency-hint> <extra> <weight>"
+    Where:
+      -period/slice are the normal EDF scheduling parameters in nanosecs
+      -latency-hint is the scaled period in case the domain is doing heavy I/O
          (unused by the currently compiled version)
-      -extra is a flag (0/1), which controls whether the domain can run in
+      -extra is a flag (0/1), which controls whether the domain can run in
        extra-time
-      -weight is mutually exclusive with period/slice and specifies another
+      -weight is mutually exclusive with period/slice and specifies another
        way of setting a domains cpu slice
 
 Examples:
- normal EDF (20ms/5ms):
-  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
+ normal EDF (20ms/5ms):
+  xm sched-sedf <dom-id> 20000000 5000000 0 0 0
   
- best-effort domains (i.e. non-realtime):
-  xm sched-sedf <dom-id> 20000000 0 0 1 0
- 
+ best-effort domains (i.e. non-realtime):
+  xm sched-sedf <dom-id> 20000000 0 0 1 0
+ 
  normal EDF (20ms/5ms) + share of extra-time:
-  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
+  xm sched-sedf <dom-id> 20000000 5000000 0 1 0
   
- 4 domains with weights 2:3:4:2
-  xm sched-sedf <d1> 0 0 0 0 2
-  xm sched-sedf <d2> 0 0 0 0 3
-  xm sched-sedf <d3> 0 0 0 0 4
-  xm sched-sedf <d4> 0 0 0 0 2
+ 4 domains with weights 2:3:4:2
+  xm sched-sedf <d1> 0 0 0 0 2
+  xm sched-sedf <d2> 0 0 0 0 3
+  xm sched-sedf <d3> 0 0 0 0 4
+  xm sched-sedf <d4> 0 0 0 0 2
   
- 1 fully-specified (10ms/3ms) domain, 3 other domains share
- available rest in 2:7:3 ratio:
-  xm sched-sedf <d1> 10000000 3000000 0 0 0
-  xm sched-sedf <d2> 0 0 0 0 2
-  xm sched-sedf <d3> 0 0 0 0 7
-  xm sched-sedf <d4> 0 0 0 0 3
+ 1 fully-specified (10ms/3ms) domain, 3 other domains share
+ available rest in 2:7:3 ratio:
+  xm sched-sedf <d1> 10000000 3000000 0 0 0
+  xm sched-sedf <d2> 0 0 0 0 2
+  xm sched-sedf <d3> 0 0 0 0 7
+  xm sched-sedf <d4> 0 0 0 0 3
#16 lore raw

PATCH 1/1 docs: remove some fatally out of date documentation

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321541678 0
# Node ID 55ce23cb7b2af3c497b3a10658e09d5fc11eb45f # Parent 617f5d6e9e69b4f6362df91f078b7dc2abdbd80a
docs: remove some fatally out of date documentation

I think these are better off deleted than remaining to confuse people.

docs/misc/blkif-drivers-explained.txt:

- Talks about Xen 2.0 beta, talks about the old pre-xenstored IPC mechanism.

docs/misc/cpuid-config-for-guest.txt:

- Doesn't really say anything, in particular doesn't actually describe how to configure CPUID.

docs/misc/hg-cheatsheet.txt:

- Not out of date per-se wrt mercural but talk about Xen 2.0 and gives URLs under www.cl.cam.ac.uk. Talks a lot about bitkeeper. Given that mercurial is hardly unusual anymore I think there must be better guides out there so this one is not worth resurecting.

docs/misc/network_setup.txt:

- This is more comprehensively documented on the wiki these days.

docs/misc/VMX_changes.txt:

- Is basically a changelog from the initial implementation of VMX in 2004.

I'm not sure about some of the other docs, but these ones seemed fairly obvious.

docs/misc/VMX_changes.txt deleted +0 -90
diff -r 617f5d6e9e69 -r 55ce23cb7b2a docs/misc/VMX_changes.txt
@@ -1,90 +0,0 @@
-Changes to Xen in support of Intel(R) Vanderpool Technology
--------------------------------------------------------------
-
-Our VT extensions to the Xen hypervisor provide full platform
-virtualization, including CPU(s), memory, and I/O infrastructure. The
-generic code in Xen handles and schedules those virtual machines as it
-does for the existing para-virtualized domains.
-
-Full virtualization required by the OS guests requires full device
-virtualization as well. The device models in BOCHS
-(http://bochs.sourceforge.net/) were decoupled from the CPU
-virtualization, and are used to virtualize the legacy devices (such as
-keyboard, mouse, VGA, IDE) in the PC platform. At this point, the
-device models run in user mode on domain 0, not in the Xen hypervisor.
-
-We would like to thank Ian Pratt and Keir Fraser for reviewing our
-design and code intensively, and for providing numerous useful
-suggestions to improve the architecture and code. 
-
-We have a list of Intel team members who take credit for making this
-release happen: Yunhong Jiang, Nitin Kamble, Chengyuan Li, Xin Li,
-Xiaofeng Ling, Benjamin Liu, Asit Mallick, Jun Nakajima, Sunil Saxena,
-Arun Sharma, Edwin Zhai, Jeff Zheng, and Louis Zhuang. We'll continue
-to add more features to complete full virtualization in Xen using VT.
-
-The notes document the changes to the Xen hypervisor in order to add
-VT support. The changes to other areas, such as Control Panel will be
-added as we deliver the code.
-
-Summary of changes for the first release
-----------------------------------------
-December 15, 2004
-
-    * VT specific event handling and domain management were added. 
-
-    * Shadow mode was extended to support full 32-bit guests
-    
-    * Domain switching code was extended to support VT domain
-    
-    * I/O request handling was added to communicate with the device model
-
-    * Domain builder was extended to provide the environment when the
-      guest enters the protected mode, including E820 memory and VGA
-      info, typically obtained by BIOS calls.
-
-New code:
----------
-    VT (Vanderpool Technology) is based on the new VMX (Virtual
-    Machine Extensions) architecture. The current release of the
-    software supports 32-bit only.
-
-    * arch/x86/vmx.[ch] and arch/x86/vmx_*.[ch]: created to handle
-      VMX-specific events in order to provide virtual machine.
-
-    * arch/x86/x86_32/entry.S: new code path was added to have the
-      first-level handler from VM exits. The first-level handler calls
-      the second-level handler in arch/x86/vmx.c.
-
-    * arch/x86/setup.c: new function start_vmx() to init_intel() to
-      enable VMX mode.
-
-    * include/asm-x86/config.h: #ifdef CONFIG_VMX was added.
-
-    * arch/x86/domain.c: new code patch was added to create a VMX
-      domain given the flag from the control panel.
-
-    * include/public/io/ioreq.h: A new data structure was added to
-      define the I/O requests between the Xen hypervisor and the
-      device models.
-
-Changes to the existing code:
------------------------------
-
-    * arch/x86/shadow.[ch]: new mode SHM_full_32 was added to support
-      full virtualization. The current Xen code assumes that the guest
-      page directory and tables have _machine_ (or host) physical page
-      frame numbers, and the new code allows to support _guest_
-      physical page frame numbers
-
-    * include/asm-x86/processor.h: struct arch_vmx_struct arch_vmx has
-      been added to the thread_struct data structure. The arch_vmx has
-      the additional VMX-related CPU context.
-
-    * arch/x86/io_apic.c: reverse mapping between vector and irq has
-      been added. We will revisit this code when considering MSI
-      support.
-
---- Jun
-
-
docs/misc/blkif-drivers-explained.txt deleted +0 -485

485 lines not on this page · raw message

docs/misc/cpuid-config-for-guest.txt deleted +0 -23
diff -r 617f5d6e9e69 -r 55ce23cb7b2a docs/misc/cpuid-config-for-guest.txt
@@ -1,23 +0,0 @@
-CPUID emulation for guest
--------------------------
-
-When HVM guest tries to execute CPUID, or PV guest tries to execute XEN_CPUID,
-the xen hypervior traps and emultes them.
-
-For HVM guest and PV DomU guest, xen's CPUID emulation can be adjusted using
-the guest configation file if necessary (e.g., to supply better support for
-guest live migration). The CPUID syntax in guest configration file is
-described in detail in the examples like /etc/xen/xmexample.hvm,
-/etc/xen/xmexample.hvm-stubdom.
-
-However, a user (or an administrator) must be aware that the CPUID in guest
-configuration file can NOT be configured casually. The default CPUID
-configuration should be safe, but illegal configuration can cause unexpected
-behaviors of guest -- even can crash guest.
-
-For example, we should not expose the MONITOR CPUID feature flag (ECX bit 3;
-CPUID executed EAX = 1) to HVM guest, otherwise, on guest's attempt of
-executing MWAIT, the VMExit handler in Xen would inject #UD (Invalid Opcode
-Exception) into the HVM guest, and guest kernel would panic.
-
-/* We can add more unsafe CPUID configuration here in future. */
docs/misc/hg-cheatsheet.txt deleted +0 -438

438 lines not on this page · raw message

docs/misc/network_setup.txt deleted +0 -196

196 lines not on this page · raw message

#17 lore raw

PATCH 1/1 docs: tweak markup and wording of qemu upstream doc slightly

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1321541678 0
# Node ID c1f8406da50743cd0597b93c4b5b8b6ff03ede42 # Parent 55ce23cb7b2af3c497b3a10658e09d5fc11eb45f
docs: tweak markup and wording of qemu upstream doc slightly

docs/misc/qemu-upstream_howto_use_it.markdown +15 -14
diff -r 55ce23cb7b2a -r c1f8406da507 docs/misc/qemu-upstream_howto_use_it.markdown
@@ -1,11 +1,11 @@
-Help to use QEMU (upstream version) with Xen
-============================================
+Using Upstream QEMU with Xen
+============================
 
 Note
 ----
 
 All these steps will become unnecessary after the patches to integrate
-SeaBIOS/QEMU build will be applied.
+SeaBIOS/QEMU into the Xen build system have been applied.
 
 
 How to build it
@@ -15,14 +15,15 @@ How to build it
 
 The new device-model needs a different BIOS, SeaBIOS. Clone the repository from:
 
-  - git://git.qemu.org/seabios.git
-  - http://git.qemu.org/git/seabios.git
+  - [git://git.qemu.org/seabios.git]()
+  - [http://git.qemu.org/git/seabios.git]()
 
-Put the `.config` file in the appendix at the root of seabios.git and build SeaBIOS.
+Put the `.config` file in the appendix at the root of `seabios.git`
+and build SeaBIOS by typing `make`.
 
-In xen-unstable source tree, add the file `.config` with
+In the xen-unstable source tree, add the file `.config` with
 `SEABIOS_DIR = /path/to/seabios.git`.
-To build hvmloader with SeaBIOS, you propably need to `make -C tools/firmware
+To build hvmloader with SeaBIOS, you probably need to `make -C tools/firmware
 clean` first and then `make tools`, to use the new SEABIOS_DIR parameter.
 
 
@@ -30,10 +31,10 @@ clean` first and then `make tools`, to u
 
 Get QEMU upstream source from:
 
-  - git://xenbits.xensource.com/qemu-upstream-unstable.git
-  - http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git
+  - [git://xenbits.xensource.com/qemu-upstream-unstable.git]()
+  - [http://xenbits.xensource.com/git-http/qemu-upstream-unstable.git]()
 
-To configure build QEMU upstream with Xen
+To configure QEMU upstream with support for Xen:
 
     ./configure --enable-xen --target-list=i386-softmmu --extra-cflags="-I$path_to_xen_source/tools/include -I$path_to_xen_source/tools/libxc -I$path_to_xen_source/tools/xenstore" --extra-ldflags="-L$path_to_xen_source/tools/libxc -L$path_to_xen_source/tools/xenstore"
 
@@ -43,15 +44,15 @@ You can also use other several options s
 How to use QEMU upstream
 ------------------------
 
-Only xl support QEMU upstream.
+Only `xl` supports QEMU upstream.
 
 To actually use it, add or change this in your VM configuration file:
 
     device_model_version = 'qemu-xen'
     device_model_override = '/path/to/qemu/i386-softmmu/qemu'
 
-NB: On qemu-upstream repository, the default binary name has been renamed to
-`qemu-system-i386`.
+NB: In the `qemu-upstream` repository, the default binary name has been
+renamed to `qemu-system-i386`.
 
 
 Appendix
#18 lore raw

PATCH 1/1 docs: generate an index for the html output

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321542075 0
# Node ID 8f2404eef8fac8020528b408b3a958d81cbb73c0 # Parent c1f8406da50743cd0597b93c4b5b8b6ff03ede42
docs: generate an index for the html output

nb: I'm not a Perl wizard...

docs/INDEX new file +5 -0
diff -r c1f8406da507 -r 8f2404eef8fa docs/INDEX
@@ -0,0 +1,5 @@
+misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
+
+# These are not all that useful anymore, hide them from the index
+interface/index			NO-INDEX
+user/index			NO-INDEX
docs/Makefile +4 -1
diff -r c1f8406da507 -r 8f2404eef8fa docs/Makefile
@@ -45,7 +45,7 @@ ps: $(DOC_PS)
 pdf: $(DOC_PDF)
 
 .PHONY: html
-html: $(DOC_HTML)
+html: $(DOC_HTML) html/index.html
 
 .PHONY: txt
 txt: $(DOC_TXT)
@@ -128,6 +128,9 @@ html/%/index.html: src/%.tex
 	$< 1>/dev/null 2>/dev/null ; else \
 	echo "latex2html not installed; skipping $*."; fi
 
+html/index.html: $(DOC_HTML) ./gen-html-index INDEX
+	./gen-html-index -i INDEX html $(DOC_HTML)
+
 html/%.html: %.markdown
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
docs/gen-html-index new file +129 -0

129 lines not on this page · raw message

#19 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

Ian Campbell writes ("[Xen-devel] [PATCH 13 of 17] docs: generate an index for the html output"):

Quoted 3 lines

docs: generate an index for the html output

nb: I'm not a Perl wizard...

The Perl looks reasonable in general, except that some of the style is a bit odd. perlstyle(1) is mostly a good guide.

In particular

Quoted 1 line

+sub write_file ($$) {

                 ^

vs.

Quoted 1 line

+sub make_page($$$) {

                ^

perlsub(1) suggests inculding the space in Perl sub prototypes. (Multiple occurrences.)

Quoted 1 line

+ $l =~ s/.(html)$//g;

Why the capturing parens ?

Review

Quoted 2 lines
(quoted diff) +2 -0
+    if ( $title eq "" )
+    {

Brace should be on the same line.

docs/gen-html-index line 43

Quoted 1 line
docs/gen-html-index new file +1 -0
+	$title = $h1 = "Xen Documentation";

And indent should be 4, not 1. (Multiple occurrences.)

docs/gen-html-index line 60

Quoted 2 lines
docs/gen-html-index new file +2 -0
+    print STDERR "Writing: $file\n";
+    write_file($file, $o);

Perhaps (i) the print should be to STDOUT (ii) it should be in write_file ?

Review

Quoted 2 lines
(quoted diff) +2 -0
+sub read_index
+{

Missing prototype and bracket should be on same line. To make the prototype work you'll probably have to move the definition to before the option parser call (or have a declaration). Perhaps the main program should be at the bottom.

docs/gen-html-index line 94

Quoted 1 line
docs/gen-html-index new file +1 -0
+	s/#.*$//;

This of course prevents link anchor texts in the inde including #, which is probably an error which it would be nice to sort out now rather than in the future when we'll have to read this script to make it cope.

docs/gen-html-index line 96

Quoted 1 line
docs/gen-html-index new file +1 -0
+	m/([^\t]+)\t+(.*)/ or die;

This reliance on hard tabs will irritate many people. You should use \S and \s. The filenames (the LHS) won't contain whitespace of course.

Also you probably meant to anchor the pattern. I would do something like:

    s/^\s+//;
    s/\s+$//;
    next if m/^\#/;
    next unless m/\S/;
    m/^(\S+)\s+(\S.*)$/ or die;
Quoted 1 line

+for (@docs) { s,^${outdir}/,, }

This is not correct because $outdir is not a regular expression. The shortest way of doing this is indeed substr.

docs/gen-html-index line 108

Quoted 4 lines
docs/gen-html-index new file +4 -0
+my $top = '';
+
+foreach my $od (sort { $a cmp $b } uniq map { dirname($_) } @docs) {
+    my @d = (grep /^$od/, @docs);

Again, directory names are not regexps.

Do we really want an index per subdirectory ?

Quoted 1 line

+ if ( $#d == 0 and $d[0] eq "$od/index.html" )

$#d==0 is a rather odd way of putting it. I would write @d==1.

docs/gen-html-index line 118

Quoted 4 lines
docs/gen-html-index new file +4 -0
+	$top .= "<li><a href=\"${od}/index.html\">$od</a></li>\n";
+	$top .= "<ul>\n";
+	$top .= make_links($od,0,@d);
+	$top .= "</ul>\n";

Maybe this wants a here document ?

        my $links = make_links blah blah;
        $top .= <<END;

Ian.

#20 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

Quoted 7 lines · Ian Jackson

Ian Campbell writes ("[Xen-devel] [PATCH 13 of 17] docs: generate an index for the html output"):

Quoted 3 lines

docs: generate an index for the html output

nb: I'm not a Perl wizard...

The Perl looks reasonable in general, except that some of the style is a bit odd. perlstyle(1) is mostly a good guide.

Thanks for the thorough review. I've trimmed everything I agree with and don't have a comment on.

Quoted 3 lines
Quoted 1 line

+ $l =~ s/.(html)$//g;

Why the capturing parens ?

I had intended to add "|txt" etc at some point. I suppose this ought to be (?:...) instead though.

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+    if ( $title eq "" )
+    {

Brace should be on the same line.

docs/gen-html-index line 43

Quoted 1 line
docs/gen-html-index new file +1 -0
+	$title = $h1 = "Xen Documentation";

And indent should be 4, not 1. (Multiple occurrences.)

emacs seems to default to indentations of 4 spaces but unhelpfully turns two lots of that into a hard tab. I'll figure out how to nix that behaviour.

Quoted 6 lines

docs/gen-html-index line 94

Quoted 1 line
docs/gen-html-index new file +1 -0
+	s/#.*$//;

This of course prevents link anchor texts in the inde including #, which is probably an error which it would be nice to sort out now rather than in the future when we'll have to read this script to make it cope.

Looks like (in the suggested code below) requiring the # to be in the first column instead is your preferred solution here? Works for me.

Quoted 7 lines

Also you probably meant to anchor the pattern. I would do something like:

    s/^\s+//;
    s/\s+$//;
    next if m/^\#/;
    next unless m/\S/;

I think that would be a syntax error so die unless m/\S/ ?

Quoted 6 lines
    m/^(\S+)\s+(\S.*)$/ or die;
Quoted 1 line

+for (@docs) { s,^${outdir}/,, }

This is not correct because $outdir is not a regular expression. The shortest way of doing this is indeed substr.

OK.

Aside: how does one dynamically construct a regex then?

Quoted 1 line

Do we really want an index per subdirectory ?

I was thinking of folks how manually type urls or who string the last element off. Having an index in each dir ensures they get something structured and not the apache generated thing.

It does complicate the code though so I could be convinced to drop it.

Ian.

#21 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

Ian Campbell writes ("Re: [Xen-devel] [PATCH 13 of 17] docs: generate an index for the html output"):

Quoted 4 lines · Ian Jackson
Quoted 1 line
    next unless m/\S/;

I think that would be a syntax error so die unless m/\S/ ?

Surely ignoring blank lines is going to be less irritating.

Quoted 6 lines
Quoted 2 lines

This is not correct because $outdir is not a regular expression. The shortest way of doing this is indeed substr.

OK.

Aside: how does one dynamically construct a regex then?

However you like. Make a variable which contains your regexp. If you have a string in a scalar and want a regexp which matches that string you can do this:
my $regexp = $string;
$regexp =~ s/\W/\\$&/g;
... m/^$regexp/ ...

Quoted 5 lines
Quoted 1 line

Do we really want an index per subdirectory ?

I was thinking of folks how manually type urls or who string the last element off. Having an index in each dir ensures they get something structured and not the apache generated thing.

True.

Quoted 1 line

It does complicate the code though so I could be convinced to drop it.

No, that's OK.

Ian.

#22 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

Quoted 7 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH 13 of 17] docs: generate an index for the html output"):

Quoted 4 lines · Ian Jackson
Quoted 1 line
    next unless m/\S/;

I think that would be a syntax error so die unless m/\S/ ?

Surely ignoring blank lines is going to be less irritating.

I missed that this was \S not \s. Your way does indeed make sense.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

This is not correct because $outdir is not a regular expression. The shortest way of doing this is indeed substr.

OK.

Quoted 8 lines
Quoted 1 line

Aside: how does one dynamically construct a regex then?

However you like. Make a variable which contains your regexp. If you have a string in a scalar and want a regexp which matches that string you can do this:

   my $regexp = $string;
   $regexp =~ s/\W/\\$&/g;
   ... m/^$regexp/ ...

Ah, I thought you were suggesting that /$something/ was not valid at all, but you meant only if you don't correctly quote it etc.

Thanks,
Ian.

Quoted 14 lines
Quoted 6 lines
Quoted 2 lines

Do we really want an index per subdirectory ?

I was thinking of folks how manually type urls or who string the last element off. Having an index in each dir ensures they get something structured and not the apache generated thing.

True.

Quoted 1 line

It does complicate the code though so I could be convinced to drop it.

No, that's OK.

Ian.

#23 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

In reply to Ian Campbell

2011/11/17 Ian Campbell <[email protected]>:

Quoted 46 lines

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321542075 0
# Node ID 8f2404eef8fac8020528b408b3a958d81cbb73c0 # Parent  c1f8406da50743cd0597b93c4b5b8b6ff03ede42
docs: generate an index for the html output

nb: I'm not a Perl wizard...

diff -r c1f8406da507 -r 8f2404eef8fa docs/INDEX

docs/INDEX        Thu Nov 17 15:01:15 2011 +0000 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +5 -0
@@ -0,0 +1,5 @@
+misc/hvm-emulated-unplug       Xen HVM emulated device unplug protocol
+
+# These are not all that useful anymore, hide them from the index
+interface/index                        NO-INDEX
+user/index                     NO-INDEX

diff -r c1f8406da507 -r 8f2404eef8fa docs/Makefile

docs/Makefile     Thu Nov 17 15:01:15 2011 +0000 renamed from docs/Makefile     Thu Nov 17 14:54:38 2011 +0000 +0 -0
@@ -45,7 +45,7 @@ ps: $(DOC_PS)
  pdf: $(DOC_PDF)
 

 .PHONY: html

docs/Makefile     Thu Nov 17 15:01:15 2011 +0000 renamed from docs/Makefile     Thu Nov 17 14:54:38 2011 +0000 +1 -1
-html: $(DOC_HTML)
+html: $(DOC_HTML) html/index.html

 .PHONY: txt
 txt: $(DOC_TXT)

docs/Makefile     Thu Nov 17 15:01:15 2011 +0000 renamed from docs/Makefile     Thu Nov 17 14:54:38 2011 +0000 +0 -0
@@ -128,6 +128,9 @@ html/%/index.html: src/%.tex
        $< 1>/dev/null 2>/dev/null ; else \

       echo "latex2html not installed; skipping $*."; fi

docs/Makefile     Thu Nov 17 15:01:15 2011 +0000 renamed from docs/Makefile     Thu Nov 17 14:54:38 2011 +0000 +3 -0
+html/index.html: $(DOC_HTML) ./gen-html-index INDEX
+       ./gen-html-index -i INDEX html $(DOC_HTML)
+

 html/%.html: %.markdown
       @$(INSTALL_DIR) $(@D)
       @set -e ; if which $(MARKDOWN) 1>/dev/null 2>/dev/null; then \
diff -r c1f8406da507 -r 8f2404eef8fa docs/gen-html-index

docs/gen-html-index       Thu Nov 17 15:01:15 2011 +0000 line 1

Quoted 1 line
docs/gen-html-index       Thu Nov 17 15:01:15 2011 +0000 renamed from dev/null   Thu Jan 01 00:00:00 1970 +0000 +1 -0
@@ -0,0 +1,129 @@
+#!/usr/bin/perl -w

Please use "/usr/bin/env perl" or call the script from the Makefile with "perl ./..." (as Ian Jackson has done in his patch to import queue.h)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#24 lore raw

Re: [PATCH 13 of 17] docs: generate an index for the html output

Quoted 6 lines · Roger Pau Monné

2011/11/17 Ian Campbell <[email protected]>:

Quoted 1 line

+#!/usr/bin/perl -w

Please use "/usr/bin/env perl" or call the script from the Makefile with "perl ./..." (as Ian Jackson has done in his patch to import queue.h)

This doesn't allow the use of -w:
/usr/bin/env: perl -w: No such file or directory

It might be possible to achieve the same with $^W = 1?

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#25 lore raw

PATCH 1/1 docs: move user and interface .tex documents under reference

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]>
# Date 1321542088 0
# Node ID 7d77e0269af797cb8ab8e7d536412a222e7da3ef # Parent 8f2404eef8fac8020528b408b3a958d81cbb73c0
docs: move user and interface .tex documents under reference.

Taking over the top level "user" entry with a relatively obsolete document is a bit of an annoyance but these docs are not so out of date that they should be deleted. Move them out of the top-level instead.

(the original motivation here was to allow for user/xl-domain-cfg.markdown but we have since decided to go with man/xl.cfg.pod.5 instead so perhaps this is a waste of time)

docs/INDEX +2 -2
diff -r 8f2404eef8fa -r 7d77e0269af7 docs/INDEX
@@ -1,5 +1,5 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
 # These are not all that useful anymore, hide them from the index
-interface/index			NO-INDEX
-user/index			NO-INDEX
+reference/interface/index	NO-INDEX
+reference/user/index		NO-INDEX
docs/Makefile +4 -4
diff -r 8f2404eef8fa -r 7d77e0269af7 docs/Makefile
@@ -14,7 +14,7 @@ DOC_TEX		:= src/user.tex src/interface.t
 DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
-DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
+DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
 		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
@@ -119,14 +119,14 @@ ps/%.ps: %.dvi
 %.eps: %.fig
 	$(FIG2DEV) -L eps $< $@
 
-html/%/index.html: src/%.tex
+html/reference/%/index.html: src/%.tex
 	@$(INSTALL_DIR) $(@D)
 	@set -e ; if which $(LATEX2HTML) 1>/dev/null 2>/dev/null; then \
-        echo "Running latex2html to generate $*/index.html ... "; \
+        echo "Running latex2html to generate reference/$*/index.html ... "; \
 	$(LATEX2HTML) -split 0 -show_section_numbers -toc_depth 3 -nonavigation \
 	-numbered_footnotes -local_icons -noinfo -math -dir $(@D) \
 	$< 1>/dev/null 2>/dev/null ; else \
-	echo "latex2html not installed; skipping $*."; fi
+	echo "latex2html not installed; skipping reference/$*."; fi
 
 html/index.html: $(DOC_HTML) ./gen-html-index INDEX
 	./gen-html-index -i INDEX html $(DOC_HTML)
#26 lore raw

PATCH 1/1 libxlu: add xlu_cfg_get_list_as_string_list

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321542095 0
# Node ID 29d91e4d1f4f8d9233014b616547a9aed53b1515 # Parent 7d77e0269af797cb8ab8e7d536412a222e7da3ef
libxlu: add xlu_cfg_get_list_as_string_list

Returns a cfg list as a libxl_string_list.

Use this to simplify the parsing of device model extra args.

tools/libxl/libxlu_cfg.c +23 -0
diff -r 7d77e0269af7 -r 29d91e4d1f4f tools/libxl/libxlu_cfg.c
@@ -254,6 +254,29 @@ int xlu_cfg_get_list(const XLU_Config *c
     return 0;
 }
 
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                     libxl_string_list *psl, int dont_warn) {
+    int i, rc, nr;
+    XLU_ConfigList *list;
+    libxl_string_list sl;
+
+    rc = xlu_cfg_get_list(cfg, n, &list, &nr, dont_warn);
+    if (rc)  return rc;
+
+    sl = malloc(sizeof(char*)*(nr + 1));
+    if (sl == NULL) return ENOMEM;
+
+    for (i=0; i<nr; i++) {
+        const char *a = xlu_cfg_get_listitem(list, i);
+        sl[i] = a ? strdup(a) : NULL;
+    }
+
+    sl[nr] = NULL;
+
+    *psl = sl;
+    return 0;
+}
+
 const char *xlu_cfg_get_listitem(const XLU_ConfigList *set, int entry) {
     if (entry < 0 || entry >= set->nvalues) return 0;
     return set->values[entry];
tools/libxl/libxlutil.h +2 -0
diff -r 7d77e0269af7 -r 29d91e4d1f4f tools/libxl/libxlutil.h
@@ -58,6 +58,8 @@ int xlu_cfg_get_list(const XLU_Config*, 
                      int *entries_r /* may be 0 */,
                      int dont_warn);
   /* there is no need to free *list_r; lifetime is that of the XLU_Config */
+int xlu_cfg_get_list_as_string_list(const XLU_Config *cfg, const char *n,
+                                    libxl_string_list *sl, int dont_warn);
 const char *xlu_cfg_get_listitem(const XLU_ConfigList*, int entry);
   /* xlu_cfg_get_listitem cannot fail, except that if entry is
    * out of range it returns 0 (not setting errno) */
tools/libxl/xl_cmdimpl.c +8 -20
diff -r 7d77e0269af7 -r 29d91e4d1f4f tools/libxl/xl_cmdimpl.c
@@ -529,13 +529,6 @@ static void parse_config_data(const char
     int pci_msitranslate = 1;
     int e;
 
-    XLU_ConfigList *dmargs;
-    int nr_dmargs = 0;
-    XLU_ConfigList *dmargs_hvm;
-    int nr_dmargs_hvm = 0;
-    XLU_ConfigList *dmargs_pv;
-    int nr_dmargs_pv = 0;
-
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
 
@@ -1089,19 +1082,14 @@ skip_vfb:
     if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
         dm_info->device_model_stubdomain = l;
 
-#define parse_extra_args(type)                                          \
-    if (!xlu_cfg_get_list(config, "device_model_args"#type,             \
-                          &dmargs##type, &nr_dmargs##type, 0))          \
-    {                                                                   \
-        int i;                                                          \
-        dm_info->extra##type =                                          \
-            xmalloc(sizeof(char*)*(nr_dmargs##type + 1));               \
-        dm_info->extra##type[nr_dmargs##type] = NULL;                   \
-        for (i=0; i<nr_dmargs##type; i++) {                             \
-            const char *a = xlu_cfg_get_listitem(dmargs##type, i);      \
-            dm_info->extra##type[i] = a ? strdup(a) : NULL;             \
-        }                                                               \
-    }                                                                   \
+#define parse_extra_args(type)                                            \
+    e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
+                                    &dm_info->extra##type, 0);            \
+    if (e && e != ESRCH) {                                                \
+        fprintf(stderr,"xl: Unable to parse device_model_args"#type".\n");\
+        exit(-ERROR_FAIL);                                                \
+    }
+
     /* parse extra args for qemu, common to both pv, hvm */
     parse_extra_args();
#27 lore raw

PATCH 1/1 xl: make bootloader_args a list

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321542097 0
# Node ID bd514e08c509dd62a1db26318782ab37646788f5 # Parent 29d91e4d1f4f8d9233014b616547a9aed53b1515
xl: make bootloader_args a list

This is much more natural. Continue to support the old syntax in xl but deprecate it.

docs/man/xl.cfg.pod.5 +4 -3
diff -r 29d91e4d1f4f -r bd514e08c509 docs/man/xl.cfg.pod.5
@@ -321,10 +321,11 @@ Run C<PROGRAM> to find the kernel image 
 C<PROGRAM> would be C<pygrub>, which is an emulation of
 grub/grub2/syslinux.
 
-=item B<bootloader_args=STRING>
+=item B<bootloader_args=[ "ARG", "ARG", ...]>
 
-Append B<STRING> (split into words at whitespace) to the arguments to
-the B<bootloader> program.  XXX this should be a list of strings.
+Append B<ARGs to the arguments to the B<bootloader>
+program. Alternatively if the argument is a simple string then it will
+be split into words at whitespace (this second option is deprecated).
 
 =item B<root="STRING">
 
tools/libxl/libxl_bootloader.c +3 -7
diff -r 29d91e4d1f4f -r bd514e08c509 tools/libxl/libxl_bootloader.c
@@ -58,13 +58,9 @@ static char **make_bootloader_args(libxl
     flexarray_set(args, nr++, libxl__sprintf(gc, "--output-directory=%s", "/var/run/libxl/"));
 
     if (info->u.pv.bootloader_args) {
-        char *saveptr;
-        /* Operate on a duplicate since strtok modifes the argument */
-        char *dup = libxl__strdup(gc, info->u.pv.bootloader_args);
-        char *t = strtok_r(dup, " \t\n", &saveptr);
-        do {
-            flexarray_set(args, nr++, t);
-        } while ((t = strtok_r(NULL, " \t\n", &saveptr)));
+        char *p = info->u.pv.bootloader_args[0];
+        while (*(p++))
+            flexarray_set(args, nr++, p);
     }
 
     flexarray_set(args, nr++, disk);
tools/libxl/libxl_types.idl +1 -1
diff -r 29d91e4d1f4f -r bd514e08c509 tools/libxl/libxl_types.idl
@@ -185,7 +185,7 @@ libxl_domain_build_info = Struct("domain
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
                                       ("bootloader", string),
-                                      ("bootloader_args", string),
+                                      ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, True),
tools/libxl/xl_cmdimpl.c +72 -6

97 lines not on this page · raw message

#28 lore raw

PATCH 1/1 docs: install txt files as html

In reply to Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1321542098 0
# Node ID 83fc69637135353021aaacc96ded8fbbad1a4244 # Parent bd514e08c509dd62a1db26318782ab37646788f5
docs: install txt files as html

A browser will display them just fine.

NB: I'm not totally sure about this since many of the *.txt docs are out of date or deeply technical etc. It might be preferable to simply add the minimal necessary markdown to the ones we actually want to publish.

docs/INDEX +2 -0
diff -r bd514e08c509 -r 83fc69637135 docs/INDEX
@@ -1,5 +1,7 @@
 misc/hvm-emulated-unplug	Xen HVM emulated device unplug protocol
 
+misc/console.txt		Xen PV Console notes
+
 # These are not all that useful anymore, hide them from the index
 reference/interface/index	NO-INDEX
 reference/user/index		NO-INDEX
docs/Makefile +6 -1
diff -r bd514e08c509 -r 83fc69637135 docs/Makefile
@@ -17,7 +17,8 @@ DOC_PDF		:= $(patsubst src/%.tex,pdf/%.p
 DOC_HTML	:= $(patsubst src/%.tex,html/reference/%/index.html,$(DOC_TEX)) \
 		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,html/man/%.1.html,$(DOC_MAN1SRC)) \
-		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC))
+		   $(patsubst man/%.pod.5,html/man/%.5.html,$(DOC_MAN5SRC)) \
+		   $(patsubst %.txt,html/%.txt,$(wildcard misc/*.txt))
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN)) \
 		   $(patsubst man/%.pod.1,txt/man/%.1.txt,$(DOC_MAN1SRC)) \
@@ -138,6 +139,10 @@ html/%.html: %.markdown
 	$(MARKDOWN) $< > $@ ; else \
 	echo "markdown not installed; skipping $*.html."; fi
 
+html/%.txt: %.txt
+	@$(INSTALL_DIR) $(@D)
+	cp $< $@
+
 html/man/%.1.html: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
 	$(POD2HTML) --infile=$< --outfile=$@
#29 lore raw

Re: [PATCH 17 of 17] docs: install txt files as html

Ian Campbell writes ("[Xen-devel] [PATCH 17 of 17] docs: install txt files as html"):

Quoted 1 line

docs: install txt files as html

...

Quoted 3 lines

NB: I'm not totally sure about this since many of the *.txt docs are out of date or deeply technical etc. It might be preferable to simply add the minimal necessary markdown to the ones we actually want to publish.

I think putting them all there is a reasonable first step.

Ian.