Remove all trailing blanks; turn on the rule to detect them.

* Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blank: New file, to exempt the few binary files.
This commit is contained in:
Jim Meyering 2008-02-05 19:27:37 +00:00
parent 889eab9348
commit e04912a9f0
86 changed files with 565 additions and 557 deletions

3
.x-sc_trailing_blank Normal file
View File

@ -0,0 +1,3 @@
\.png$
\.fig$
\.gif$

View File

@ -1,3 +1,9 @@
Tue Feb 3 20:26:53 CET 2008 Jim Meyering <meyering@redhat.com>
Remove all trailing blanks; turn on the rule to detect them.
* Makefile.cfg (local-checks-to-skip): Remove sc_trailing_blank.
* .x-sc_trailing_blank: New file, to exempt the few binary files.
Tue Feb 3 11:21:45 EST 2008 Daniel P. Berrange <berrange@redhat.com> Tue Feb 3 11:21:45 EST 2008 Daniel P. Berrange <berrange@redhat.com>
* src/xml.c, src/xend_internal.c: Allow use of kernel+initrd * src/xml.c, src/xend_internal.c: Allow use of kernel+initrd

View File

@ -30,7 +30,6 @@ local-checks-to-skip = \
makefile-check \ makefile-check \
sc_no_have_config_h \ sc_no_have_config_h \
sc_tight_scope \ sc_tight_scope \
sc_trailing_blank \
sc_GPL_version \ sc_GPL_version \
sc_always_defined_macros \ sc_always_defined_macros \
sc_cast_of_alloca_return_value \ sc_cast_of_alloca_return_value \

66
NEWS
View File

@ -17,15 +17,15 @@ Releases
various english fixes (Bruce Montague), OCaml docs links (Richard Jones), various english fixes (Bruce Montague), OCaml docs links (Richard Jones),
describe the various bindings add Ruby link, Windows support page describe the various bindings add Ruby link, Windows support page
(Richard Jones), authentication documentation updates (Daniel Berrange) (Richard Jones), authentication documentation updates (Daniel Berrange)
- Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology - Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology
cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel
Berrange), XM processing of vnc parameters (Daniel Berrange), Reset Berrange), XM processing of vnc parameters (Daniel Berrange), Reset
migration source after failure (Jim Paris), negative integer in config migration source after failure (Jim Paris), negative integer in config
(Tatsuro Enokura), zero terminating string buffer, detect integer (Tatsuro Enokura), zero terminating string buffer, detect integer
overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange), overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange),
recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom
(Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon), (Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon),
avoid xend errors when adding disks (Masayuki Sunou), compile error avoid xend errors when adding disks (Masayuki Sunou), compile error
(Chris Lalancette), transposed fwrite args (Jim Meyering), compile (Chris Lalancette), transposed fwrite args (Jim Meyering), compile
without xen and on solaris (Jim Paris), parsing of interface names without xen and on solaris (Jim Paris), parsing of interface names
@ -42,17 +42,17 @@ Releases
parameter setting in XM config (Saori Fukuta), credential handling parameter setting in XM config (Saori Fukuta), credential handling
fixes (Daniel Berrange), fix compatibility with Xen 3.2.0 (Daniel fixes (Daniel Berrange), fix compatibility with Xen 3.2.0 (Daniel
Berrange) Berrange)
- Improvements: /etc/libvirt/qemu.conf configuration for QEMU driver - Improvements: /etc/libvirt/qemu.conf configuration for QEMU driver
(Daniel Berrange), NUMA cpu pinning in config files (DV and Saori Fukuta), (Daniel Berrange), NUMA cpu pinning in config files (DV and Saori Fukuta),
CDRom media change in KVM/QEMU (Daniel Berrange), tests for CDRom media change in KVM/QEMU (Daniel Berrange), tests for
<shareable/> in configs, pinning inactive domains for Xen 3.0.3 <shareable/> in configs, pinning inactive domains for Xen 3.0.3
(Saori Fukuta), use gnulib for portability enhancement (Jim Meyering), (Saori Fukuta), use gnulib for portability enhancement (Jim Meyering),
--without-libvirtd config option (Richard Jones), Python bindings for --without-libvirtd config option (Richard Jones), Python bindings for
NUMA, add extra utility functions to buffer (Richard Jones), NUMA, add extra utility functions to buffer (Richard Jones),
separate qparams module for handling query parameters (Richard Jones) separate qparams module for handling query parameters (Richard Jones)
- Code cleanups: remove virDomainRestart from API as it was never used - Code cleanups: remove virDomainRestart from API as it was never used
(Richard Jones), constify params for attach/detach APIs (Daniel Berrange), (Richard Jones), constify params for attach/detach APIs (Daniel Berrange),
gcc printf attribute checkings (Jim Meyering), refactoring of device gcc printf attribute checkings (Jim Meyering), refactoring of device
parsing code and shell escaping (Daniel Berrange), virsh schedinfo parsing code and shell escaping (Daniel Berrange), virsh schedinfo
@ -72,20 +72,20 @@ Releases
port (Richard Jones), disable the proxy if using PolicyKit, readline port (Richard Jones), disable the proxy if using PolicyKit, readline
availability detection, test libvirtd's config-processing code (Jim availability detection, test libvirtd's config-processing code (Jim
Meyering), use a variable name as sizeof argument (Jim Meyering) Meyering), use a variable name as sizeof argument (Jim Meyering)
0.3.3: Sep 30 2007: 0.3.3: Sep 30 2007:
- New features: Avahi mDNS daemon export (Daniel Berrange), - New features: Avahi mDNS daemon export (Daniel Berrange),
NUMA support (Beth Kan) NUMA support (Beth Kan)
- Documentation: cleanups (Toth Istvan), typos (Eduardo Pereira), - Documentation: cleanups (Toth Istvan), typos (Eduardo Pereira),
- Bug fixes: memory corruption on large dumps (Masayuki Sunou), fix - Bug fixes: memory corruption on large dumps (Masayuki Sunou), fix
virsh vncdisplay command exit (Masayuki Sunou), Fix network stats virsh vncdisplay command exit (Masayuki Sunou), Fix network stats
TX/RX result (Richard Jones), warning on Xen 3.0.3 (Richard Jones), TX/RX result (Richard Jones), warning on Xen 3.0.3 (Richard Jones),
missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies
when using remote (Daniel Berrange), xend connection error message when using remote (Daniel Berrange), xend connection error message
(Richard Jones), avoid ssh tty prompt (Daniel Berrange), username (Richard Jones), avoid ssh tty prompt (Daniel Berrange), username
handling for remote URIs (Fabian Deutsch), fix potential crash handling for remote URIs (Fabian Deutsch), fix potential crash
on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls
fixup (Mark Johnson) fixup (Mark Johnson)
- Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac), - Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac),
@ -103,7 +103,7 @@ Releases
0.3.2: Aug 21 2007: 0.3.2: Aug 21 2007:
- New features: KVM migration and save/restore (Jim Paris), - New features: KVM migration and save/restore (Jim Paris),
added API for migration (Richard Jones), added APIs for block device and added API for migration (Richard Jones), added APIs for block device and
interface statistic (Richard Jones). interface statistic (Richard Jones).
- Documentation: examples for XML network APIs, - Documentation: examples for XML network APIs,
@ -124,10 +124,10 @@ Releases
speedup of domain queries on Xen (Daniel berrange), augment XML dumps speedup of domain queries on Xen (Daniel berrange), augment XML dumps
with interface devices names (Richard Jones), internal API to query with interface devices names (Richard Jones), internal API to query
drivers for features (Richard Jones). drivers for features (Richard Jones).
- Cleanups: Improve virNodeGetInfo implentation (Daniel berrange), - Cleanups: Improve virNodeGetInfo implentation (Daniel berrange),
general UUID code cleanup (Daniel berrange), fix API generator general UUID code cleanup (Daniel berrange), fix API generator
file selection. file selection.
0.3.1: Jul 24 2007: 0.3.1: Jul 24 2007:
@ -161,13 +161,13 @@ Releases
- Secure Remote support (Richard Jones). - Secure Remote support (Richard Jones).
See the remote page See the remote page
of the documentation of the documentation
- Documentation: remote support (Richard Jones), description of - Documentation: remote support (Richard Jones), description of
the URI connection strings (Richard Jones), update of virsh man the URI connection strings (Richard Jones), update of virsh man
page, matrix of libvirt API/hypervisor support with version page, matrix of libvirt API/hypervisor support with version
informations (Richard Jones) informations (Richard Jones)
- Bug fixes: examples Makefile.am generation (Richard Jones), - Bug fixes: examples Makefile.am generation (Richard Jones),
SetMem fix (Mark Johnson), URI handling and ordering of SetMem fix (Mark Johnson), URI handling and ordering of
drivers (Daniel Berrange), fix virsh help without hypervisor (Richard drivers (Daniel Berrange), fix virsh help without hypervisor (Richard
Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus
on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler
@ -177,12 +177,12 @@ Releases
XML serialization bugs XML serialization bugs
- Improvements: QEmu switch to XDR-based protocol (Dan Berrange), - Improvements: QEmu switch to XDR-based protocol (Dan Berrange),
device attach/detach commands (Masayuki Sunou), OCaml bindings device attach/detach commands (Masayuki Sunou), OCaml bindings
(Richard Jones), new entry points virDomainGetConnect and (Richard Jones), new entry points virDomainGetConnect and
virNetworkGetConnect useful for bindings (Richard Jones), virNetworkGetConnect useful for bindings (Richard Jones),
reunitifaction of remote and qemu daemon under a single libvirtd reunitifaction of remote and qemu daemon under a single libvirtd
with a config file (Daniel Berrange) with a config file (Daniel Berrange)
- Cleanups: parsing of connection URIs (Richard Jones), messages - Cleanups: parsing of connection URIs (Richard Jones), messages
from virsh (Saori Fukuta), Coverage files (Daniel Berrange), from virsh (Saori Fukuta), Coverage files (Daniel Berrange),
Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones), Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones),
release information in Xen backend, virsh cpupin command cleanups release information in Xen backend, virsh cpupin command cleanups
(Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and (Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and
@ -202,7 +202,7 @@ Releases
0.2.3: Jun 8 2007: 0.2.3: Jun 8 2007:
- Documentation: documentation for upcoming remote access (Richard Jones), - Documentation: documentation for upcoming remote access (Richard Jones),
virConnectNumOfDefinedDomains doc (Jan Michael), virsh help messages virConnectNumOfDefinedDomains doc (Jan Michael), virsh help messages
for dumpxml and net-dumpxml (Chris Wright), for dumpxml and net-dumpxml (Chris Wright),
- Bug fixes: RelaxNG schemas regexp fix (Robin Green), RelaxNG arch bug - Bug fixes: RelaxNG schemas regexp fix (Robin Green), RelaxNG arch bug
(Mark McLoughlin), large buffers bug fixes (Shigeki Sakamoto), error (Mark McLoughlin), large buffers bug fixes (Shigeki Sakamoto), error
on out of memory condition (Shigeki Sakamoto), virshStrdup fix, non-root on out of memory condition (Shigeki Sakamoto), virshStrdup fix, non-root
@ -214,7 +214,7 @@ Releases
QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou), QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou),
fix compiler flags (Richard Jones), remove type ioemu on recent Xen fix compiler flags (Richard Jones), remove type ioemu on recent Xen
HVM for paravirt drivers (Saori Fukuta), uninitialized string bug HVM for paravirt drivers (Saori Fukuta), uninitialized string bug
(Masayuki Sunou), allow init even if the daemon is not running, (Masayuki Sunou), allow init even if the daemon is not running,
XML to config fix (Daniel Berrange) XML to config fix (Daniel Berrange)
- Improvements: add a special error class for the test module (Richard - Improvements: add a special error class for the test module (Richard
Jones), virConnectGetCapabilities on proxy (Richard Jones), allow Jones), virConnectGetCapabilities on proxy (Richard Jones), allow
@ -236,10 +236,10 @@ Releases
0.2.2: Apr 17 2007: 0.2.2: Apr 17 2007:
- Documentation: fix errors due to Amaya (with Simon Hernandez), - Documentation: fix errors due to Amaya (with Simon Hernandez),
virsh uses kB not bytes (Atsushi SAKAI), add command line help to virsh uses kB not bytes (Atsushi SAKAI), add command line help to
qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI), qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI),
strings typos (Nikolay Sivov), ilocalization probalem raised by strings typos (Nikolay Sivov), ilocalization probalem raised by
Thomas Canniot Thomas Canniot
- Bug fixes: virsh memory values test (Masayuki Sunou), operations without - Bug fixes: virsh memory values test (Masayuki Sunou), operations without
libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy
@ -251,26 +251,26 @@ Releases
Berrange), bridged config configuration (Daniel Berrange), erroneous Berrange), bridged config configuration (Daniel Berrange), erroneous
XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark
McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto), McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto),
avoid memory explosion bug (Daniel Berrange), integer overflow avoid memory explosion bug (Daniel Berrange), integer overflow
for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel
Berrange) Berrange)
- Cleanups: remove some global variables (Jim Meyering), printf-style - Cleanups: remove some global variables (Jim Meyering), printf-style
functions checks (Jim Meyering), better virsh error messages, increase functions checks (Jim Meyering), better virsh error messages, increase
compiler checkings and security (Daniel Berrange), virBufferGrow usage compiler checkings and security (Daniel Berrange), virBufferGrow usage
and docs, use calloc instead of malloc/memset, replace all sprintf by and docs, use calloc instead of malloc/memset, replace all sprintf by
snprintf, avoid configure clobbering user's CTAGS (Jim Meyering), snprintf, avoid configure clobbering user's CTAGS (Jim Meyering),
signal handler error cleanup (Richard Jones), iptables internal code signal handler error cleanup (Richard Jones), iptables internal code
claenup (Mark McLoughlin), unified Xen driver (Richard Jones), claenup (Mark McLoughlin), unified Xen driver (Richard Jones),
cleanup XPath libxml2 calls, IPTables rules tightening (Daniel cleanup XPath libxml2 calls, IPTables rules tightening (Daniel
Berrange), Berrange),
- Improvements: more regression tests on XML (Daniel Berrange), Python - Improvements: more regression tests on XML (Daniel Berrange), Python
bindings now generate exception in error cases (Richard Jones), bindings now generate exception in error cases (Richard Jones),
Python bindings for vir*GetAutoStart (Daniel Berrange), Python bindings for vir*GetAutoStart (Daniel Berrange),
handling of CD-Rom device without device name (Nobuhiro Itou), handling of CD-Rom device without device name (Nobuhiro Itou),
fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange), fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange),
DomainGetOSType for inactive domains (Daniel Berrange), multiple boot DomainGetOSType for inactive domains (Daniel Berrange), multiple boot
devices for HVM (Daniel Berrange), devices for HVM (Daniel Berrange),
0.2.1: Mar 16 2007: 0.2.1: Mar 16 2007:
@ -293,7 +293,7 @@ Releases
Berrange), pointer/int mismatch (Richard Jones), configure time Berrange), pointer/int mismatch (Richard Jones), configure time
selection of drivers, libvirt spec hacking (Daniel Berrange) selection of drivers, libvirt spec hacking (Daniel Berrange)
- Add support for network autostart and init scripts (Mark McLoughlin) - Add support for network autostart and init scripts (Mark McLoughlin)
- New API virConnectGetCapabilities() to detect the virtualization - New API virConnectGetCapabilities() to detect the virtualization
capabilities of a host (Richard Jones) capabilities of a host (Richard Jones)
- Minor improvements: qemud signal handling (Mark), don't shutdown or reboot - Minor improvements: qemud signal handling (Mark), don't shutdown or reboot
domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange), domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange),
@ -312,7 +312,7 @@ Releases
parsing (Richard Jones) parsing (Richard Jones)
- Add support for QEmu and KVM virtualization (Daniel Berrange) - Add support for QEmu and KVM virtualization (Daniel Berrange)
- Add support for network configuration (Mark McLoughlin) - Add support for network configuration (Mark McLoughlin)
- Minor improvements: regression testing (Daniel Berrange), - Minor improvements: regression testing (Daniel Berrange),
localization string updates localization string updates
@ -375,7 +375,7 @@ Releases
- Support for localization of strings using gettext (Daniel Berrange) - Support for localization of strings using gettext (Daniel Berrange)
- Support for new Xen-3.0.3 cdrom and disk configuration (Daniel Berrange) - Support for new Xen-3.0.3 cdrom and disk configuration (Daniel Berrange)
- Support for setting VNC port when creating domains with new - Support for setting VNC port when creating domains with new
xend config files (Daniel Berrange) xend config files (Daniel Berrange)
- Fix bug when running against xen-3.0.2 hypercalls (Jim Fehlig) - Fix bug when running against xen-3.0.2 hypercalls (Jim Fehlig)
- Fix reconnection problem when talking directly to http xend - Fix reconnection problem when talking directly to http xend
@ -409,7 +409,7 @@ Releases
floppy and cdrom (Daniel Berrange), features block in XML to report/ask floppy and cdrom (Daniel Berrange), features block in XML to report/ask
PAE, ACPI, APIC for HVM domains (Daniel Berrange), fail saide-effect PAE, ACPI, APIC for HVM domains (Daniel Berrange), fail saide-effect
operations when using read-only connection, large improvements to test operations when using read-only connection, large improvements to test
driver (Daniel Berrange) driver (Daniel Berrange)
- documentation: spelling (Daniel Berrange), test driver examples. - documentation: spelling (Daniel Berrange), test driver examples.

4
TODO
View File

@ -6,7 +6,7 @@ TODO:
Other environment: Other environment:
- support for UML - support for UML
+ UML control layer should be easy at least for one user but incomplete + UML control layer should be easy at least for one user but incomplete
Probable TODOs: Probable TODOs:
@ -20,7 +20,7 @@ Would-be-nice TODO:
Cleanup: Cleanup:
- now that libxml2 is linked in, drop hash.[ch] and get back to libxml2 ones ? - now that libxml2 is linked in, drop hash.[ch] and get back to libxml2 ones ?
same for the buffers same for the buffers
Autoconf: Autoconf:
- On Debian and other platforms, C++ compiler is required because - On Debian and other platforms, C++ compiler is required because

View File

@ -16,7 +16,7 @@ rm -rf coverage
./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT \ ./autogen.sh --prefix=$AUTOBUILD_INSTALL_ROOT \
--enable-test-coverage \ --enable-test-coverage \
--enable-compile-warnings=error --enable-compile-warnings=error
make make
make install make install

View File

@ -2,7 +2,7 @@
# Run this to generate all the initial makefiles, etc. # Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0` srcdir=`dirname $0`
test -z "$srcdir" && srcdir=. test -z "$srcdir" && srcdir=.
THEDIR=`pwd` THEDIR=`pwd`
cd $srcdir cd $srcdir
@ -70,6 +70,6 @@ if test x$OBJ_DIR != x; then
fi fi
$srcdir/configure "$@" && { $srcdir/configure "$@" && {
echo echo
echo "Now type 'make' to compile libvirt." echo "Now type 'make' to compile libvirt."
} }

View File

@ -7,7 +7,7 @@ function translate(str) {
sub(/[0-9][0-9][0-9][0-9][0-9]+/, "<bug number='&'/>", str) sub(/[0-9][0-9][0-9][0-9][0-9]+/, "<bug number='&'/>", str)
return(str) return(str)
} }
BEGIN { BEGIN {
nb_entry = 0 nb_entry = 0
in_entry = 0 in_entry = 0
in_item = 0 in_item = 0
@ -20,7 +20,7 @@ END {
print "</log>" print "</log>"
} }
/^[ \t]*$/ { next } /^[ \t]*$/ { next }
/^[A-Za-z0-9]/ { /^[A-Za-z0-9]/ {
match($0, "\(.*\) \([A-Z]+\) \([0-9][0-9][0-9][0-9]\) \(.*\) <\(.*\)>", loge) match($0, "\(.*\) \([A-Z]+\) \([0-9][0-9][0-9][0-9]\) \(.*\) <\(.*\)>", loge)
if (in_item == 1) printf("%s</item>\n", translate(item)) if (in_item == 1) printf("%s</item>\n", translate(item))
if (in_entry == 1) print " </entry>" if (in_entry == 1) print " </entry>"
@ -41,7 +41,7 @@ END {
match($0, "[ \t]*. *\(.*\)", loge) match($0, "[ \t]*. *\(.*\)", loge)
item = loge[1] item = loge[1]
} }
/^[ \t]*[a-zA-Z0-9\#]/ { /^[ \t]*[a-zA-Z0-9\#]/ {
if (in_item == 1) { if (in_item == 1) {
match($0, "[ \t]*\(.*\)[ \t]*", loge) match($0, "[ \t]*\(.*\)[ \t]*", loge)
item = sprintf("%s %s", item, loge[1]) item = sprintf("%s %s", item, loge[1])

View File

@ -24,7 +24,7 @@
<ul><!-- style="margin-left: -1em" --> <ul><!-- style="margin-left: -1em" -->
<li><a style="font-weight:bold" <li><a style="font-weight:bold"
href="{$href_base}index.html">Main Menu</a></li> href="{$href_base}index.html">Main Menu</a></li>
<li><a style="font-weight:bold" <li><a style="font-weight:bold"
href="{$href_base}html/index.html">Modules Index</a></li> href="{$href_base}html/index.html">Modules Index</a></li>
<li><a style="font-weight:bold" <li><a style="font-weight:bold"
href="index.html">API Menu</a></li> href="index.html">API Menu</a></li>
@ -35,13 +35,13 @@
<a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id={@number}"> <a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id={@number}">
<xsl:value-of select="@number"/></a> <xsl:value-of select="@number"/></a>
</xsl:template> </xsl:template>
<xsl:template match="item"> <xsl:template match="item">
<li><xsl:apply-templates/></li> <li><xsl:apply-templates/></li>
</xsl:template> </xsl:template>
<xsl:template match="entry"> <xsl:template match="entry">
<p> <p>
<b><xsl:value-of select="@who"/></b> <b><xsl:value-of select="@who"/></b>
<xsl:text> </xsl:text> <xsl:text> </xsl:text>

View File

@ -108,7 +108,7 @@ maintainer-clean-local: clean-local
rebuild: api all rebuild: api all
install-data-local: install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR) $(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/libvir.html $(srcdir)/FAQ.html \ -@INSTALL@ -m 0644 $(srcdir)/libvir.html $(srcdir)/FAQ.html \
$(srcdir)/redhat.gif $(srcdir)/Libxml2-Logo-90x34.gif \ $(srcdir)/redhat.gif $(srcdir)/Libxml2-Logo-90x34.gif \

View File

@ -311,7 +311,7 @@ class index:
self.analyze_dict("structs", self.structs) self.analyze_dict("structs", self.structs)
self.analyze_dict("typedefs", self.typedefs) self.analyze_dict("typedefs", self.typedefs)
self.analyze_dict("macros", self.macros) self.analyze_dict("macros", self.macros)
class CLexer: class CLexer:
"""A lexer for the C language, tokenize the input by reading and """A lexer for the C language, tokenize the input by reading and
analyzing it line by line""" analyzing it line by line"""
@ -343,7 +343,7 @@ class CLexer:
else: else:
line = line + n line = line + n
return line return line
def getlineno(self): def getlineno(self):
return self.lineno return self.lineno
@ -512,12 +512,12 @@ class CLexer:
else: else:
break break
self.tokens.append(('name', line[s:i])) self.tokens.append(('name', line[s:i]))
tok = self.tokens[0] tok = self.tokens[0]
self.tokens = self.tokens[1:] self.tokens = self.tokens[1:]
self.last = tok self.last = tok
return tok return tok
class CParser: class CParser:
"""The C module parser""" """The C module parser"""
def __init__(self, filename, idx = None): def __init__(self, filename, idx = None):
@ -672,7 +672,7 @@ class CParser:
l = string.strip(l) l = string.strip(l)
desc = desc + " " + l desc = desc + " " + l
del lines[0] del lines[0]
desc = string.strip(desc) desc = string.strip(desc)
if quiet == 0: if quiet == 0:
@ -742,7 +742,7 @@ class CParser:
l = string.strip(l) l = string.strip(l)
desc = desc + " " + l desc = desc + " " + l
del lines[0] del lines[0]
desc = string.strip(desc) desc = string.strip(desc)
if quiet == 0: if quiet == 0:
@ -843,7 +843,7 @@ class CParser:
else: else:
desc = desc + " " + l desc = desc + " " + l
del lines[0] del lines[0]
retdesc = string.strip(retdesc) retdesc = string.strip(retdesc)
desc = string.strip(desc) desc = string.strip(desc)
@ -921,7 +921,7 @@ class CParser:
try: try:
self.defines.append(apstr) self.defines.append(apstr)
if string.find(apstr, 'ENABLED') != -1: if string.find(apstr, 'ENABLED') != -1:
self.conditionals.append("defined(%s)" % apstr) self.conditionals.append("defined(%s)" % apstr)
except: except:
pass pass
elif name == "#ifndef": elif name == "#ifndef":
@ -929,7 +929,7 @@ class CParser:
try: try:
self.defines.append(apstr) self.defines.append(apstr)
if string.find(apstr, 'ENABLED') != -1: if string.find(apstr, 'ENABLED') != -1:
self.conditionals.append("!defined(%s)" % apstr) self.conditionals.append("!defined(%s)" % apstr)
except: except:
pass pass
elif name == "#if": elif name == "#if":
@ -1054,7 +1054,7 @@ class CParser:
return token return token
token = self.token() token = self.token()
return token return token
# #
# Parse a C code block, used for functions it parse till # Parse a C code block, used for functions it parse till
# the balancing } included # the balancing } included
@ -1089,7 +1089,7 @@ class CParser:
elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXEN_": elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXEN_":
self.index_add_ref(oldtok[1], self.filename, self.index_add_ref(oldtok[1], self.filename,
0, "typedef") 0, "typedef")
else: else:
token = self.token() token = self.token()
return token return token
@ -1222,7 +1222,7 @@ class CParser:
if token == None: if token == None:
return token return token
while token[0] == "name" and ( while token[0] == "name" and (
token[1] == "const" or \ token[1] == "const" or \
token[1] == "unsigned" or \ token[1] == "unsigned" or \
token[1] == "signed"): token[1] == "signed"):
@ -1238,7 +1238,7 @@ class CParser:
else: else:
self.type = self.type + " " + token[1] self.type = self.type + " " + token[1]
# some read ahead for long long # some read ahead for long long
oldtmp = token oldtmp = token
token = self.token() token = self.token()
if token[0] == "name" and token[1] == "long": if token[0] == "name" and token[1] == "long":
@ -1263,7 +1263,7 @@ class CParser:
self.type = tmp[1] self.type = tmp[1]
else: else:
self.type = self.type + " " + tmp[1] self.type = self.type + " " + tmp[1]
elif token[0] == "name" and token[1] == "struct": elif token[0] == "name" and token[1] == "struct":
if self.type == "": if self.type == "":
self.type = token[1] self.type = token[1]
@ -1553,7 +1553,7 @@ class CParser:
token = self.token() token = self.token()
else: else:
break break
return token return token
def parse(self): def parse(self):
@ -1569,7 +1569,7 @@ class CParser:
return return
self.parseTopComment(self.top_comment) self.parseTopComment(self.top_comment)
return self.index return self.index
class docBuilder: class docBuilder:
"""A documentation builder""" """A documentation builder"""
@ -1663,7 +1663,7 @@ class docBuilder:
self.headers[file] = None; self.headers[file] = None;
self.scanHeaders() self.scanHeaders()
self.scanModules() self.scanModules()
def modulename_file(self, file): def modulename_file(self, file):
module = os.path.basename(file) module = os.path.basename(file)
if module[-2:] == '.h': if module[-2:] == '.h':
@ -1757,7 +1757,7 @@ class docBuilder:
else: else:
output.write(" <variable name='%s' file='%s'/>\n" % ( output.write(" <variable name='%s' file='%s'/>\n" % (
name, self.modulename_file(id.header))) name, self.modulename_file(id.header)))
def serialize_function(self, output, name): def serialize_function(self, output, name):
id = self.idx.functions[name] id = self.idx.functions[name]
if name == debugsym: if name == debugsym:

View File

@ -19,7 +19,7 @@ libvirt.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/docs/libvirt-a
-@(if [ -x $(XSLTPROC) ] ; then \ -@(if [ -x $(XSLTPROC) ] ; then \
$(XSLTPROC) --nonet -o $(srcdir)/libvirt.devhelp devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi ); $(XSLTPROC) --nonet -o $(srcdir)/libvirt.devhelp devhelp.xsl $(top_srcdir)/docs/libvirt-api.xml ; fi );
install-data-local: install-data-local:
$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR) $(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
-@INSTALL@ -m 0644 libvirt.devhelp $(DESTDIR)$(DEVHELP_DIR) -@INSTALL@ -m 0644 libvirt.devhelp $(DESTDIR)$(DEVHELP_DIR)
-@INSTALL@ -m 0644 $(EXTRA_FORMAT) $(DESTDIR)$(DEVHELP_DIR) -@INSTALL@ -m 0644 $(EXTRA_FORMAT) $(DESTDIR)$(DEVHELP_DIR)

View File

@ -1,16 +1,16 @@
.synopsis, .classsynopsis .synopsis, .classsynopsis
{ {
background: #eeeeee; background: #eeeeee;
border: solid 1px #aaaaaa; border: solid 1px #aaaaaa;
padding: 0.5em; padding: 0.5em;
} }
.programlisting .programlisting
{ {
background: #eeeeff; background: #eeeeff;
border: solid 1px #aaaaff; border: solid 1px #aaaaff;
padding: 0.5em; padding: 0.5em;
} }
.variablelist .variablelist
{ {
padding: 4px; padding: 4px;
margin-left: 3em; margin-left: 3em;
@ -19,39 +19,39 @@
{ {
vertical-align: top; vertical-align: top;
} }
table.navigation table.navigation
{ {
background: #ffeeee; background: #ffeeee;
border: solid 1px #ffaaaa; border: solid 1px #ffaaaa;
margin-top: 0.5em; margin-top: 0.5em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.navigation a .navigation a
{ {
color: #770000; color: #770000;
} }
.navigation a:visited .navigation a:visited
{ {
color: #550000; color: #550000;
} }
.navigation .title .navigation .title
{ {
font-size: 200%; font-size: 200%;
} }
div.refnamediv div.refnamediv
{ {
margin-top: 2em; margin-top: 2em;
} }
div.gallery-float div.gallery-float
{ {
float: left; float: left;
padding: 10px; padding: 10px;
} }
div.gallery-float img div.gallery-float img
{ {
border-style: none; border-style: none;
} }
div.gallery-spacer div.gallery-spacer
{ {
clear: both; clear: both;
} }

View File

@ -22,9 +22,9 @@ install-data-local:
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \ -@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml \
$(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
EXTRA_DIST=examples.xsl index.py examples.xml EXTRA_DIST=examples.xsl index.py examples.xml
noinst_PROGRAMS=info1 suspend noinst_PROGRAMS=info1 suspend
info1_SOURCES=info1.c info1_SOURCES=info1.c
info1_LDFLAGS= info1_LDFLAGS=
@ -36,7 +36,7 @@ suspend_LDFLAGS=
suspend_DEPENDENCIES= $(DEPS) suspend_DEPENDENCIES= $(DEPS)
suspend_LDADD= $(LDADDS) suspend_LDADD= $(LDADDS)
valgrind: valgrind:
$(MAKE) CHECKER='valgrind' tests $(MAKE) CHECKER='valgrind' tests
tests: $(noinst_PROGRAMS) tests: $(noinst_PROGRAMS)

View File

@ -18,9 +18,9 @@
</form> </form>
<ul><!-- style="margin-left: -1em" --> <ul><!-- style="margin-left: -1em" -->
<li><a href="{$href_base}index.html">Home</a></li> <li><a href="{$href_base}index.html">Home</a></li>
<li><a style="font-weight:bold" <li><a style="font-weight:bold"
href="{$href_base}docs.html">Developer Menu</a></li> href="{$href_base}docs.html">Developer Menu</a></li>
<li><a style="font-weight:bold" <li><a style="font-weight:bold"
href="{$href_base}html/index.html">API Menu</a></li> href="{$href_base}html/index.html">API Menu</a></li>
<xsl:for-each select="/examples/sections/section"> <xsl:for-each select="/examples/sections/section">
<li><a href="#{@name}"><xsl:value-of select="@name"/> Examples</a></li> <li><a href="#{@name}"><xsl:value-of select="@name"/> Examples</a></li>

View File

@ -4,8 +4,8 @@ The examples are:
dominfo.py - print information about a running domU based on the results of dominfo.py - print information about a running domU based on the results of
virDomainGetInfo and virDomainGetXMLDesc virDomainGetInfo and virDomainGetXMLDesc
domstart.py - create a domU from an XML description if the domU isn't domstart.py - create a domU from an XML description if the domU isn't
running yet running yet
domsave.py - save all running domU's into a directory domsave.py - save all running domU's into a directory
domrestore.py - restore domU's from their saved files in a directory domrestore.py - restore domU's from their saved files in a directory

View File

@ -26,7 +26,7 @@ def print_xml(key, ctx, path):
value = res[0].content value = res[0].content
print_entry(key, value) print_entry(key, value)
return value return value
if not os.access("/proc/xen", os.R_OK): if not os.access("/proc/xen", os.R_OK):
print 'System is not running a Xen kernel' print 'System is not running a Xen kernel'
sys.exit(1) sys.exit(1)

View File

@ -36,5 +36,5 @@ for id in doms:
print "done" print "done"
else: else:
print "error %d" % ret print "error %d" % ret
#pdb.set_trace() #pdb.set_trace()

View File

@ -18,7 +18,7 @@ def read_domain(fname):
doc = libxml2.parseDoc(xmldesc) doc = libxml2.parseDoc(xmldesc)
name = doc.xpathNewContext().xpathEval("/domain/name")[0].content name = doc.xpathNewContext().xpathEval("/domain/name")[0].content
return (name, xmldesc) return (name, xmldesc)
def usage(): def usage():
print 'Usage: %s domain.xml' % sys.argv[0] print 'Usage: %s domain.xml' % sys.argv[0]
print ' Check that the domain described by DOMAIN.XML is running' print ' Check that the domain described by DOMAIN.XML is running'

View File

@ -27,7 +27,7 @@ static int
checkDomainState(virDomainPtr dom) { checkDomainState(virDomainPtr dom) {
virDomainInfo info; /* the informations being fetched */ virDomainInfo info; /* the informations being fetched */
int ret; int ret;
ret = virDomainGetInfo(dom, &info); ret = virDomainGetInfo(dom, &info);
if (ret < 0) { if (ret < 0) {
return(-1); return(-1);
@ -124,7 +124,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Failed find a running guest domain\n"); fprintf(stderr, "Failed find a running guest domain\n");
goto error; goto error;
} }
SuspendAndResumeDomain(id); SuspendAndResumeDomain(id);
error: error:

View File

@ -231,8 +231,8 @@ support a variety of options:</p><ol><li>Userspace SLIRP stack
VMs to have outgoing access. Example configs are:</p> VMs to have outgoing access. Example configs are:</p>
<pre>&lt;interface type='user'/&gt;</pre> <pre>&lt;interface type='user'/&gt;</pre>
<pre> <pre>
&lt;interface type='user'&gt; &lt;interface type='user'&gt;
&lt;mac address="11:22:33:44:55:66"/&gt; &lt;mac address="11:22:33:44:55:66"/&gt;
&lt;/interface&gt; &lt;/interface&gt;
</pre> </pre>
</li> </li>
@ -276,7 +276,7 @@ support a variety of options:</p><ol><li>Userspace SLIRP stack
&lt;source dev='br0'/&gt; &lt;source dev='br0'/&gt;
&lt;target dev='vnet7'/&gt; &lt;target dev='vnet7'/&gt;
&lt;mac address="11:22:33:44:55:66"/&gt; &lt;mac address="11:22:33:44:55:66"/&gt;
&lt;/interface&gt;</pre> &lt;/interface&gt;</pre>
</li> </li>
<li>Generic connection to LAN <li>Generic connection to LAN
<p>Provides a means for the administrator to execute an arbitrary script <p>Provides a means for the administrator to execute an arbitrary script

View File

@ -181,7 +181,7 @@ The content of this structure is not made public by the API.
unsigned long long cpuTime : the CPU time used in nanoseconds unsigned long long cpuTime : the CPU time used in nanoseconds
}</pre> }</pre>
a virDomainInfoPtr is a pointer to a virDomainInfo structure. a virDomainInfoPtr is a pointer to a virDomainInfo structure.
A pointe to a virDomainInterfaceStats structure A pointe to a virDomainInterfaceStats structure
<h3><a name="virDomainInterfaceStatsStruct" id="virDomainInterfaceStatsStruct">Structure virDomainInterfaceStatsStruct</a></h3><pre class="programlisting">Structure virDomainInterfaceStatsStruct<br />struct _virDomainInterfaceStats { <h3><a name="virDomainInterfaceStatsStruct" id="virDomainInterfaceStatsStruct">Structure virDomainInterfaceStatsStruct</a></h3><pre class="programlisting">Structure virDomainInterfaceStatsStruct<br />struct _virDomainInterfaceStats {
long long rx_bytes long long rx_bytes

View File

@ -34,7 +34,7 @@
# Bye # Bye
# #
# Then run the script in the doc subdir, it will create the symbols and # Then run the script in the doc subdir, it will create the symbols and
# word tables and populate them with informations extracted from # word tables and populate them with informations extracted from
# the libvirt-api.xml API description, and make then accessible read-only # the libvirt-api.xml API description, and make then accessible read-only
# by nobody@loaclhost the user expected to be Apache's one # by nobody@loaclhost the user expected to be Apache's one
# #
@ -187,7 +187,7 @@ def checkTables(db, verbose = 1):
except: except:
pass pass
return 0 return 0
def openMySQL(db="libvir", passwd=None, verbose = 1): def openMySQL(db="libvir", passwd=None, verbose = 1):
global DB global DB
@ -231,7 +231,7 @@ def updateWord(name, symbol, relevance):
print "UPDATE words SET relevance = %d where name = '%s' and symbol = '%s'" % (relevance, name, symbol) print "UPDATE words SET relevance = %d where name = '%s' and symbol = '%s'" % (relevance, name, symbol)
print sys.exc_type, sys.exc_value print sys.exc_type, sys.exc_value
return -1 return -1
return ret return ret
def updateSymbol(name, module, type, desc): def updateSymbol(name, module, type, desc):
@ -272,9 +272,9 @@ def updateSymbol(name, module, type, desc):
print """UPDATE symbols SET module='%s', type='%s', descr='%s' where name='%s'""" % (module, type, desc, name) print """UPDATE symbols SET module='%s', type='%s', descr='%s' where name='%s'""" % (module, type, desc, name)
print sys.exc_type, sys.exc_value print sys.exc_type, sys.exc_value
return -1 return -1
return ret return ret
def addFunction(name, module, desc = ""): def addFunction(name, module, desc = ""):
return updateSymbol(name, module, 'function', desc) return updateSymbol(name, module, 'function', desc)
@ -321,7 +321,7 @@ def addPage(resource, title):
print """UPDATE pages SET title='%s' WHERE resource='%s'""" % (title, resource) print """UPDATE pages SET title='%s' WHERE resource='%s'""" % (title, resource)
print sys.exc_type, sys.exc_value print sys.exc_type, sys.exc_value
return -1 return -1
return ret return ret
def updateWordHTML(name, resource, desc, id, relevance): def updateWordHTML(name, resource, desc, id, relevance):
@ -361,7 +361,7 @@ def updateWordHTML(name, resource, desc, id, relevance):
print """UPDATE wordsHTML SET section='%s', id='%s', relevance='%d' where name='%s' and resource='%s'""" % (desc, id, relevance, name, resource) print """UPDATE wordsHTML SET section='%s', id='%s', relevance='%d' where name='%s' and resource='%s'""" % (desc, id, relevance, name, resource)
print sys.exc_type, sys.exc_value print sys.exc_type, sys.exc_value
return -1 return -1
return ret return ret
def checkXMLMsgArchive(url): def checkXMLMsgArchive(url):
@ -383,9 +383,9 @@ def checkXMLMsgArchive(url):
return -1 return -1
except: except:
return -1 return -1
return row[0] return row[0]
def addXMLMsgArchive(url, title): def addXMLMsgArchive(url, title):
global DB global DB
@ -414,7 +414,7 @@ def addXMLMsgArchive(url, title):
except: except:
print "addXMLMsgArchive failed command: %s" % (cmd) print "addXMLMsgArchive failed command: %s" % (cmd)
return -1 return -1
return((int)(row[0])) return((int)(row[0]))
def updateWordArchive(name, id, relevance): def updateWordArchive(name, id, relevance):
@ -444,7 +444,7 @@ def updateWordArchive(name, id, relevance):
print """UPDATE wordsArchive SET relevance='%d' where name='%s' and ID='%d'""" % (relevance, name, id) print """UPDATE wordsArchive SET relevance='%d' where name='%s' and ID='%d'""" % (relevance, name, id)
print sys.exc_type, sys.exc_value print sys.exc_type, sys.exc_value
return -1 return -1
return ret return ret
######################################################################### #########################################################################
@ -501,7 +501,7 @@ def cleanupWordsString(str):
str = string.replace(str, "\xc2", " ") str = string.replace(str, "\xc2", " ")
str = string.replace(str, "\xa0", " ") str = string.replace(str, "\xa0", " ")
return str return str
def cleanupDescrString(str): def cleanupDescrString(str):
str = string.replace(str, "'", " ") str = string.replace(str, "'", " ")
str = string.replace(str, "\n", " ") str = string.replace(str, "\n", " ")
@ -557,7 +557,7 @@ def addWord(word, module, symbol, relevance):
wordsDict[word] = {} wordsDict[word] = {}
wordsDict[word][(module, symbol)] = relevance wordsDict[word][(module, symbol)] = relevance
return relevance return relevance
def addString(str, module, symbol, relevance): def addString(str, module, symbol, relevance):
if str == None or len(str) < 3: if str == None or len(str) < 3:
return -1 return -1
@ -603,7 +603,7 @@ def addWordHTML(word, resource, id, section, relevance):
d = wordsDictHTML[word]; d = wordsDictHTML[word];
d[resource] = (relevance, id, section) d[resource] = (relevance, id, section)
return relevance return relevance
def addStringHTML(str, resource, id, section, relevance): def addStringHTML(str, resource, id, section, relevance):
if str == None or len(str) < 3: if str == None or len(str) < 3:
return -1 return -1
@ -650,7 +650,7 @@ def addWordArchive(word, id, relevance):
d = wordsDictArchive[word]; d = wordsDictArchive[word];
d[id] = relevance d[id] = relevance
return relevance return relevance
def addStringArchive(str, id, relevance): def addStringArchive(str, id, relevance):
if str == None or len(str) < 3: if str == None or len(str) < 3:
return -1 return -1
@ -692,7 +692,7 @@ def foundExport(file, symbol):
for word in l: for word in l:
addWord(word, file, symbol, 10) addWord(word, file, symbol, 10)
return 1 return 1
def analyzeAPIFile(top): def analyzeAPIFile(top):
count = 0 count = 0
name = top.prop("name") name = top.prop("name")
@ -711,7 +711,7 @@ def analyzeAPIFile(top):
def analyzeAPIFiles(top): def analyzeAPIFiles(top):
count = 0 count = 0
cur = top.children cur = top.children
while cur != None: while cur != None:
if cur.type == 'text': if cur.type == 'text':
cur = cur.next cur = cur.next
@ -897,7 +897,7 @@ def analyzeAPIFunction(top):
def analyzeAPISymbols(top): def analyzeAPISymbols(top):
count = 0 count = 0
cur = top.children cur = top.children
while cur != None: while cur != None:
if cur.type == 'text': if cur.type == 'text':
cur = cur.next cur = cur.next
@ -1129,7 +1129,7 @@ def scanXMLDateArchive(t = None, force = 0):
pass pass
return newmsg return newmsg
######################################################################### #########################################################################
# # # #

View File

@ -12,10 +12,10 @@ Functional description:
- stop - stop
- suspend - suspend
- resume - resume
- monitor - monitor
More advanced features should be allowed as future extensions, but More advanced features should be allowed as future extensions, but
are not expected to be provided in first shipment. are not expected to be provided in first shipment.
Open enough Licence that customers can link their apps to it (LGPL) Open enough Licence that customers can link their apps to it (LGPL)
Small and contained enough that we can use it as a way to Small and contained enough that we can use it as a way to
@ -32,8 +32,8 @@ Python code on top driving the hypervisor.
are not uncommon, and it is very low level usually without comment about are not uncommon, and it is very low level usually without comment about
the function or its arguments. They are usually only called once in the the function or its arguments. They are usually only called once in the
whole tree by the python bindings. In essence it looks like the Xen project whole tree by the python bindings. In essence it looks like the Xen project
was not implemented with the idea of reusing that part of the code by was not implemented with the idea of reusing that part of the code by
applications. applications.
Indeed most of the userland code coming with Xen is built on Python, Indeed most of the userland code coming with Xen is built on Python,
like xend the xen daemon running on domain 0 or the xenstored daemon which like xend the xen daemon running on domain 0 or the xenstored daemon which
manage the state of the domains launched. manage the state of the domains launched.
@ -54,7 +54,7 @@ The IBM way:
------------ ------------
Here is supposition about code that I can't instanciate except by looking Here is supposition about code that I can't instanciate except by looking
at said code but it looks that IBM also needed a C programmatic API to at said code but it looks that IBM also needed a C programmatic API to
manage the Xen domain definitions. Their solution was to build (Rusty manage the Xen domain definitions. Their solution was to build (Rusty
Russell did this) an LGPL C API connecting directly to the xenstore Russell did this) an LGPL C API connecting directly to the xenstore
daemon (./tools/xenstore/*). In a way this is quite more fragile as it depends daemon (./tools/xenstore/*). In a way this is quite more fragile as it depends

View File

@ -54,11 +54,11 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
<li>Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology <li>Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology
cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel
Berrange), XM processing of vnc parameters (Daniel Berrange), Reset Berrange), XM processing of vnc parameters (Daniel Berrange), Reset
migration source after failure (Jim Paris), negative integer in config migration source after failure (Jim Paris), negative integer in config
(Tatsuro Enokura), zero terminating string buffer, detect integer (Tatsuro Enokura), zero terminating string buffer, detect integer
overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange), overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange),
recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom
(Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon), (Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon),
avoid xend errors when adding disks (Masayuki Sunou), compile error avoid xend errors when adding disks (Masayuki Sunou), compile error
(Chris Lalancette), transposed fwrite args (Jim Meyering), compile (Chris Lalancette), transposed fwrite args (Jim Meyering), compile
without xen and on solaris (Jim Paris), parsing of interface names without xen and on solaris (Jim Paris), parsing of interface names
@ -82,10 +82,10 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
&lt;shareable/&gt; in configs, pinning inactive domains for Xen 3.0.3 &lt;shareable/&gt; in configs, pinning inactive domains for Xen 3.0.3
(Saori Fukuta), use gnulib for portability enhancement (Jim Meyering), (Saori Fukuta), use gnulib for portability enhancement (Jim Meyering),
--without-libvirtd config option (Richard Jones), Python bindings for --without-libvirtd config option (Richard Jones), Python bindings for
NUMA, add extra utility functions to buffer (Richard Jones), NUMA, add extra utility functions to buffer (Richard Jones),
separate qparams module for handling query parameters (Richard Jones) separate qparams module for handling query parameters (Richard Jones)
</li> </li>
<li>Code cleanups: remove virDomainRestart from API as it was never used <li>Code cleanups: remove virDomainRestart from API as it was never used
(Richard Jones), constify params for attach/detach APIs (Daniel Berrange), (Richard Jones), constify params for attach/detach APIs (Daniel Berrange),
gcc printf attribute checkings (Jim Meyering), refactoring of device gcc printf attribute checkings (Jim Meyering), refactoring of device
parsing code and shell escaping (Daniel Berrange), virsh schedinfo parsing code and shell escaping (Daniel Berrange), virsh schedinfo
@ -119,7 +119,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies
when using remote (Daniel Berrange), xend connection error message when using remote (Daniel Berrange), xend connection error message
(Richard Jones), avoid ssh tty prompt (Daniel Berrange), username (Richard Jones), avoid ssh tty prompt (Daniel Berrange), username
handling for remote URIs (Fabian Deutsch), fix potential crash handling for remote URIs (Fabian Deutsch), fix potential crash
on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls
fixup (Mark Johnson)</li> fixup (Mark Johnson)</li>
<li>Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac), <li>Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac),
@ -137,7 +137,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
</ul> </ul>
<h3>0.3.2: Aug 21 2007</h3> <h3>0.3.2: Aug 21 2007</h3>
<ul> <ul>
<li>New features: KVM migration and save/restore (Jim Paris), <li>New features: KVM migration and save/restore (Jim Paris),
added API for migration (Richard Jones), added APIs for block device and added API for migration (Richard Jones), added APIs for block device and
interface statistic (Richard Jones).</li> interface statistic (Richard Jones).</li>
<li>Documentation: examples for XML network APIs, <li>Documentation: examples for XML network APIs,
@ -200,8 +200,8 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
the URI connection strings (Richard Jones), update of virsh man the URI connection strings (Richard Jones), update of virsh man
page, matrix of libvirt API/hypervisor support with version page, matrix of libvirt API/hypervisor support with version
informations (Richard Jones)</li> informations (Richard Jones)</li>
<li>Bug fixes: examples Makefile.am generation (Richard Jones), <li>Bug fixes: examples Makefile.am generation (Richard Jones),
SetMem fix (Mark Johnson), URI handling and ordering of SetMem fix (Mark Johnson), URI handling and ordering of
drivers (Daniel Berrange), fix virsh help without hypervisor (Richard drivers (Daniel Berrange), fix virsh help without hypervisor (Richard
Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus
on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler
@ -211,12 +211,12 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
XML serialization bugs</li> XML serialization bugs</li>
<li>Improvements: QEmu switch to XDR-based protocol (Dan Berrange), <li>Improvements: QEmu switch to XDR-based protocol (Dan Berrange),
device attach/detach commands (Masayuki Sunou), OCaml bindings device attach/detach commands (Masayuki Sunou), OCaml bindings
(Richard Jones), new entry points virDomainGetConnect and (Richard Jones), new entry points virDomainGetConnect and
virNetworkGetConnect useful for bindings (Richard Jones), virNetworkGetConnect useful for bindings (Richard Jones),
reunitifaction of remote and qemu daemon under a single libvirtd reunitifaction of remote and qemu daemon under a single libvirtd
with a config file (Daniel Berrange)</li> with a config file (Daniel Berrange)</li>
<li>Cleanups: parsing of connection URIs (Richard Jones), messages <li>Cleanups: parsing of connection URIs (Richard Jones), messages
from virsh (Saori Fukuta), Coverage files (Daniel Berrange), from virsh (Saori Fukuta), Coverage files (Daniel Berrange),
Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones), Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones),
release information in Xen backend, virsh cpupin command cleanups release information in Xen backend, virsh cpupin command cleanups
(Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and (Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and
@ -248,7 +248,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou), QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou),
fix compiler flags (Richard Jones), remove type ioemu on recent Xen fix compiler flags (Richard Jones), remove type ioemu on recent Xen
HVM for paravirt drivers (Saori Fukuta), uninitialized string bug HVM for paravirt drivers (Saori Fukuta), uninitialized string bug
(Masayuki Sunou), allow init even if the daemon is not running, (Masayuki Sunou), allow init even if the daemon is not running,
XML to config fix (Daniel Berrange)</li> XML to config fix (Daniel Berrange)</li>
<li>Improvements: add a special error class for the test module (Richard <li>Improvements: add a special error class for the test module (Richard
Jones), virConnectGetCapabilities on proxy (Richard Jones), allow Jones), virConnectGetCapabilities on proxy (Richard Jones), allow
@ -270,10 +270,10 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
</ul> </ul>
<h3>0.2.2: Apr 17 2007</h3> <h3>0.2.2: Apr 17 2007</h3>
<ul> <ul>
<li>Documentation: fix errors due to Amaya (with Simon Hernandez), <li>Documentation: fix errors due to Amaya (with Simon Hernandez),
virsh uses kB not bytes (Atsushi SAKAI), add command line help to virsh uses kB not bytes (Atsushi SAKAI), add command line help to
qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI), qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI),
strings typos (Nikolay Sivov), ilocalization probalem raised by strings typos (Nikolay Sivov), ilocalization probalem raised by
Thomas Canniot</li> Thomas Canniot</li>
<li>Bug fixes: virsh memory values test (Masayuki Sunou), operations without <li>Bug fixes: virsh memory values test (Masayuki Sunou), operations without
libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy
@ -285,14 +285,14 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
Berrange), bridged config configuration (Daniel Berrange), erroneous Berrange), bridged config configuration (Daniel Berrange), erroneous
XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark
McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto), McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto),
avoid memory explosion bug (Daniel Berrange), integer overflow avoid memory explosion bug (Daniel Berrange), integer overflow
for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel
Berrange)</li> Berrange)</li>
<li>Cleanups: remove some global variables (Jim Meyering), printf-style <li>Cleanups: remove some global variables (Jim Meyering), printf-style
functions checks (Jim Meyering), better virsh error messages, increase functions checks (Jim Meyering), better virsh error messages, increase
compiler checkings and security (Daniel Berrange), virBufferGrow usage compiler checkings and security (Daniel Berrange), virBufferGrow usage
and docs, use calloc instead of malloc/memset, replace all sprintf by and docs, use calloc instead of malloc/memset, replace all sprintf by
snprintf, avoid configure clobbering user's CTAGS (Jim Meyering), snprintf, avoid configure clobbering user's CTAGS (Jim Meyering),
signal handler error cleanup (Richard Jones), iptables internal code signal handler error cleanup (Richard Jones), iptables internal code
claenup (Mark McLoughlin), unified Xen driver (Richard Jones), claenup (Mark McLoughlin), unified Xen driver (Richard Jones),
cleanup XPath libxml2 calls, IPTables rules tightening (Daniel cleanup XPath libxml2 calls, IPTables rules tightening (Daniel
@ -303,7 +303,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
handling of CD-Rom device without device name (Nobuhiro Itou), handling of CD-Rom device without device name (Nobuhiro Itou),
fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange), fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange),
DomainGetOSType for inactive domains (Daniel Berrange), multiple boot DomainGetOSType for inactive domains (Daniel Berrange), multiple boot
devices for HVM (Daniel Berrange), devices for HVM (Daniel Berrange),
</li> </li>
</ul> </ul>
<h3>0.2.1: Mar 16 2007</h3> <h3>0.2.1: Mar 16 2007</h3>
@ -327,7 +327,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
Berrange), pointer/int mismatch (Richard Jones), configure time Berrange), pointer/int mismatch (Richard Jones), configure time
selection of drivers, libvirt spec hacking (Daniel Berrange)</li> selection of drivers, libvirt spec hacking (Daniel Berrange)</li>
<li>Add support for network autostart and init scripts (Mark McLoughlin)</li> <li>Add support for network autostart and init scripts (Mark McLoughlin)</li>
<li>New API virConnectGetCapabilities() to detect the virtualization <li>New API virConnectGetCapabilities() to detect the virtualization
capabilities of a host (Richard Jones)</li> capabilities of a host (Richard Jones)</li>
<li>Minor improvements: qemud signal handling (Mark), don't shutdown or reboot <li>Minor improvements: qemud signal handling (Mark), don't shutdown or reboot
domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange), domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange),
@ -347,7 +347,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p>
parsing (Richard Jones)</li> parsing (Richard Jones)</li>
<li>Add support for QEmu and KVM virtualization (Daniel Berrange)</li> <li>Add support for QEmu and KVM virtualization (Daniel Berrange)</li>
<li>Add support for network configuration (Mark McLoughlin)</li> <li>Add support for network configuration (Mark McLoughlin)</li>
<li>Minor improvements: regression testing (Daniel Berrange), <li>Minor improvements: regression testing (Daniel Berrange),
localization string updates</li> localization string updates</li>
</ul> </ul>
@ -1037,8 +1037,8 @@ support a variety of options:</p>
VMs to have outgoing access. Example configs are:</p> VMs to have outgoing access. Example configs are:</p>
<pre>&lt;interface type='user'/&gt;</pre> <pre>&lt;interface type='user'/&gt;</pre>
<pre> <pre>
&lt;interface type='user'&gt; &lt;interface type='user'&gt;
&lt;mac address="11:22:33:44:55:66"/&gt; &lt;mac address="11:22:33:44:55:66"/&gt;
&lt;/interface&gt; &lt;/interface&gt;
</pre> </pre>
</li> </li>
@ -1082,7 +1082,7 @@ support a variety of options:</p>
&lt;source dev='br0'/&gt; &lt;source dev='br0'/&gt;
&lt;target dev='vnet7'/&gt; &lt;target dev='vnet7'/&gt;
&lt;mac address="11:22:33:44:55:66"/&gt; &lt;mac address="11:22:33:44:55:66"/&gt;
&lt;/interface&gt;</pre> &lt;/interface&gt;</pre>
</li> </li>
<li>Generic connection to LAN <li>Generic connection to LAN
<p>Provides a means for the administrator to execute an arbitrary script <p>Provides a means for the administrator to execute an arbitrary script
@ -1678,7 +1678,7 @@ source on Windows:
<ol> <ol>
<li> <li>
<p>Run Cygwin <p>Run Cygwin
<a href="http://www.cygwin.com/setup.exe">setup.exe</a>. <a href="http://www.cygwin.com/setup.exe">setup.exe</a>.
When it starts up it will show a dialog like this: When it starts up it will show a dialog like this:
</p> </p>
@ -3130,7 +3130,7 @@ daemon is to manage qemu instances.
</p> </p>
<p> <p>
The <code>libvirtd</code> daemon should be started by the The <code>libvirtd</code> daemon should be started by the
init scripts when the machine boots. It should appear as init scripts when the machine boots. It should appear as
a process <code>libvirtd --daemon</code> running as root a process <code>libvirtd --daemon</code> running as root
in the background and will handle qemu instances on behalf in the background and will handle qemu instances on behalf

View File

@ -6,7 +6,7 @@
<ref name='domain'/> <ref name='domain'/>
</start> </start>
<!-- <!--
We handle only document defining a domain We handle only document defining a domain
Currently the virtualization types supported are: Currently the virtualization types supported are:
- xen, either paravirualized with a linux os or fully virtualized (hvm) - xen, either paravirualized with a linux os or fully virtualized (hvm)
@ -166,7 +166,7 @@
</group> </group>
</define> </define>
<!-- <!--
The Identifiers can be: The Identifiers can be:
- an optional id attribute with a number on the domain element - an optional id attribute with a number on the domain element
- a mandatory name - a mandatory name
@ -371,7 +371,7 @@
</define> </define>
<!-- <!--
Disk may use a special driver for access. Currently this is Disk may use a special driver for access. Currently this is
only defined for Xen for tap/aio and file, but will certainly be only defined for Xen for tap/aio and file, but will certainly be
extended in the future, and libvirt doesn't look for specific values. extended in the future, and libvirt doesn't look for specific values.
--> -->

View File

@ -492,7 +492,7 @@
<xsl:sort select='@symbol'/> <xsl:sort select='@symbol'/>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<xsl:template match="file"> <xsl:template match="file">
<xsl:variable name="name" select="@name"/> <xsl:variable name="name" select="@name"/>
<xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable> <xsl:variable name="title">Module <xsl:value-of select="$name"/> from <xsl:value-of select="/api/@name"/></xsl:variable>

View File

@ -17,11 +17,11 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
<li>Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology <li>Bug fixes: NUMA topology error handling (Beth Kon), NUMA topology
cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel cells without CPU (Beth Kon), XML to/from XM bridge config (Daniel
Berrange), XM processing of vnc parameters (Daniel Berrange), Reset Berrange), XM processing of vnc parameters (Daniel Berrange), Reset
migration source after failure (Jim Paris), negative integer in config migration source after failure (Jim Paris), negative integer in config
(Tatsuro Enokura), zero terminating string buffer, detect integer (Tatsuro Enokura), zero terminating string buffer, detect integer
overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange), overflow (Jim Meyering), QEmu command line ending fixes (Daniel Berrange),
recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom recursion problem in the daemon (Daniel Berrange), HVM domain with CDRom
(Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon), (Masayuki Sunou), off by one error in NUMA cpu count (Beth Kon),
avoid xend errors when adding disks (Masayuki Sunou), compile error avoid xend errors when adding disks (Masayuki Sunou), compile error
(Chris Lalancette), transposed fwrite args (Jim Meyering), compile (Chris Lalancette), transposed fwrite args (Jim Meyering), compile
without xen and on solaris (Jim Paris), parsing of interface names without xen and on solaris (Jim Paris), parsing of interface names
@ -45,10 +45,10 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
&lt;shareable/&gt; in configs, pinning inactive domains for Xen 3.0.3 &lt;shareable/&gt; in configs, pinning inactive domains for Xen 3.0.3
(Saori Fukuta), use gnulib for portability enhancement (Jim Meyering), (Saori Fukuta), use gnulib for portability enhancement (Jim Meyering),
--without-libvirtd config option (Richard Jones), Python bindings for --without-libvirtd config option (Richard Jones), Python bindings for
NUMA, add extra utility functions to buffer (Richard Jones), NUMA, add extra utility functions to buffer (Richard Jones),
separate qparams module for handling query parameters (Richard Jones) separate qparams module for handling query parameters (Richard Jones)
</li> </li>
<li>Code cleanups: remove virDomainRestart from API as it was never used <li>Code cleanups: remove virDomainRestart from API as it was never used
(Richard Jones), constify params for attach/detach APIs (Daniel Berrange), (Richard Jones), constify params for attach/detach APIs (Daniel Berrange),
gcc printf attribute checkings (Jim Meyering), refactoring of device gcc printf attribute checkings (Jim Meyering), refactoring of device
parsing code and shell escaping (Daniel Berrange), virsh schedinfo parsing code and shell escaping (Daniel Berrange), virsh schedinfo
@ -78,7 +78,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies missing buffer check in virDomainXMLDevID (Hugh Brock), avoid zombies
when using remote (Daniel Berrange), xend connection error message when using remote (Daniel Berrange), xend connection error message
(Richard Jones), avoid ssh tty prompt (Daniel Berrange), username (Richard Jones), avoid ssh tty prompt (Daniel Berrange), username
handling for remote URIs (Fabian Deutsch), fix potential crash handling for remote URIs (Fabian Deutsch), fix potential crash
on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls on multiple input XML tags (Daniel Berrange), Solaris Xen hypercalls
fixup (Mark Johnson)</li> fixup (Mark Johnson)</li>
<li>Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac), <li>Improvements: OpenVZ support (Shuveb Hussain and Anoop Cyriac),
@ -93,7 +93,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
statistics</li> statistics</li>
<li>Code cleanups: virDrvOpenRemoteFlags definition (Richard Jones), <li>Code cleanups: virDrvOpenRemoteFlags definition (Richard Jones),
configure tests and output (Daniel Berrange)</li> configure tests and output (Daniel Berrange)</li>
</ul><h3>0.3.2: Aug 21 2007</h3><ul><li>New features: KVM migration and save/restore (Jim Paris), </ul><h3>0.3.2: Aug 21 2007</h3><ul><li>New features: KVM migration and save/restore (Jim Paris),
added API for migration (Richard Jones), added APIs for block device and added API for migration (Richard Jones), added APIs for block device and
interface statistic (Richard Jones).</li> interface statistic (Richard Jones).</li>
<li>Documentation: examples for XML network APIs, <li>Documentation: examples for XML network APIs,
@ -149,8 +149,8 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
the URI connection strings (Richard Jones), update of virsh man the URI connection strings (Richard Jones), update of virsh man
page, matrix of libvirt API/hypervisor support with version page, matrix of libvirt API/hypervisor support with version
informations (Richard Jones)</li> informations (Richard Jones)</li>
<li>Bug fixes: examples Makefile.am generation (Richard Jones), <li>Bug fixes: examples Makefile.am generation (Richard Jones),
SetMem fix (Mark Johnson), URI handling and ordering of SetMem fix (Mark Johnson), URI handling and ordering of
drivers (Daniel Berrange), fix virsh help without hypervisor (Richard drivers (Daniel Berrange), fix virsh help without hypervisor (Richard
Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus
on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler
@ -160,12 +160,12 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
XML serialization bugs</li> XML serialization bugs</li>
<li>Improvements: QEmu switch to XDR-based protocol (Dan Berrange), <li>Improvements: QEmu switch to XDR-based protocol (Dan Berrange),
device attach/detach commands (Masayuki Sunou), OCaml bindings device attach/detach commands (Masayuki Sunou), OCaml bindings
(Richard Jones), new entry points virDomainGetConnect and (Richard Jones), new entry points virDomainGetConnect and
virNetworkGetConnect useful for bindings (Richard Jones), virNetworkGetConnect useful for bindings (Richard Jones),
reunitifaction of remote and qemu daemon under a single libvirtd reunitifaction of remote and qemu daemon under a single libvirtd
with a config file (Daniel Berrange)</li> with a config file (Daniel Berrange)</li>
<li>Cleanups: parsing of connection URIs (Richard Jones), messages <li>Cleanups: parsing of connection URIs (Richard Jones), messages
from virsh (Saori Fukuta), Coverage files (Daniel Berrange), from virsh (Saori Fukuta), Coverage files (Daniel Berrange),
Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones), Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones),
release information in Xen backend, virsh cpupin command cleanups release information in Xen backend, virsh cpupin command cleanups
(Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and (Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and
@ -194,7 +194,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou), QEmu memory bug (Daniel Berrange), memory leak fix (Masayuki Sunou),
fix compiler flags (Richard Jones), remove type ioemu on recent Xen fix compiler flags (Richard Jones), remove type ioemu on recent Xen
HVM for paravirt drivers (Saori Fukuta), uninitialized string bug HVM for paravirt drivers (Saori Fukuta), uninitialized string bug
(Masayuki Sunou), allow init even if the daemon is not running, (Masayuki Sunou), allow init even if the daemon is not running,
XML to config fix (Daniel Berrange)</li> XML to config fix (Daniel Berrange)</li>
<li>Improvements: add a special error class for the test module (Richard <li>Improvements: add a special error class for the test module (Richard
Jones), virConnectGetCapabilities on proxy (Richard Jones), allow Jones), virConnectGetCapabilities on proxy (Richard Jones), allow
@ -213,10 +213,10 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
Jones), export __virGetDomain and __virGetNetwork for libvirtd only Jones), export __virGetDomain and __virGetNetwork for libvirtd only
(Richard Jones), ignore old VNC config for HVM on recent Xen (Daniel (Richard Jones), ignore old VNC config for HVM on recent Xen (Daniel
Berrange), various code cleanups, -Werror cleanup (Hugh Brock)</li> Berrange), various code cleanups, -Werror cleanup (Hugh Brock)</li>
</ul><h3>0.2.2: Apr 17 2007</h3><ul><li>Documentation: fix errors due to Amaya (with Simon Hernandez), </ul><h3>0.2.2: Apr 17 2007</h3><ul><li>Documentation: fix errors due to Amaya (with Simon Hernandez),
virsh uses kB not bytes (Atsushi SAKAI), add command line help to virsh uses kB not bytes (Atsushi SAKAI), add command line help to
qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI), qemud (Richard Jones), xenUnifiedRegister docs (Atsushi SAKAI),
strings typos (Nikolay Sivov), ilocalization probalem raised by strings typos (Nikolay Sivov), ilocalization probalem raised by
Thomas Canniot</li> Thomas Canniot</li>
<li>Bug fixes: virsh memory values test (Masayuki Sunou), operations without <li>Bug fixes: virsh memory values test (Masayuki Sunou), operations without
libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy libvirt_qemud (Atsushi SAKAI), fix spec file (Florian La Roche, Jeremy
@ -228,14 +228,14 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
Berrange), bridged config configuration (Daniel Berrange), erroneous Berrange), bridged config configuration (Daniel Berrange), erroneous
XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark XEN_V2_OP_SETMAXMEM value (Masayuki Sunou), memory free error (Mark
McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto), McLoughlin), set VIR_CONNECT_RO on read-only connections (S.Sakamoto),
avoid memory explosion bug (Daniel Berrange), integer overflow avoid memory explosion bug (Daniel Berrange), integer overflow
for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel for qemu CPU time (Daniel Berrange), QEMU binary path check (Daniel
Berrange)</li> Berrange)</li>
<li>Cleanups: remove some global variables (Jim Meyering), printf-style <li>Cleanups: remove some global variables (Jim Meyering), printf-style
functions checks (Jim Meyering), better virsh error messages, increase functions checks (Jim Meyering), better virsh error messages, increase
compiler checkings and security (Daniel Berrange), virBufferGrow usage compiler checkings and security (Daniel Berrange), virBufferGrow usage
and docs, use calloc instead of malloc/memset, replace all sprintf by and docs, use calloc instead of malloc/memset, replace all sprintf by
snprintf, avoid configure clobbering user's CTAGS (Jim Meyering), snprintf, avoid configure clobbering user's CTAGS (Jim Meyering),
signal handler error cleanup (Richard Jones), iptables internal code signal handler error cleanup (Richard Jones), iptables internal code
claenup (Mark McLoughlin), unified Xen driver (Richard Jones), claenup (Mark McLoughlin), unified Xen driver (Richard Jones),
cleanup XPath libxml2 calls, IPTables rules tightening (Daniel cleanup XPath libxml2 calls, IPTables rules tightening (Daniel
@ -246,7 +246,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
handling of CD-Rom device without device name (Nobuhiro Itou), handling of CD-Rom device without device name (Nobuhiro Itou),
fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange), fix hypervisor call to work with Xen 3.0.5 (Daniel Berrange),
DomainGetOSType for inactive domains (Daniel Berrange), multiple boot DomainGetOSType for inactive domains (Daniel Berrange), multiple boot
devices for HVM (Daniel Berrange), devices for HVM (Daniel Berrange),
</li> </li>
</ul><h3>0.2.1: Mar 16 2007</h3><ul><li>Various internal cleanups (Richard Jones,Daniel Berrange,Mark McLoughlin)</li> </ul><h3>0.2.1: Mar 16 2007</h3><ul><li>Various internal cleanups (Richard Jones,Daniel Berrange,Mark McLoughlin)</li>
<li>Bug fixes: libvirt_qemud daemon path (Daniel Berrange), libvirt <li>Bug fixes: libvirt_qemud daemon path (Daniel Berrange), libvirt
@ -267,7 +267,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
Berrange), pointer/int mismatch (Richard Jones), configure time Berrange), pointer/int mismatch (Richard Jones), configure time
selection of drivers, libvirt spec hacking (Daniel Berrange)</li> selection of drivers, libvirt spec hacking (Daniel Berrange)</li>
<li>Add support for network autostart and init scripts (Mark McLoughlin)</li> <li>Add support for network autostart and init scripts (Mark McLoughlin)</li>
<li>New API virConnectGetCapabilities() to detect the virtualization <li>New API virConnectGetCapabilities() to detect the virtualization
capabilities of a host (Richard Jones)</li> capabilities of a host (Richard Jones)</li>
<li>Minor improvements: qemud signal handling (Mark), don't shutdown or reboot <li>Minor improvements: qemud signal handling (Mark), don't shutdown or reboot
domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange), domain0 (Kazuki Mizushima), QEmu version autodetection (Daniel Berrange),
@ -283,7 +283,7 @@ and check the <a href="ChangeLog.html">ChangeLog</a> to gauge progress.</p><h3>0
parsing (Richard Jones)</li> parsing (Richard Jones)</li>
<li>Add support for QEmu and KVM virtualization (Daniel Berrange)</li> <li>Add support for QEmu and KVM virtualization (Daniel Berrange)</li>
<li>Add support for network configuration (Mark McLoughlin)</li> <li>Add support for network configuration (Mark McLoughlin)</li>
<li>Minor improvements: regression testing (Daniel Berrange), <li>Minor improvements: regression testing (Daniel Berrange),
localization string updates</li> localization string updates</li>
</ul><h3>0.1.11: Jan 22 2007</h3><ul><li>Finish XML &lt;-&gt; XM config files support</li> </ul><h3>0.1.11: Jan 22 2007</h3><ul><li>Finish XML &lt;-&gt; XM config files support</li>
<li>Remove memory leak when freeing virConf objects</li> <li>Remove memory leak when freeing virConf objects</li>

View File

@ -34,7 +34,7 @@
</xsl:template> </xsl:template>
<xsl:template match="xhtml:a"> <xsl:template match="xhtml:a">
<xsl:value-of select="."/> <xsl:value-of select="."/>
<xsl:text> at <xsl:text> at
</xsl:text> </xsl:text>
<xsl:value-of select="@href"/> <xsl:value-of select="@href"/>
<xsl:text> <xsl:text>

View File

@ -66,7 +66,7 @@
$result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75"); $result = mysql_query ("SELECT words.relevance, symbols.name, symbols.type, symbols.module, symbols.descr FROM words, symbols WHERE LCASE(words.name) LIKE LCASE('$word') and words.symbol = symbols.name ORDER BY words.relevance DESC LIMIT 75");
if ($result) { if ($result) {
$j = mysql_num_rows($result); $j = mysql_num_rows($result);
if ($j == 0) if ($j == 0)
mysql_free_result($result); mysql_free_result($result);
} }
logQueryWord($word); logQueryWord($word);
@ -80,7 +80,7 @@
$result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75"); $result = mysql_query ("SELECT relevance, name, id, resource, section FROM wordsHTML WHERE LCASE(name) LIKE LCASE('$word') ORDER BY relevance DESC LIMIT 75");
if ($result) { if ($result) {
$j = mysql_num_rows($result); $j = mysql_num_rows($result);
if ($j == 0) if ($j == 0)
mysql_free_result($result); mysql_free_result($result);
} }
logQueryWord($word); logQueryWord($word);
@ -94,7 +94,7 @@
$result = mysql_query ("SELECT wordsArchive.relevance, wordsArchive.name, 'libvir-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75"); $result = mysql_query ("SELECT wordsArchive.relevance, wordsArchive.name, 'libvir-list', archives.resource, archives.title FROM wordsArchive, archives WHERE LCASE(wordsArchive.name) LIKE LCASE('$word') and wordsArchive.ID = archives.ID ORDER BY relevance DESC LIMIT 75");
if ($result) { if ($result) {
$j = mysql_num_rows($result); $j = mysql_num_rows($result);
if ($j == 0) if ($j == 0)
mysql_free_result($result); mysql_free_result($result);
} }
logQueryWord($word); logQueryWord($word);

View File

@ -263,7 +263,7 @@
</xsl:template> </xsl:template>
<!-- <!--
- The top section - The top section
--> -->
<xsl:template name="top"> <xsl:template name="top">
<div id="top"> <div id="top">
@ -286,7 +286,7 @@
<xsl:template name="bottom"> <xsl:template name="bottom">
<div id="bottom"> <div id="bottom">
<p class="p1"></p> <p class="p1"></p>
</div> </div>
</xsl:template> </xsl:template>
<!-- <!--

View File

@ -1,5 +1,5 @@
<node> <node>
<!-- This file gives an example config for the mock 'test' backend <!-- This file gives an example config for the mock 'test' backend
driver to libvirt. This is intended to allow relible unit testing driver to libvirt. This is intended to allow relible unit testing
of applications using libvirt. To use this with virsh, run something of applications using libvirt. To use this with virsh, run something
like: like:

View File

@ -51,7 +51,7 @@ To use QEMU support in libvirt you must be running the
in releases prior to 0.3.0). The purpose of this in releases prior to 0.3.0). The purpose of this
daemon is to manage qemu instances. daemon is to manage qemu instances.
</p><p> </p><p>
The <code>libvirtd</code> daemon should be started by the The <code>libvirtd</code> daemon should be started by the
init scripts when the machine boots. It should appear as init scripts when the machine boots. It should appear as
a process <code>libvirtd --daemon</code> running as root a process <code>libvirtd --daemon</code> running as root
in the background and will handle qemu instances on behalf in the background and will handle qemu instances on behalf

View File

@ -58,21 +58,21 @@ The following commands are generic i.e. not specific to a domain.
This prints a small synopsis about all commands available for B<virsh> This prints a small synopsis about all commands available for B<virsh>
B<help> I<command> will print out a detailed help message on that command. B<help> I<command> will print out a detailed help message on that command.
=item B<quit> =item B<quit>
quit this interactive terminal quit this interactive terminal
=item B<version> =item B<version>
Will print out the major version info about what this built from. Will print out the major version info about what this built from.
=over 4 =over 4
B<Example> B<Example>
B<virsh> version B<virsh> version
Compiled against library: libvir 0.0.6 Compiled against library: libvir 0.0.6
Using library: libvir 0.0.6 Using library: libvir 0.0.6
@ -113,7 +113,7 @@ The I<--readonly> option allows for read-only connection
Returns basic information about the node, like number and type of CPU, Returns basic information about the node, like number and type of CPU,
and size of the physical memory. and size of the physical memory.
=item B<capabilities> =item B<capabilities>
Print an XML document describing the capabilities of the hypervisor Print an XML document describing the capabilities of the hypervisor
we are currently connected to. This includes a section on the host we are currently connected to. This includes a section on the host
@ -123,7 +123,7 @@ description see:
L<http://libvirt.org/format.html#Capa1> L<http://libvirt.org/format.html#Capa1>
The XML also show the NUMA topology informations if available. The XML also show the NUMA topology informations if available.
=item B<list> =item B<list>
Prints information about one or more domains. If no domains are Prints information about one or more domains. If no domains are
specified it prints out information about all domains. specified it prints out information about all domains.
@ -131,20 +131,20 @@ specified it prints out information about all domains.
An example format for the list is as follows: An example format for the list is as follows:
B<virsh> list B<virsh> list
Id Name State Id Name State
---------------------------------- ----------------------------------
0 Domain-0 running 0 Domain-0 running
2 fedora paused 2 fedora paused
Name is the name of the domain. ID the domain numeric id. Name is the name of the domain. ID the domain numeric id.
State is the run state (see below). State is the run state (see below).
=item B<freecell> optional I<cellno> =item B<freecell> optional I<cellno>
Prints the available amount of memory on the machine or within a Prints the available amount of memory on the machine or within a
NUMA cell if I<cellno> is provided. NUMA cell if I<cellno> is provided.
=over 4 =over 4
@ -175,7 +175,7 @@ scheduling by the Xen hypervisor.
=item B<s - shutdown> =item B<s - shutdown>
The domain is in the process of shutting down, i.e. the guest operating system The domain is in the process of shutting down, i.e. the guest operating system
has been notified and should be in the process of stopping its operations has been notified and should be in the process of stopping its operations
gracefully. gracefully.
=item B<c - crashed> =item B<c - crashed>
@ -209,13 +209,13 @@ The option I<--disable> disable autostarting.
Connect the virtual serial console for the guest. Connect the virtual serial console for the guest.
=item B<create> I<FILE> =item B<create> I<FILE>
Create a domain from an XML <file> an easy way to create one if you have a pre-existing xen guest created via B<xm> create <XMLFILE>. Create a domain from an XML <file> an easy way to create one if you have a pre-existing xen guest created via B<xm> create <XMLFILE>.
B<Example> B<Example>
virsh dumpxml <domain-id> > file. virsh dumpxml <domain-id> > file.
=item B<define> I<FILE> =item B<define> I<FILE>
@ -229,7 +229,7 @@ OS any chance to react, and it the equivalent of ripping the power
cord out on a physical machine. In most cases you will want to use cord out on a physical machine. In most cases you will want to use
the B<shutdown> command instead. the B<shutdown> command instead.
=item B<dominfo> I<domain-id> =item B<dominfo> I<domain-id>
Returns basic information about the domain. Returns basic information about the domain.
@ -255,7 +255,7 @@ Returns state about a running domain.
=item B<dumpxml> I<domain-id> =item B<dumpxml> I<domain-id>
Output the domain informations as an XML dump to stdout, this format can be used by the B<create> command. Output the domain informations as an XML dump to stdout, this format can be used by the B<create> command.
=item B<reboot> I<domain-id> =item B<reboot> I<domain-id>
@ -296,13 +296,13 @@ domain is paravirtualized or running the PV balloon driver.
=item B<setmaxmem> I<domain-id> B<kilobytes> =item B<setmaxmem> I<domain-id> B<kilobytes>
Change the maximum memory allocation limit in the guest domain. This should Change the maximum memory allocation limit in the guest domain. This should
not change the current memory use. The memory limit is specified in not change the current memory use. The memory limit is specified in
kilobytes. kilobytes.
=item B<setvcpus> I<domain-id> I<count> =item B<setvcpus> I<domain-id> I<count>
Change the number of virtual CPUs active in the guest domain. Note that Change the number of virtual CPUs active in the guest domain. Note that
I<count> may be limited by host, hypervisor or limit coming from the I<count> may be limited by host, hypervisor or limit coming from the
original description of domain. original description of domain.
For Xen, you can only adjust the virtual CPUs of a running domain if For Xen, you can only adjust the virtual CPUs of a running domain if
@ -313,7 +313,7 @@ the domain is paravirtualized.
Gracefully shuts down a domain. This coordinates with the domain OS Gracefully shuts down a domain. This coordinates with the domain OS
to perform graceful shutdown, so there is no guarantee that it will to perform graceful shutdown, so there is no guarantee that it will
succeed, and may take a variable length of time depending on what succeed, and may take a variable length of time depending on what
services must be shutdown in the domain. services must be shutdown in the domain.
For a xen guest vm the behavior of what happens to a domain when it reboots is set by the For a xen guest vm the behavior of what happens to a domain when it reboots is set by the
I<on_shutdown> parameter of the xmdomain.cfg file when the domain was I<on_shutdown> parameter of the xmdomain.cfg file when the domain was
@ -428,7 +428,7 @@ The I<--disable> option disable autostarting.
=item B<net-create> I<file> =item B<net-create> I<file>
Create a virtual network from an XML I<file>, see the documentation to get Create a virtual network from an XML I<file>, see the documentation to get
a description of the XML network format used by libvirt. a description of the XML network format used by libvirt.
=item B<net-define> I<file> =item B<net-define> I<file>
@ -485,19 +485,19 @@ L<xm(1)>, L<xmdomain.cfg(5)>, L<xentop(1)> , L<http://www.libvirt.org/>
=head1 AUTHOR =head1 AUTHOR
Andrew Puch <apuch @ redhat.com> Andrew Puch <apuch @ redhat.com>
Daniel Veillard <veillard @ redhat.com> Daniel Veillard <veillard @ redhat.com>
Based on the xm man paged by Based on the xm man paged by
Sean Dague <sean at dague dot net> Sean Dague <sean at dague dot net>
Daniel Stekloff <dsteklof at us dot ibm dot com> Daniel Stekloff <dsteklof at us dot ibm dot com>
=head1 BUGS =head1 BUGS
Bugs can be view on the RedHat buzilla page under the libvirt Bugs can be view on the RedHat buzilla page under the libvirt
L<https://bugzilla.redhat.com/> L<https://bugzilla.redhat.com/>
L<https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr> L<https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr>
=end =end

View File

@ -48,7 +48,7 @@ latest version from CVS</a> </li>
These are the steps to take to compile libvirt from These are the steps to take to compile libvirt from
source on Windows: source on Windows:
</p><ol><li> </p><ol><li>
<p>Run Cygwin <p>Run Cygwin
<a href="http://www.cygwin.com/setup.exe">setup.exe</a>. <a href="http://www.cygwin.com/setup.exe">setup.exe</a>.
When it starts up it will show a dialog like this: When it starts up it will show a dialog like this:
</p> </p>

View File

@ -106,7 +106,7 @@ typedef enum {
* virNodeInfoPtr: * virNodeInfoPtr:
* *
* a virNodeInfo is a structure filled by virNodeGetInfo() and providing * a virNodeInfo is a structure filled by virNodeGetInfo() and providing
* the informations for the Node. * the informations for the Node.
*/ */
typedef struct _virNodeInfo virNodeInfo; typedef struct _virNodeInfo virNodeInfo;
@ -319,7 +319,7 @@ typedef virConnectCredential *virConnectCredentialPtr;
* @param cred list of virConnectCredential object to fetch from user * @param cred list of virConnectCredential object to fetch from user
* @param ncred size of cred list * @param ncred size of cred list
* @param cbdata opaque data passed to virConnectOpenAuth * @param cbdata opaque data passed to virConnectOpenAuth
* *
* When authentication requires one or more interactions, this callback * When authentication requires one or more interactions, this callback
* is invoked. For each interaction supplied, data must be gathered * is invoked. For each interaction supplied, data must be gathered
* from the user and filled in to the 'result' and 'resultlen' fields. * from the user and filled in to the 'result' and 'resultlen' fields.
@ -368,7 +368,7 @@ extern virConnectAuthPtr virConnectAuthPtrDefault;
/** /**
* LIBVIR_VERSION_NUMBER: * LIBVIR_VERSION_NUMBER:
* *
* Macro providing the version of the library as * Macro providing the version of the library as
* version * 1,000,000 + minor * 1000 + micro * version * 1,000,000 + minor * 1000 + micro
*/ */
@ -473,7 +473,7 @@ int virDomainCoreDump (virDomainPtr domain,
*/ */
int virDomainGetInfo (virDomainPtr domain, int virDomainGetInfo (virDomainPtr domain,
virDomainInfoPtr info); virDomainInfoPtr info);
/* /*
* Return scheduler type in effect 'sedf', 'credit', 'linux' * Return scheduler type in effect 'sedf', 'credit', 'linux'
*/ */
@ -487,7 +487,7 @@ const char * virDomainGetName (virDomainPtr domain);
unsigned int virDomainGetID (virDomainPtr domain); unsigned int virDomainGetID (virDomainPtr domain);
int virDomainGetUUID (virDomainPtr domain, int virDomainGetUUID (virDomainPtr domain,
unsigned char *uuid); unsigned char *uuid);
int virDomainGetUUIDString (virDomainPtr domain, int virDomainGetUUIDString (virDomainPtr domain,
char *buf); char *buf);
char * virDomainGetOSType (virDomainPtr domain); char * virDomainGetOSType (virDomainPtr domain);
unsigned long virDomainGetMaxMemory (virDomainPtr domain); unsigned long virDomainGetMaxMemory (virDomainPtr domain);

View File

@ -106,7 +106,7 @@ typedef enum {
* virNodeInfoPtr: * virNodeInfoPtr:
* *
* a virNodeInfo is a structure filled by virNodeGetInfo() and providing * a virNodeInfo is a structure filled by virNodeGetInfo() and providing
* the informations for the Node. * the informations for the Node.
*/ */
typedef struct _virNodeInfo virNodeInfo; typedef struct _virNodeInfo virNodeInfo;
@ -319,7 +319,7 @@ typedef virConnectCredential *virConnectCredentialPtr;
* @param cred list of virConnectCredential object to fetch from user * @param cred list of virConnectCredential object to fetch from user
* @param ncred size of cred list * @param ncred size of cred list
* @param cbdata opaque data passed to virConnectOpenAuth * @param cbdata opaque data passed to virConnectOpenAuth
* *
* When authentication requires one or more interactions, this callback * When authentication requires one or more interactions, this callback
* is invoked. For each interaction supplied, data must be gathered * is invoked. For each interaction supplied, data must be gathered
* from the user and filled in to the 'result' and 'resultlen' fields. * from the user and filled in to the 'result' and 'resultlen' fields.
@ -368,7 +368,7 @@ extern virConnectAuthPtr virConnectAuthPtrDefault;
/** /**
* LIBVIR_VERSION_NUMBER: * LIBVIR_VERSION_NUMBER:
* *
* Macro providing the version of the library as * Macro providing the version of the library as
* version * 1,000,000 + minor * 1000 + micro * version * 1,000,000 + minor * 1000 + micro
*/ */
@ -473,7 +473,7 @@ int virDomainCoreDump (virDomainPtr domain,
*/ */
int virDomainGetInfo (virDomainPtr domain, int virDomainGetInfo (virDomainPtr domain,
virDomainInfoPtr info); virDomainInfoPtr info);
/* /*
* Return scheduler type in effect 'sedf', 'credit', 'linux' * Return scheduler type in effect 'sedf', 'credit', 'linux'
*/ */
@ -487,7 +487,7 @@ const char * virDomainGetName (virDomainPtr domain);
unsigned int virDomainGetID (virDomainPtr domain); unsigned int virDomainGetID (virDomainPtr domain);
int virDomainGetUUID (virDomainPtr domain, int virDomainGetUUID (virDomainPtr domain,
unsigned char *uuid); unsigned char *uuid);
int virDomainGetUUIDString (virDomainPtr domain, int virDomainGetUUIDString (virDomainPtr domain,
char *buf); char *buf);
char * virDomainGetOSType (virDomainPtr domain); char * virDomainGetOSType (virDomainPtr domain);
unsigned long virDomainGetMaxMemory (virDomainPtr domain); unsigned long virDomainGetMaxMemory (virDomainPtr domain);

View File

@ -75,7 +75,7 @@ Obsoletes: libvir-python
%description python %description python
The libvirt-python package contains a module that permits applications The libvirt-python package contains a module that permits applications
written in the Python programming language to use the interface written in the Python programming language to use the interface
supplied by the libvirt library to use the virtualization capabilities supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes). of recent versions of Linux (and other OSes).
%prep %prep
@ -348,7 +348,7 @@ fi
- add patch to address dom0_ops API breakage in Xen 3.0.3 tree - add patch to address dom0_ops API breakage in Xen 3.0.3 tree
* Mon Aug 28 2006 Jeremy Katz <katzj@redhat.com> - 0.1.4-4 * Mon Aug 28 2006 Jeremy Katz <katzj@redhat.com> - 0.1.4-4
- add patch to support paravirt framebuffer in Xen - add patch to support paravirt framebuffer in Xen
* Mon Aug 21 2006 Daniel Veillard <veillard@redhat.com> 0.1.4-3 * Mon Aug 21 2006 Daniel Veillard <veillard@redhat.com> 0.1.4-3
- another patch to fix network handling in non-HVM guests - another patch to fix network handling in non-HVM guests
@ -421,7 +421,7 @@ fi
- fixes some problems in 0.0.3 due to the change of names - fixes some problems in 0.0.3 due to the change of names
* Wed Feb 8 2006 Daniel Veillard <veillard@redhat.com> 0.0.3-1 * Wed Feb 8 2006 Daniel Veillard <veillard@redhat.com> 0.0.3-1
- changed library name to libvirt from libvir, complete and test the python - changed library name to libvirt from libvir, complete and test the python
bindings bindings
* Sun Jan 29 2006 Daniel Veillard <veillard@redhat.com> 0.0.2-1 * Sun Jan 29 2006 Daniel Veillard <veillard@redhat.com> 0.0.2-1

View File

@ -1,4 +1,4 @@
# translation of ru.po to # translation of ru.po to
# translation of ru.po to # translation of ru.po to
# translation of ru.po to # translation of ru.po to
# translation of ru.po to # translation of ru.po to

View File

@ -1,9 +1,9 @@
# Swedish translation of libvirt. # Swedish translation of libvirt.
# Copyright (C) 2006 Free Software Foundation, Inc. # Copyright (C) 2006 Free Software Foundation, Inc.
# Magnus Larsson <fedoratrans@gmail.com>, 2006, 2007. # Magnus Larsson <fedoratrans@gmail.com>, 2006, 2007.
# #
# #
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: libvirt\n" "Project-Id-Version: libvirt\n"

View File

@ -134,7 +134,7 @@ proxyCloseUnixSocket(void) {
if (fdServer < 0) if (fdServer < 0)
return(0); return(0);
ret = close(fdServer); ret = close(fdServer);
if (debug > 0) if (debug > 0)
fprintf(stderr, "closing unix socket %d: %d\n", fdServer, ret); fprintf(stderr, "closing unix socket %d: %d\n", fdServer, ret);
@ -166,7 +166,7 @@ proxyListenUnixSocket(const char *path) {
} }
/* /*
* Abstract socket do not hit the filesystem, way more secure and * Abstract socket do not hit the filesystem, way more secure and
* garanteed to be atomic * garanteed to be atomic
*/ */
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
@ -348,7 +348,7 @@ retry:
if (debug) if (debug)
fprintf(stderr, "wrote %d bytes to client %d on socket %d\n", fprintf(stderr, "wrote %d bytes to client %d on socket %d\n",
ret, nr, pollInfos[nr].fd); ret, nr, pollInfos[nr].fd);
return(0); return(0);
} }
/** /**
@ -389,13 +389,13 @@ retry:
if (debug) if (debug)
fprintf(stderr, "read %d bytes from client %d on socket %d\n", fprintf(stderr, "read %d bytes from client %d on socket %d\n",
ret, nr, pollInfos[nr].fd); ret, nr, pollInfos[nr].fd);
if ((req->version != PROXY_PROTO_VERSION) || if ((req->version != PROXY_PROTO_VERSION) ||
(req->len < sizeof(virProxyPacket)) || (req->len < sizeof(virProxyPacket)) ||
(req->len > sizeof(virProxyFullPacket))) (req->len > sizeof(virProxyFullPacket)))
goto comm_error; goto comm_error;
if (debug) if (debug)
fprintf(stderr, "Got command %d from client %d\n", req->command, nr); fprintf(stderr, "Got command %d from client %d\n", req->command, nr);
@ -683,7 +683,7 @@ comm_error:
/** /**
* proxyProcessRequests: * proxyProcessRequests:
* *
* process requests and timers * process requests and timers
*/ */
static void static void
proxyProcessRequests(void) { proxyProcessRequests(void) {
@ -745,7 +745,7 @@ proxyProcessRequests(void) {
proxyCloseClientSocket(i); proxyCloseClientSocket(i);
} }
} }
} }
} }
@ -756,7 +756,7 @@ proxyProcessRequests(void) {
* open, serve client requests, and process timing events. * open, serve client requests, and process timing events.
*/ */
static void static void
proxyMainLoop(void) { proxyMainLoop(void) {
while (! done) { while (! done) {
if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0) if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0)

View File

@ -69,7 +69,7 @@ uninstall-local:
CLEANFILES= $(GENERATED) libvirt.py CLEANFILES= $(GENERATED) libvirt.py
else else
all: all:
endif endif
dummy: dummy:

View File

@ -186,8 +186,8 @@ class docParser:
str = str + c str = str + c
if self.in_function == 1: if self.in_function == 1:
self.function_cond = str self.function_cond = str
def function(name, desc, ret, args, file, cond): def function(name, desc, ret, args, file, cond):
functions[name] = (desc, ret, args, file, cond) functions[name] = (desc, ret, args, file, cond)
@ -750,7 +750,7 @@ def buildWrappers():
if not classes_processed.has_key(tinfo[2]): if not classes_processed.has_key(tinfo[2]):
classes_list.append(tinfo[2]) classes_list.append(tinfo[2])
classes_processed[tinfo[2]] = () classes_processed[tinfo[2]] = ()
ctypes.append(type) ctypes.append(type)
ctypes_processed[type] = () ctypes_processed[type] = ()
@ -776,7 +776,7 @@ def buildWrappers():
func = nameFixup(name, "None", file, file) func = nameFixup(name, "None", file, file)
info = (0, func, name, ret, args, file) info = (0, func, name, ret, args, file)
function_classes['None'].append(info) function_classes['None'].append(info)
classes = open("libvirtclass.py", "w") classes = open("libvirtclass.py", "w")
txt = open("libvirtclass.txt", "w") txt = open("libvirtclass.txt", "w")

View File

@ -751,7 +751,7 @@ libvirt_virConnectListDefinedDomains(PyObject *self ATTRIBUTE_UNUSED,
c_retval = virConnectNumOfDefinedDomains(conn); c_retval = virConnectNumOfDefinedDomains(conn);
if (c_retval < 0) if (c_retval < 0)
return VIR_PY_NONE; return VIR_PY_NONE;
if (c_retval) { if (c_retval) {
names = malloc(sizeof(*names) * c_retval); names = malloc(sizeof(*names) * c_retval);
if (!names) if (!names)
@ -939,7 +939,7 @@ libvirt_virConnectListDefinedNetworks(PyObject *self ATTRIBUTE_UNUSED,
c_retval = virConnectNumOfDefinedNetworks(conn); c_retval = virConnectNumOfDefinedNetworks(conn);
if (c_retval < 0) if (c_retval < 0)
return VIR_PY_NONE; return VIR_PY_NONE;
if (c_retval) { if (c_retval) {
names = malloc(sizeof(*names) * c_retval); names = malloc(sizeof(*names) * c_retval);
if (!names) if (!names)
@ -1090,7 +1090,7 @@ error:
} }
py_retval = PyList_New(c_retval); py_retval = PyList_New(c_retval);
for (i = 0;i < c_retval;i++) { for (i = 0;i < c_retval;i++) {
PyList_SetItem(py_retval, i, PyList_SetItem(py_retval, i,
libvirt_longlongWrap((long long) freeMems[i])); libvirt_longlongWrap((long long) freeMems[i]));
} }
free(freeMems); free(freeMems);

View File

@ -129,7 +129,7 @@ while i < 30:
okay = 0 okay = 0
t = -1 t = -1
break; break;
if t == 0: if t == 0:
break break

View File

@ -36,6 +36,6 @@ except:
if dom2.name() != name0: if dom2.name() != name0:
print 'lookup of %s based on UUID brings a different domain %s' % ( print 'lookup of %s based on UUID brings a different domain %s' % (
name0, dom2.name()) name0, dom2.name())
print "OK" print "OK"
sys.exit(0) sys.exit(0)

View File

@ -45,7 +45,7 @@ libvirt_ulongWrap(unsigned long val)
#endif #endif
ret = PyLong_FromLong(val); ret = PyLong_FromLong(val);
return (ret); return (ret);
} }
PyObject * PyObject *
libvirt_longlongWrap(long long val) libvirt_longlongWrap(long long val)

View File

@ -1,5 +1,5 @@
# If you want to use the non-TLS socket, then you *must* include # If you want to use the non-TLS socket, then you *must* include
# the GSSAPI or DIGEST-MD5 mechanisms, because they are the only # the GSSAPI or DIGEST-MD5 mechanisms, because they are the only
# ones that can offer session encryption as well as authentication. # ones that can offer session encryption as well as authentication.
# #
# If you're only using TLS, then you can turn on any mechanisms # If you're only using TLS, then you can turn on any mechanisms

View File

@ -155,10 +155,10 @@ static void libvirtd_mdns_create_services(struct libvirtd_mdns_group *group) {
group->name, group->name,
entry->type, entry->type,
NULL, NULL,
NULL, NULL,
entry->port, entry->port,
NULL)) < 0) { NULL)) < 0) {
AVAHI_DEBUG("Failed to add %s service on port %d: %s", AVAHI_DEBUG("Failed to add %s service on port %d: %s",
entry->type, entry->port, avahi_strerror(ret)); entry->type, entry->port, avahi_strerror(ret));
avahi_entry_group_reset(group->handle); avahi_entry_group_reset(group->handle);
return; return;

View File

@ -38,7 +38,7 @@ struct libvirtd_mdns *libvirtd_mdns_new(void);
/** /**
* Starts the mdns client, advertizing any groups/entries currently registered * Starts the mdns client, advertizing any groups/entries currently registered
* *
* @mdns: manager to start advertizing * @mdns: manager to start advertizing
* *
* Starts the mdns client. Services may not be immediately visible, since * Starts the mdns client. Services may not be immediately visible, since

View File

@ -243,7 +243,7 @@ brAddDelInterface(brControl *ctl,
* @ctl: bridge control pointer * @ctl: bridge control pointer
* @bridge: the bridge name * @bridge: the bridge name
* @iface: the network interface name * @iface: the network interface name
* *
* Adds an interface to a bridge * Adds an interface to a bridge
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
@ -271,7 +271,7 @@ brAddInterface(brControl *ctl ATTRIBUTE_UNUSED,
* @ctl: bridge control pointer * @ctl: bridge control pointer
* @bridge: the bridge name * @bridge: the bridge name
* @iface: the network interface name * @iface: the network interface name
* *
* Removes an interface from a bridge * Removes an interface from a bridge
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
@ -662,7 +662,7 @@ brctlSpawn(char * const *argv)
* *
* Returns 0 in case of success or an errno code in case of failure. * Returns 0 in case of success or an errno code in case of failure.
*/ */
int int
brSetForwardDelay(brControl *ctl ATTRIBUTE_UNUSED, brSetForwardDelay(brControl *ctl ATTRIBUTE_UNUSED,
const char *bridge, const char *bridge,

View File

@ -167,7 +167,7 @@ char *
virBufferContentAndFree (virBufferPtr buf) virBufferContentAndFree (virBufferPtr buf)
{ {
char *content; char *content;
if (buf == NULL) if (buf == NULL)
return(NULL); return(NULL);

View File

@ -201,7 +201,7 @@ virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm)
return(NULL); return(NULL);
if ((comm == NULL) && (name == NULL)) if ((comm == NULL) && (name == NULL))
return(NULL); return(NULL);
ret = calloc(1, sizeof(*ret)); ret = calloc(1, sizeof(*ret));
if (ret == NULL) { if (ret == NULL) {
virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), 0); virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), 0);
@ -790,7 +790,7 @@ __virConfFree(virConfPtr conf)
* *
* Lookup the value associated to this entry in the configuration file * Lookup the value associated to this entry in the configuration file
* *
* Returns a pointer to the value or NULL if the lookup failed, the data * Returns a pointer to the value or NULL if the lookup failed, the data
* associated will be freed when virConfFree() is called * associated will be freed when virConfFree() is called
*/ */
virConfValuePtr virConfValuePtr
@ -896,7 +896,7 @@ __virConfWriteFile(const char *filename, virConfPtr conf)
virConfSaveEntry(buf, cur); virConfSaveEntry(buf, cur);
cur = cur->next; cur = cur->next;
} }
fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR ); fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR );
if (fd < 0) { if (fd < 0) {
virConfError(NULL, VIR_ERR_WRITE_FAILED, _("failed to open file"), 0); virConfError(NULL, VIR_ERR_WRITE_FAILED, _("failed to open file"), 0);
@ -950,7 +950,7 @@ __virConfWriteMem(char *memory, int *len, virConfPtr conf)
virConfSaveEntry(buf, cur); virConfSaveEntry(buf, cur);
cur = cur->next; cur = cur->next;
} }
if ((int) buf->use >= *len) { if ((int) buf->use >= *len) {
*len = buf->use; *len = buf->use;
ret = -1; ret = -1;

View File

@ -1,5 +1,5 @@
/* /*
* driver.h: description of the set of interfaces provided by a * driver.h: description of the set of interfaces provided by a
* entry point to the virtualization engine * entry point to the virtualization engine
*/ */
@ -197,7 +197,7 @@ typedef char *
(*virDrvDomainGetSchedulerType) (virDomainPtr domain, (*virDrvDomainGetSchedulerType) (virDomainPtr domain,
int *nparams); int *nparams);
typedef int typedef int
(*virDrvDomainGetSchedulerParameters) (*virDrvDomainGetSchedulerParameters)
(virDomainPtr domain, (virDomainPtr domain,
virSchedParameterPtr params, virSchedParameterPtr params,

View File

@ -145,7 +145,7 @@ virHashGrow(virHashTablePtr table, int size)
table->size = size; table->size = size;
/* If the two loops are merged, there would be situations where /* If the two loops are merged, there would be situations where
* a new entry needs to allocated and data copied into it from * a new entry needs to allocated and data copied into it from
* the main table. So instead, we run through the array twice, first * the main table. So instead, we run through the array twice, first
* copying all the elements in the main array (where we can't get * copying all the elements in the main array (where we can't get
* conflicts) and then the rest, so we only free (and don't allocate) * conflicts) and then the rest, so we only free (and don't allocate)

View File

@ -737,7 +737,7 @@ iptablesForwardAllowOut(iptablesContext *ctx,
* @network: the source network name * @network: the source network name
* @iface: the source interface name * @iface: the source interface name
* @physdev: the physical output device * @physdev: the physical output device
* *
* Add a rule to the IP table context to allow the traffic for the * Add a rule to the IP table context to allow the traffic for the
* network @network via interface @iface to be forwarded to * network @network via interface @iface to be forwarded to
* @physdev device. This allow the outbound traffic on a bridge. * @physdev device. This allow the outbound traffic on a bridge.
@ -759,7 +759,7 @@ iptablesAddForwardAllowOut(iptablesContext *ctx,
* @network: the source network name * @network: the source network name
* @iface: the source interface name * @iface: the source interface name
* @physdev: the physical output device * @physdev: the physical output device
* *
* Remove a rule from the IP table context hence forbidding forwarding * Remove a rule from the IP table context hence forbidding forwarding
* of the traffic for the network @network via interface @iface * of the traffic for the network @network via interface @iface
* to the @physdev device output. This stops the outbound traffic on a bridge. * to the @physdev device output. This stops the outbound traffic on a bridge.
@ -814,7 +814,7 @@ iptablesForwardAllowIn(iptablesContext *ctx,
* @network: the source network name * @network: the source network name
* @iface: the output interface name * @iface: the output interface name
* @physdev: the physical input device or NULL * @physdev: the physical input device or NULL
* *
* Add rules to the IP table context to allow the traffic for the * Add rules to the IP table context to allow the traffic for the
* network @network on @physdev device to be forwarded to * network @network on @physdev device to be forwarded to
* interface @iface. This allow the inbound traffic on a bridge. * interface @iface. This allow the inbound traffic on a bridge.
@ -836,7 +836,7 @@ iptablesAddForwardAllowIn(iptablesContext *ctx,
* @network: the source network name * @network: the source network name
* @iface: the output interface name * @iface: the output interface name
* @physdev: the physical input device or NULL * @physdev: the physical input device or NULL
* *
* Remove rules from the IP table context hence forbidding the traffic for * Remove rules from the IP table context hence forbidding the traffic for
* network @network on @physdev device to be forwarded to * network @network on @physdev device to be forwarded to
* interface @iface. This stops the inbound traffic on a bridge. * interface @iface. This stops the inbound traffic on a bridge.
@ -1036,7 +1036,7 @@ iptablesForwardMasquerade(iptablesContext *ctx,
* @ctx: pointer to the IP table context * @ctx: pointer to the IP table context
* @network: the source network name * @network: the source network name
* @physdev: the physical input device or NULL * @physdev: the physical input device or NULL
* *
* Add rules to the IP table context to allow masquerading * Add rules to the IP table context to allow masquerading
* network @network on @physdev. This allow the bridge to * network @network on @physdev. This allow the bridge to
* masquerade for that network (on @physdev). * masquerade for that network (on @physdev).
@ -1056,7 +1056,7 @@ iptablesAddForwardMasquerade(iptablesContext *ctx,
* @ctx: pointer to the IP table context * @ctx: pointer to the IP table context
* @network: the source network name * @network: the source network name
* @physdev: the physical input device or NULL * @physdev: the physical input device or NULL
* *
* Remove rules from the IP table context to stop masquerading * Remove rules from the IP table context to stop masquerading
* network @network on @physdev. This stops the bridge from * network @network on @physdev. This stops the bridge from
* masquerading for that network (on @physdev). * masquerading for that network (on @physdev).

View File

@ -204,7 +204,7 @@ virInitialize(void)
#ifdef WITH_TEST #ifdef WITH_TEST
if (testRegister() == -1) return -1; if (testRegister() == -1) return -1;
#endif #endif
#ifdef WITH_QEMU #ifdef WITH_QEMU
if (qemudRegister() == -1) return -1; if (qemudRegister() == -1) return -1;
#endif #endif
#ifdef WITH_XEN #ifdef WITH_XEN
@ -468,7 +468,7 @@ int __virStateActive(void) {
* Provides two information back, @libVer is the version of the library * Provides two information back, @libVer is the version of the library
* while @typeVer will be the version of the hypervisor type @type against * while @typeVer will be the version of the hypervisor type @type against
* which the library was compiled. If @type is NULL, "Xen" is assumed, if * which the library was compiled. If @type is NULL, "Xen" is assumed, if
* @type is unknown or not availble, an error code will be returned and * @type is unknown or not availble, an error code will be returned and
* @typeVer will be 0. * @typeVer will be 0.
* *
* Returns -1 in case of failure, 0 otherwise, and values for @libVer and * Returns -1 in case of failure, 0 otherwise, and values for @libVer and
@ -597,7 +597,7 @@ do_open (const char *name,
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status"))); (res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
if (res == VIR_DRV_OPEN_ERROR) { if (res == VIR_DRV_OPEN_ERROR) {
if (STREQ(virNetworkDriverTab[i]->name, "remote")) { if (STREQ(virNetworkDriverTab[i]->name, "remote")) {
virLibConnWarning (NULL, VIR_WAR_NO_NETWORK, virLibConnWarning (NULL, VIR_WAR_NO_NETWORK,
"Is the daemon running ?"); "Is the daemon running ?");
} }
break; break;
@ -625,7 +625,7 @@ failed:
* virConnectOpen: * virConnectOpen:
* @name: URI of the hypervisor * @name: URI of the hypervisor
* *
* This function should be called first to get a connection to the * This function should be called first to get a connection to the
* Hypervisor and xen store * Hypervisor and xen store
* *
* Returns a pointer to the hypervisor connection or NULL in case of error * Returns a pointer to the hypervisor connection or NULL in case of error
@ -643,7 +643,7 @@ virConnectOpen (const char *name)
* virConnectOpenReadOnly: * virConnectOpenReadOnly:
* @name: URI of the hypervisor * @name: URI of the hypervisor
* *
* This function should be called first to get a restricted connection to the * This function should be called first to get a restricted connection to the
* libbrary functionalities. The set of APIs usable are then restricted * libbrary functionalities. The set of APIs usable are then restricted
* on the available methods to control the domains. * on the available methods to control the domains.
* *
@ -664,7 +664,7 @@ virConnectOpenReadOnly(const char *name)
* @auth: Authenticate callback parameters * @auth: Authenticate callback parameters
* @flags: Open flags * @flags: Open flags
* *
* This function should be called first to get a connection to the * This function should be called first to get a connection to the
* Hypervisor. If neccessary, authentication will be performed fetching * Hypervisor. If neccessary, authentication will be performed fetching
* credentials via the callback * credentials via the callback
* *
@ -757,7 +757,7 @@ virConnectGetType(virConnectPtr conn)
* @conn: pointer to the hypervisor connection * @conn: pointer to the hypervisor connection
* @hvVer: return value for the version of the running hypervisor (OUT) * @hvVer: return value for the version of the running hypervisor (OUT)
* *
* Get the version level of the Hypervisor running. This may work only with * Get the version level of the Hypervisor running. This may work only with
* hypervisor call, i.e. with priviledged access to the hypervisor, not * hypervisor call, i.e. with priviledged access to the hypervisor, not
* with a Read-Only connection. * with a Read-Only connection.
* *
@ -978,7 +978,7 @@ virDomainGetConnect (virDomainPtr dom)
* Launch a new Linux guest domain, based on an XML description similar * Launch a new Linux guest domain, based on an XML description similar
* to the one returned by virDomainGetXMLDesc() * to the one returned by virDomainGetXMLDesc()
* This function may requires priviledged access to the hypervisor. * This function may requires priviledged access to the hypervisor.
* *
* Returns a new domain object or NULL in case of failure * Returns a new domain object or NULL in case of failure
*/ */
virDomainPtr virDomainPtr
@ -1096,10 +1096,10 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
if (uuidstr == NULL) { if (uuidstr == NULL) {
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
return (NULL); return (NULL);
} }
/* XXX: sexpr_uuid() also supports 'xxxx-xxxx-xxxx-xxxx' format. /* XXX: sexpr_uuid() also supports 'xxxx-xxxx-xxxx-xxxx' format.
* We needn't it here. Right? * We needn't it here. Right?
*/ */
ret = sscanf(uuidstr, ret = sscanf(uuidstr,
"%02x%02x%02x%02x-" "%02x%02x%02x%02x-"
@ -1111,14 +1111,14 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
raw + 4, raw + 5, raw + 6, raw + 7, raw + 4, raw + 5, raw + 6, raw + 7,
raw + 8, raw + 9, raw + 10, raw + 11, raw + 8, raw + 9, raw + 10, raw + 11,
raw + 12, raw + 13, raw + 14, raw + 15); raw + 12, raw + 13, raw + 14, raw + 15);
if (ret!=VIR_UUID_BUFLEN) { if (ret!=VIR_UUID_BUFLEN) {
virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__);
return (NULL); return (NULL);
} }
for (i = 0; i < VIR_UUID_BUFLEN; i++) for (i = 0; i < VIR_UUID_BUFLEN; i++)
uuid[i] = raw[i] & 0xFF; uuid[i] = raw[i] & 0xFF;
return virDomainLookupByUUID(conn, &uuid[0]); return virDomainLookupByUUID(conn, &uuid[0]);
} }
@ -1218,7 +1218,7 @@ virDomainFree(virDomainPtr domain)
* @domain: a domain object * @domain: a domain object
* *
* Suspends an active domain, the process is frozen without further access * Suspends an active domain, the process is frozen without further access
* to CPU resources and I/O but the memory used by the domain at the * to CPU resources and I/O but the memory used by the domain at the
* hypervisor level will stay allocated. Use virDomainResume() to reactivate * hypervisor level will stay allocated. Use virDomainResume() to reactivate
* the domain. * the domain.
* This function may requires priviledged access. * This function may requires priviledged access.
@ -1346,7 +1346,7 @@ virDomainSave(virDomainPtr domain, const char *to)
/** /**
* virDomainRestore: * virDomainRestore:
* @conn: pointer to the hypervisor connection * @conn: pointer to the hypervisor connection
* @from: path to the * @from: path to the
* *
* This method will restore a domain saved to disk by virDomainSave(). * This method will restore a domain saved to disk by virDomainSave().
* *
@ -1586,7 +1586,7 @@ virDomainGetUUID(virDomainPtr domain, unsigned char *uuid)
* @domain: a domain object * @domain: a domain object
* @buf: pointer to a VIR_UUID_STRING_BUFLEN bytes array * @buf: pointer to a VIR_UUID_STRING_BUFLEN bytes array
* *
* Get the UUID for a domain as string. For more information about * Get the UUID for a domain as string. For more information about
* UUID see RFC4122. * UUID see RFC4122.
* *
* Returns -1 in case of error, 0 in case of success * Returns -1 in case of error, 0 in case of success
@ -1605,7 +1605,7 @@ virDomainGetUUIDString(virDomainPtr domain, char *buf)
virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__); virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__);
return (-1); return (-1);
} }
if (virDomainGetUUID(domain, &uuid[0])) if (virDomainGetUUID(domain, &uuid[0]))
return (-1); return (-1);
@ -1665,7 +1665,7 @@ virDomainGetOSType(virDomainPtr domain)
/** /**
* virDomainGetMaxMemory: * virDomainGetMaxMemory:
* @domain: a domain object or NULL * @domain: a domain object or NULL
* *
* Retrieve the maximum amount of physical memory allocated to a * Retrieve the maximum amount of physical memory allocated to a
* domain. If domain is NULL, then this get the amount of memory reserved * domain. If domain is NULL, then this get the amount of memory reserved
* to Domain0 i.e. the domain where the application runs. * to Domain0 i.e. the domain where the application runs.
@ -1696,7 +1696,7 @@ virDomainGetMaxMemory(virDomainPtr domain)
* virDomainSetMaxMemory: * virDomainSetMaxMemory:
* @domain: a domain object or NULL * @domain: a domain object or NULL
* @memory: the memory size in kilobytes * @memory: the memory size in kilobytes
* *
* Dynamically change the maximum amount of physical memory allocated to a * Dynamically change the maximum amount of physical memory allocated to a
* domain. If domain is NULL, then this change the amount of memory reserved * domain. If domain is NULL, then this change the amount of memory reserved
* to Domain0 i.e. the domain where the application runs. * to Domain0 i.e. the domain where the application runs.
@ -1739,7 +1739,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
* virDomainSetMemory: * virDomainSetMemory:
* @domain: a domain object or NULL * @domain: a domain object or NULL
* @memory: the memory size in kilobytes * @memory: the memory size in kilobytes
* *
* Dynamically change the target amount of physical memory allocated to a * Dynamically change the target amount of physical memory allocated to a
* domain. If domain is NULL, then this change the amount of memory reserved * domain. If domain is NULL, then this change the amount of memory reserved
* to Domain0 i.e. the domain where the application runs. * to Domain0 i.e. the domain where the application runs.
@ -1783,7 +1783,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory)
* virDomainGetInfo: * virDomainGetInfo:
* @domain: a domain object * @domain: a domain object
* @info: pointer to a virDomainInfo structure allocated by the user * @info: pointer to a virDomainInfo structure allocated by the user
* *
* Extract information about a domain. Note that if the connection * Extract information about a domain. Note that if the connection
* used to get the domain is limited only a partial set of the information * used to get the domain is limited only a partial set of the information
* can be extracted. * can be extracted.
@ -2069,7 +2069,7 @@ __virDomainMigrateFinish (virConnectPtr dconn,
* virNodeGetInfo: * virNodeGetInfo:
* @conn: pointer to the hypervisor connection * @conn: pointer to the hypervisor connection
* @info: pointer to a virNodeInfo structure allocated by the user * @info: pointer to a virNodeInfo structure allocated by the user
* *
* Extract hardware information about the node. * Extract hardware information about the node.
* *
* Returns 0 in case of success and -1 in case of failure. * Returns 0 in case of success and -1 in case of failure.
@ -2125,7 +2125,7 @@ virConnectGetCapabilities (virConnectPtr conn)
/** /**
* virNodeGetFreeMemory: * virNodeGetFreeMemory:
* @conn: pointer to the hypervisor connection * @conn: pointer to the hypervisor connection
* *
* provides the free memory availble on the Node * provides the free memory availble on the Node
* *
* Returns the available free memory in kilobytes or 0 in case of error * Returns the available free memory in kilobytes or 0 in case of error
@ -2226,7 +2226,7 @@ virDomainGetSchedulerParameters(virDomainPtr domain,
* Returns -1 in case of error, 0 in case of success. * Returns -1 in case of error, 0 in case of success.
*/ */
int int
virDomainSetSchedulerParameters(virDomainPtr domain, virDomainSetSchedulerParameters(virDomainPtr domain,
virSchedParameterPtr params, int nparams) virSchedParameterPtr params, int nparams)
{ {
virConnectPtr conn; virConnectPtr conn;
@ -2455,7 +2455,7 @@ virConnectNumOfDefinedDomains(virConnectPtr conn)
* @maxnames: size of the array * @maxnames: size of the array
* *
* list the defined domains, stores the pointers to the names in @names * list the defined domains, stores the pointers to the names in @names
* *
* Returns the number of names provided in the array or -1 in case of error * Returns the number of names provided in the array or -1 in case of error
*/ */
int int
@ -2639,7 +2639,7 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
* underlying virtualization system (Xen...). * underlying virtualization system (Xen...).
* If maplen < size, missing bytes are set to zero. * If maplen < size, missing bytes are set to zero.
* If maplen > size, failure code is returned. * If maplen > size, failure code is returned.
* *
* Dynamically change the real CPUs which can be allocated to a virtual CPU. * Dynamically change the real CPUs which can be allocated to a virtual CPU.
* This function requires priviledged access to the hypervisor. * This function requires priviledged access to the hypervisor.
* *
@ -2694,7 +2694,7 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
* virDomainPinVcpu() API. * virDomainPinVcpu() API.
* @maplen: number of bytes in one cpumap, from 1 up to size of CPU map in * @maplen: number of bytes in one cpumap, from 1 up to size of CPU map in
* underlying virtualization system (Xen...). * underlying virtualization system (Xen...).
* *
* Extract information about virtual CPUs of domain, store it in info array * Extract information about virtual CPUs of domain, store it in info array
* and also in cpumaps if this pointer is'nt NULL. * and also in cpumaps if this pointer is'nt NULL.
* *
@ -2737,7 +2737,7 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
/** /**
* virDomainGetMaxVcpus: * virDomainGetMaxVcpus:
* @domain: pointer to domain object * @domain: pointer to domain object
* *
* Provides the maximum number of virtual CPUs supported for * Provides the maximum number of virtual CPUs supported for
* the guest VM. If the guest is inactive, this is basically * the guest VM. If the guest is inactive, this is basically
* the same as virConnectGetMaxVcpus. If the guest is running * the same as virConnectGetMaxVcpus. If the guest is running
@ -2771,7 +2771,7 @@ virDomainGetMaxVcpus(virDomainPtr domain)
* virDomainAttachDevice: * virDomainAttachDevice:
* @domain: pointer to domain object * @domain: pointer to domain object
* @xml: pointer to XML description of one device * @xml: pointer to XML description of one device
* *
* Create a virtual device attachment to backend. * Create a virtual device attachment to backend.
* *
* Returns 0 in case of success, -1 in case of failure. * Returns 0 in case of success, -1 in case of failure.
@ -2803,7 +2803,7 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml)
* virDomainDetachDevice: * virDomainDetachDevice:
* @domain: pointer to domain object * @domain: pointer to domain object
* @xml: pointer to XML description of one device * @xml: pointer to XML description of one device
* *
* Destroy a virtual device attachment to backend. * Destroy a virtual device attachment to backend.
* *
* Returns 0 in case of success, -1 in case of failure. * Returns 0 in case of success, -1 in case of failure.

View File

@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Authors: * Authors:
* Shuveb Hussain <shuveb@binarykarma.com> * Shuveb Hussain <shuveb@binarykarma.com>
* Anoop Joe Cyriac <anoop@binarykarma.com> * Anoop Joe Cyriac <anoop@binarykarma.com>
* *
@ -74,7 +74,7 @@ error (virConnectPtr conn, virErrorNumber code, const char *info)
errmsg, info); errmsg, info);
} }
struct openvz_vm struct openvz_vm
*openvzFindVMByID(const struct openvz_driver *driver, int id) { *openvzFindVMByID(const struct openvz_driver *driver, int id) {
struct openvz_vm *vm = driver->vms; struct openvz_vm *vm = driver->vms;
@ -87,7 +87,7 @@ struct openvz_vm
return NULL; return NULL;
} }
struct openvz_vm struct openvz_vm
*openvzFindVMByUUID(const struct openvz_driver *driver, *openvzFindVMByUUID(const struct openvz_driver *driver,
const unsigned char *uuid) { const unsigned char *uuid) {
struct openvz_vm *vm = driver->vms; struct openvz_vm *vm = driver->vms;
@ -101,7 +101,7 @@ struct openvz_vm
return NULL; return NULL;
} }
struct openvz_vm struct openvz_vm
*openvzFindVMByName(const struct openvz_driver *driver, *openvzFindVMByName(const struct openvz_driver *driver,
const char *name) { const char *name) {
struct openvz_vm *vm = driver->vms; struct openvz_vm *vm = driver->vms;
@ -126,7 +126,7 @@ strtoI(const char *str)
/* Check for various possible errors */ /* Check for various possible errors */
if ((endptr == str) /* "No digits were found" */ if ((endptr == str) /* "No digits were found" */
||((*endptr != '\0') ||((*endptr != '\0')
&& (*endptr != ' ')) /*"Name contain characters other than integers" */ ) && (*endptr != ' ')) /*"Name contain characters other than integers" */ )
return 0; return 0;
return val; return val;
@ -172,7 +172,7 @@ openvzFreeVMDef(struct openvz_vm_def *def)
} }
} }
/* Free all memory associated with a openvz_vm structure /* Free all memory associated with a openvz_vm structure
* @checkCallee == 0 then openvzFreeDriver() is callee else some other function * @checkCallee == 0 then openvzFreeDriver() is callee else some other function
*/ */
void void
@ -237,7 +237,7 @@ openvzAssignVMDef(virConnectPtr conn,
} }
else else
{ {
openvzLog(OPENVZ_ERR, "Error already an active OPENVZ VM having id '%s'", openvzLog(OPENVZ_ERR, "Error already an active OPENVZ VM having id '%s'",
def->name); def->name);
openvzFreeVMDef(def); openvzFreeVMDef(def);
return NULL; /* can't redefine an active domain */ return NULL; /* can't redefine an active domain */
@ -247,7 +247,7 @@ openvzAssignVMDef(virConnectPtr conn,
} }
if (!(vm = calloc(1, sizeof(*vm)))) { if (!(vm = calloc(1, sizeof(*vm)))) {
openvzFreeVMDef(def); openvzFreeVMDef(def);
error(conn, VIR_ERR_NO_MEMORY, "vm"); error(conn, VIR_ERR_NO_MEMORY, "vm");
return NULL; return NULL;
} }
@ -263,14 +263,14 @@ openvzAssignVMDef(virConnectPtr conn,
return vm; return vm;
} }
struct openvz_vm_def struct openvz_vm_def
*openvzParseVMDef(virConnectPtr conn, *openvzParseVMDef(virConnectPtr conn,
const char *xmlStr, const char *displayName) const char *xmlStr, const char *displayName)
{ {
xmlDocPtr xml; xmlDocPtr xml;
struct openvz_vm_def *def = NULL; struct openvz_vm_def *def = NULL;
xml = xmlReadDoc(BAD_CAST xmlStr, displayName ? displayName : "domain.xml", NULL, xml = xmlReadDoc(BAD_CAST xmlStr, displayName ? displayName : "domain.xml", NULL,
XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOERROR | XML_PARSE_NOWARNING); XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (!xml) { if (!xml) {
error(conn, VIR_ERR_XML_ERROR, NULL); error(conn, VIR_ERR_XML_ERROR, NULL);
@ -287,7 +287,7 @@ struct openvz_vm_def
* Parses a libvirt XML definition of a guest, and populates the * Parses a libvirt XML definition of a guest, and populates the
* the openvz_vm struct with matching data about the guests config * the openvz_vm struct with matching data about the guests config
*/ */
static struct openvz_vm_def static struct openvz_vm_def
*openvzParseXML(virConnectPtr conn, *openvzParseXML(virConnectPtr conn,
xmlDocPtr xml) { xmlDocPtr xml) {
xmlNodePtr root = NULL; xmlNodePtr root = NULL;
@ -337,10 +337,10 @@ static struct openvz_vm_def
error(conn, VIR_ERR_INTERNAL_ERROR,"invalid domain name"); error(conn, VIR_ERR_INTERNAL_ERROR,"invalid domain name");
goto bail_out; goto bail_out;
} }
/* rejecting VPS ID <= OPENVZ_RSRV_VM_LIMIT for they are reserved */ /* rejecting VPS ID <= OPENVZ_RSRV_VM_LIMIT for they are reserved */
if (strtoI((const char *) obj->stringval) <= OPENVZ_RSRV_VM_LIMIT) { if (strtoI((const char *) obj->stringval) <= OPENVZ_RSRV_VM_LIMIT) {
error(conn, VIR_ERR_INTERNAL_ERROR, error(conn, VIR_ERR_INTERNAL_ERROR,
"VPS ID Error (must be an integer greater than 100"); "VPS ID Error (must be an integer greater than 100");
goto bail_out; goto bail_out;
} }
@ -365,7 +365,7 @@ static struct openvz_vm_def
/* Extract filesystem info */ /* Extract filesystem info */
obj = xmlXPathEval(BAD_CAST "string(/domain/container/filesystem/template[1])", ctxt); obj = xmlXPathEval(BAD_CAST "string(/domain/container/filesystem/template[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) { || (obj->stringval[0] == 0)) {
error(conn, VIR_ERR_OS_TYPE, NULL); error(conn, VIR_ERR_OS_TYPE, NULL);
goto bail_out; goto bail_out;
@ -381,9 +381,9 @@ static struct openvz_vm_def
/* Extract network */ /* Extract network */
/* Extract ipaddress */ /* Extract ipaddress */
obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/ipaddress[1])", ctxt); obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/ipaddress[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) { || (obj->stringval[0] == 0)) {
openvzLog(OPENVZ_WARN, "No IP address in the given xml config file '%s'", openvzLog(OPENVZ_WARN, "No IP address in the given xml config file '%s'",
xml->name); xml->name);
} }
if (xmlStrlen(obj->stringval) >= (OPENVZ_IP_MAX)) { if (xmlStrlen(obj->stringval) >= (OPENVZ_IP_MAX)) {
@ -405,9 +405,9 @@ static struct openvz_vm_def
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/netmask[1])", ctxt); obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/netmask[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) if ((obj == NULL) || (obj->type != XPATH_STRING)
|| (obj->stringval == NULL) || (obj->stringval[0] == 0)) || (obj->stringval == NULL) || (obj->stringval[0] == 0))
openvzLog(OPENVZ_WARN, "No Netmask address in the given xml config file '%s'", openvzLog(OPENVZ_WARN, "No Netmask address in the given xml config file '%s'",
xml->name); xml->name);
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN]; char errorMessage[OPENVZ_MAX_ERROR_LEN];
@ -420,10 +420,10 @@ static struct openvz_vm_def
/* Extract hostname */ /* Extract hostname */
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/hostname[1])", ctxt); obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/hostname[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) || (obj->stringval[0] == 0))
openvzLog(OPENVZ_WARN, "No hostname in the given xml config file '%s'", xml->name); openvzLog(OPENVZ_WARN, "No hostname in the given xml config file '%s'", xml->name);
if (strlen((const char *) obj->stringval) >= (OPENVZ_HOSTNAME_MAX - 1)) { if (strlen((const char *) obj->stringval) >= (OPENVZ_HOSTNAME_MAX - 1)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN]; char errorMessage[OPENVZ_MAX_ERROR_LEN];
@ -436,11 +436,11 @@ static struct openvz_vm_def
/* Extract gateway */ /* Extract gateway */
obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/gateway[1])", ctxt); obj = xmlXPathEval(BAD_CAST"string(/domain/container/network/gateway[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) || (obj->stringval[0] == 0))
openvzLog(OPENVZ_WARN, "No Gateway address in the given xml config file '%s'", openvzLog(OPENVZ_WARN, "No Gateway address in the given xml config file '%s'",
xml->name); xml->name);
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN]; char errorMessage[OPENVZ_MAX_ERROR_LEN];
@ -453,11 +453,11 @@ static struct openvz_vm_def
/* Extract nameserver */ /* Extract nameserver */
obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/nameserver[1])", ctxt); obj = xmlXPathEval(BAD_CAST "string(/domain/container/network/nameserver[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) || (obj->stringval[0] == 0))
openvzLog(OPENVZ_WARN, "No Nameserver address inthe given xml config file '%s'", openvzLog(OPENVZ_WARN, "No Nameserver address inthe given xml config file '%s'",
xml->name); xml->name);
if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) {
char errorMessage[OPENVZ_MAX_ERROR_LEN]; char errorMessage[OPENVZ_MAX_ERROR_LEN];
@ -475,7 +475,7 @@ static struct openvz_vm_def
/* Extract profile */ /* Extract profile */
obj = xmlXPathEval(BAD_CAST "string(/domain/container/profile[1])", ctxt); obj = xmlXPathEval(BAD_CAST "string(/domain/container/profile[1])", ctxt);
if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL)
|| (obj->stringval[0] == 0)) { || (obj->stringval[0] == 0)) {
error(conn, VIR_ERR_INTERNAL_ERROR, NULL); error(conn, VIR_ERR_INTERNAL_ERROR, NULL);
goto bail_out; goto bail_out;
@ -518,19 +518,19 @@ openvzGetVPSInfo(virConnectPtr conn) {
driver = conn->privateData; driver = conn->privateData;
driver->num_active = 0; driver->num_active = 0;
driver->num_inactive = 0; driver->num_inactive = 0;
if((fp = popen(VZLIST " -a -ovpsid,status -H 2>/dev/null", "r")) == NULL) { if((fp = popen(VZLIST " -a -ovpsid,status -H 2>/dev/null", "r")) == NULL) {
error(conn, VIR_ERR_INTERNAL_ERROR, "popen failed"); error(conn, VIR_ERR_INTERNAL_ERROR, "popen failed");
return NULL; return NULL;
} }
pnext = &vm; pnext = &vm;
while(!feof(fp)) { while(!feof(fp)) {
*pnext = calloc(1, sizeof(**pnext)); *pnext = calloc(1, sizeof(**pnext));
if(!*pnext) { if(!*pnext) {
error(conn, VIR_ERR_INTERNAL_ERROR, "calloc failed"); error(conn, VIR_ERR_INTERNAL_ERROR, "calloc failed");
goto error; goto error;
} }
if(!vm) if(!vm)
vm = *pnext; vm = *pnext;
@ -540,7 +540,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
free(*pnext); free(*pnext);
goto error; goto error;
} }
if(strcmp(status, "stopped")) { if(strcmp(status, "stopped")) {
(*pnext)->status = VIR_DOMAIN_RUNNING; (*pnext)->status = VIR_DOMAIN_RUNNING;
driver->num_active ++; driver->num_active ++;
(*pnext)->vpsid = veid; (*pnext)->vpsid = veid;
@ -552,7 +552,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
* inactive domains don't have their ID set in libvirt, * inactive domains don't have their ID set in libvirt,
* thought this doesn't make sense for OpenVZ * thought this doesn't make sense for OpenVZ
*/ */
(*pnext)->vpsid = -1; (*pnext)->vpsid = -1;
} }
vmdef = calloc(1, sizeof(*vmdef)); vmdef = calloc(1, sizeof(*vmdef));
@ -561,7 +561,7 @@ openvzGetVPSInfo(virConnectPtr conn) {
free(*pnext); free(*pnext);
goto error; goto error;
} }
snprintf(vmdef->name, OPENVZ_NAME_MAX, "%i", veid); snprintf(vmdef->name, OPENVZ_NAME_MAX, "%i", veid);
openvzGetVPSUUID(veid, uuidstr); openvzGetVPSUUID(veid, uuidstr);
ret = virUUIDParse(uuidstr, vmdef->uuid); ret = virUUIDParse(uuidstr, vmdef->uuid);
@ -590,7 +590,7 @@ error:
return NULL; return NULL;
} }
static char static char
*openvzLocateConfDir(void) *openvzLocateConfDir(void)
{ {
const char *conf_dir_list[] = {"/etc/vz/conf", "/usr/local/etc/conf", NULL}; const char *conf_dir_list[] = {"/etc/vz/conf", "/usr/local/etc/conf", NULL};
@ -606,7 +606,7 @@ static char
} }
/* Richard Steven's classic readline() function */ /* Richard Steven's classic readline() function */
int int
openvz_readline(int fd, char *ptr, int maxlen) openvz_readline(int fd, char *ptr, int maxlen)
{ {
int n, rc; int n, rc;
@ -631,7 +631,7 @@ openvz_readline(int fd, char *ptr, int maxlen)
return n; return n;
} }
static int static int
openvzGetVPSUUID(int vpsid, char *uuidstr) openvzGetVPSUUID(int vpsid, char *uuidstr)
{ {
char conf_file[PATH_MAX]; char conf_file[PATH_MAX];
@ -672,7 +672,7 @@ openvzGetVPSUUID(int vpsid, char *uuidstr)
* assign if not present. * assign if not present.
*/ */
static int static int
openvzSetUUID(int vpsid) openvzSetUUID(int vpsid)
{ {
char conf_file[PATH_MAX]; char conf_file[PATH_MAX];

View File

@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Authors: * Authors:
* Shuveb Hussain <shuveb@binarykarma.com> * Shuveb Hussain <shuveb@binarykarma.com>
* Anoop Joe Cyriac <anoop@binarykarma.com> * Anoop Joe Cyriac <anoop@binarykarma.com>
* *
@ -111,8 +111,8 @@ openvzIsActiveVM(struct openvz_vm *vm)
} }
int openvz_readline(int fd, char *ptr, int maxlen); int openvz_readline(int fd, char *ptr, int maxlen);
struct openvz_vm *openvzFindVMByID(const struct openvz_driver *driver, int id); struct openvz_vm *openvzFindVMByID(const struct openvz_driver *driver, int id);
struct openvz_vm *openvzFindVMByUUID(const struct openvz_driver *driver, struct openvz_vm *openvzFindVMByUUID(const struct openvz_driver *driver,
const unsigned char *uuid); const unsigned char *uuid);
struct openvz_vm *openvzFindVMByName(const struct openvz_driver *driver, const char *name); struct openvz_vm *openvzFindVMByName(const struct openvz_driver *driver, const char *name);

View File

@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Authors: * Authors:
* Shuveb Hussain <shuveb@binarykarma.com> * Shuveb Hussain <shuveb@binarykarma.com>
* Anoop Joe Cyriac <anoop@binarykarma.com> * Anoop Joe Cyriac <anoop@binarykarma.com>
* *
@ -88,7 +88,7 @@ static int openvzReload(void);
static int openvzActive(void); static int openvzActive(void);
static virDomainPtr openvzDomainDefineXML(virConnectPtr conn, const char *xml); static virDomainPtr openvzDomainDefineXML(virConnectPtr conn, const char *xml);
static virDomainPtr openvzDomainCreateLinux(virConnectPtr conn, const char *xml, static virDomainPtr openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
unsigned int flags ATTRIBUTE_UNUSED); unsigned int flags ATTRIBUTE_UNUSED);
static int openvzDomainUndefine(virDomainPtr dom); static int openvzDomainUndefine(virDomainPtr dom);
@ -222,7 +222,7 @@ static int openvzDomainGetInfo(virDomainPtr dom,
info->state = vm->status; info->state = vm->status;
/* TODO These need to be calculated differently for OpenVZ */ /* TODO These need to be calculated differently for OpenVZ */
//info->cpuTime = //info->cpuTime =
//info->maxMem = vm->def->maxmem; //info->maxMem = vm->def->maxmem;
//info->memory = vm->def->memory; //info->memory = vm->def->memory;
//info->nrVirtCpu = vm->def->vcpus; //info->nrVirtCpu = vm->def->vcpus;
@ -241,30 +241,30 @@ static int openvzDomainShutdown(virDomainPtr dom) {
error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id"); error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
return -1; return -1;
} }
if (vm->status != VIR_DOMAIN_RUNNING) { if (vm->status != VIR_DOMAIN_RUNNING) {
error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state"); error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state");
return -1; return -1;
} }
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " stop %d ", dom->id); snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " stop %d ", dom->id);
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out; goto bail_out;
} }
ret = virExec(dom->conn, (char **)cmdExec, &pid, -1, &outfd, &errfd); ret = virExec(dom->conn, (char **)cmdExec, &pid, -1, &outfd, &errfd);
if(ret == -1) { if(ret == -1) {
error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return -1; return -1;
} }
vm->vpsid = -1; vm->vpsid = -1;
vm->status = VIR_DOMAIN_SHUTOFF; vm->status = VIR_DOMAIN_SHUTOFF;
ovz_driver.num_inactive ++; ovz_driver.num_inactive ++;
ovz_driver.num_active --; ovz_driver.num_active --;
bail_out: bail_out:
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
@ -284,14 +284,14 @@ static int openvzDomainReboot(virDomainPtr dom,
error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id"); error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
return -1; return -1;
} }
if (vm->status != VIR_DOMAIN_RUNNING) { if (vm->status != VIR_DOMAIN_RUNNING) {
error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state"); error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in running state");
return -1; return -1;
} }
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " restart %d ", dom->id); snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " restart %d ", dom->id);
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out1; goto bail_out1;
@ -301,10 +301,10 @@ static int openvzDomainReboot(virDomainPtr dom,
error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return -1; return -1;
} }
bail_out1: bail_out1:
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
return ret; return ret;
} }
@ -323,7 +323,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
vm = openvzFindVMByID(driver, strtoI(vmdef->name)); vm = openvzFindVMByID(driver, strtoI(vmdef->name));
if (vm) { if (vm) {
openvzLog(OPENVZ_ERR, "Already an OPENVZ VM active with the id '%s'", openvzLog(OPENVZ_ERR, "Already an OPENVZ VM active with the id '%s'",
vmdef->name); vmdef->name);
goto bail_out2; goto bail_out2;
} }
@ -350,7 +350,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
strcat(cmdbuf, cmdOption); strcat(cmdbuf, cmdOption);
} }
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out2; goto bail_out2;
@ -360,10 +360,10 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
goto bail_out2; goto bail_out2;
} }
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
dom = virGetDomain(conn, vm->vmdef->name, vm->vmdef->uuid); dom = virGetDomain(conn, vm->vmdef->name, vm->vmdef->uuid);
if (dom) if (dom)
dom->id = vm->vpsid; dom->id = vm->vpsid;
@ -390,7 +390,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
vm = openvzFindVMByID(driver, strtoI(vmdef->name)); vm = openvzFindVMByID(driver, strtoI(vmdef->name));
if (vm) { if (vm) {
openvzFreeVMDef(vmdef); openvzFreeVMDef(vmdef);
openvzLog(OPENVZ_ERR, "Already an OPENVZ VM defined with the id '%d'", openvzLog(OPENVZ_ERR, "Already an OPENVZ VM defined with the id '%d'",
strtoI(vmdef->name)); strtoI(vmdef->name));
return NULL; return NULL;
} }
@ -417,7 +417,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
strcat(cmdbuf, cmdOption); strcat(cmdbuf, cmdOption);
} }
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out3; goto bail_out3;
@ -427,13 +427,13 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return NULL; return NULL;
} }
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " start %s ", vmdef->name); snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " start %s ", vmdef->name);
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out3; goto bail_out3;
@ -443,7 +443,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return NULL; return NULL;
} }
sscanf(vmdef->name, "%d", &vm->vpsid); sscanf(vmdef->name, "%d", &vm->vpsid);
vm->status = VIR_DOMAIN_RUNNING; vm->status = VIR_DOMAIN_RUNNING;
ovz_driver.num_inactive--; ovz_driver.num_inactive--;
@ -457,7 +457,7 @@ openvzDomainCreateLinux(virConnectPtr conn, const char *xml,
dom->id = vm->vpsid; dom->id = vm->vpsid;
return dom; return dom;
bail_out3: bail_out3:
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
return NULL; return NULL;
} }
@ -476,7 +476,7 @@ openvzDomainCreate(virDomainPtr dom)
error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id"); error(dom->conn, VIR_ERR_INVALID_DOMAIN, "no domain with matching id");
return -1; return -1;
} }
if (vm->status != VIR_DOMAIN_SHUTOFF) { if (vm->status != VIR_DOMAIN_SHUTOFF) {
error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in shutoff state"); error(dom->conn, VIR_ERR_OPERATION_DENIED, "domain is not in shutoff state");
return -1; return -1;
@ -484,8 +484,8 @@ openvzDomainCreate(virDomainPtr dom)
vmdef = vm->vmdef; vmdef = vm->vmdef;
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " start %s ", vmdef->name); snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " start %s ", vmdef->name);
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out4; goto bail_out4;
@ -495,14 +495,14 @@ openvzDomainCreate(virDomainPtr dom)
error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(dom->conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return -1; return -1;
} }
sscanf(vmdef->name, "%d", &vm->vpsid); sscanf(vmdef->name, "%d", &vm->vpsid);
vm->status = VIR_DOMAIN_RUNNING; vm->status = VIR_DOMAIN_RUNNING;
ovz_driver.num_inactive --; ovz_driver.num_inactive --;
ovz_driver.num_active ++; ovz_driver.num_active ++;
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
bail_out4: bail_out4:
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
return ret; return ret;
@ -527,8 +527,8 @@ openvzDomainUndefine(virDomainPtr dom)
return -1; return -1;
} }
snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " destroy %s ", vm->vmdef->name); snprintf(cmdbuf, CMDBUF_LEN - 1, VZCTL " destroy %s ", vm->vmdef->name);
if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1) if((ret = convCmdbufExec(cmdbuf, cmdExec)) == -1)
{ {
openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ"); openvzLog(OPENVZ_ERR, "Error in parsing Options to OPENVZ");
goto bail_out5; goto bail_out5;
@ -538,10 +538,10 @@ openvzDomainUndefine(virDomainPtr dom)
error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST); error(conn, VIR_ERR_INTERNAL_ERROR, "Could not exec " VZLIST);
return -1; return -1;
} }
waitpid(pid, NULL, 0); waitpid(pid, NULL, 0);
openvzRemoveInactiveVM(driver, vm); openvzRemoveInactiveVM(driver, vm);
bail_out5: bail_out5:
cmdExecFree(cmdExec); cmdExecFree(cmdExec);
return ret; return ret;
} }
@ -580,7 +580,7 @@ static virDrvOpenStatus openvzOpen(virConnectPtr conn,
}; };
static int openvzClose(virConnectPtr conn) { static int openvzClose(virConnectPtr conn) {
struct openvz_driver *driver = (struct openvz_driver *)conn->privateData; struct openvz_driver *driver = (struct openvz_driver *)conn->privateData;
struct openvz_vm *vm = driver->vms; struct openvz_vm *vm = driver->vms;
@ -594,7 +594,7 @@ static int openvzClose(virConnectPtr conn) {
vm = vm->next; vm = vm->next;
free(prev); free(prev);
} }
conn->privateData = NULL; conn->privateData = NULL;
return 0; return 0;
@ -666,12 +666,12 @@ static int openvzListDefinedDomains(virConnectPtr conn,
} }
static int openvzNumDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED) { static int openvzNumDefinedDomains(virConnectPtr conn ATTRIBUTE_UNUSED) {
return ovz_driver.num_inactive; return ovz_driver.num_inactive;
} }
static int openvzStartup(void) { static int openvzStartup(void) {
openvzAssignUUIDs(); openvzAssignUUIDs();
return 0; return 0;
} }

View File

@ -19,7 +19,7 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* Authors: * Authors:
* Shuveb Hussain <shuveb@binarykarma.com> * Shuveb Hussain <shuveb@binarykarma.com>
* Anoop Joe Cyriac <anoop@binarykarma.com> * Anoop Joe Cyriac <anoop@binarykarma.com>
* *

View File

@ -132,7 +132,7 @@ virProxyError(virConnectPtr conn, virErrorNumber error, const char *info)
* virProxyFindServerPath: * virProxyFindServerPath:
* *
* Tries to find the path to the gam_server binary. * Tries to find the path to the gam_server binary.
* *
* Returns path on success or NULL in case of error. * Returns path on success or NULL in case of error.
*/ */
static const char * static const char *
@ -241,7 +241,7 @@ retry:
} }
/* /*
* Abstract socket do not hit the filesystem, way more secure and * Abstract socket do not hit the filesystem, way more secure and
* garanteed to be atomic * garanteed to be atomic
*/ */
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
@ -295,7 +295,7 @@ virProxyCloseClientSocket(int fd) {
/** /**
* virProxyReadClientSocket: * virProxyReadClientSocket:
* @fd: the socket * @fd: the socket
* @buffer: the target memory area * @buffer: the target memory area
* @len: the lenght in bytes * @len: the lenght in bytes
* @quiet: quiet access * @quiet: quiet access
@ -332,7 +332,7 @@ retry:
/** /**
* virProxyWriteClientSocket: * virProxyWriteClientSocket:
* @fd: the socket * @fd: the socket
* @data: the data * @data: the data
* @len: the lenght of data in bytes * @len: the lenght of data in bytes
* *
@ -402,7 +402,7 @@ xenProxyClose(virConnectPtr conn)
return 0; return 0;
} }
static int static int
xenProxyCommand(virConnectPtr conn, virProxyPacketPtr request, xenProxyCommand(virConnectPtr conn, virProxyPacketPtr request,
virProxyFullPacketPtr answer, int quiet) { virProxyFullPacketPtr answer, int quiet) {
static int serial = 0; static int serial = 0;
@ -533,7 +533,7 @@ xenProxyOpen(virConnectPtr conn,
int ret; int ret;
int fd; int fd;
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if (!(flags & VIR_CONNECT_RO)) if (!(flags & VIR_CONNECT_RO))
return(-1); return(-1);
@ -922,7 +922,7 @@ xenProxyLookupByName(virConnectPtr conn, const char *name)
* xenProxyNodeGetInfo: * xenProxyNodeGetInfo:
* @conn: pointer to the Xen Daemon block * @conn: pointer to the Xen Daemon block
* @info: pointer to a virNodeInfo structure allocated by the user * @info: pointer to a virNodeInfo structure allocated by the user
* *
* Extract hardware information about the node. * Extract hardware information about the node.
* *
* Returns 0 in case of success and -1 in case of failure. * Returns 0 in case of success and -1 in case of failure.
@ -963,7 +963,7 @@ xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) {
/** /**
* xenProxyGetCapabilities: * xenProxyGetCapabilities:
* @conn: pointer to the Xen Daemon block * @conn: pointer to the Xen Daemon block
* *
* Extract capabilities of the hypervisor. * Extract capabilities of the hypervisor.
* *
* Returns capabilities in case of success (freed by caller) * Returns capabilities in case of success (freed by caller)
@ -1016,7 +1016,7 @@ xenProxyGetCapabilities (virConnectPtr conn)
* *
* This method generates an XML description of a domain. * This method generates an XML description of a domain.
* *
* Returns the XML document on success, NULL otherwise. * Returns the XML document on success, NULL otherwise.
*/ */
char * char *
xenProxyDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) xenProxyDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED)

View File

@ -60,7 +60,7 @@ typedef struct _virProxyPacket virProxyPacket;
typedef virProxyPacket *virProxyPacketPtr; typedef virProxyPacket *virProxyPacketPtr;
/* /*
* If there is extra data sent from the proxy to the client, * If there is extra data sent from the proxy to the client,
* they are appended after the packet. * they are appended after the packet.
* the size may not be fixed, it's passed as len and includes the * the size may not be fixed, it's passed as len and includes the
* extra data. * extra data.

View File

@ -38,11 +38,11 @@
# The default TLS configuration only uses certificates for the server # The default TLS configuration only uses certificates for the server
# allowing the client to verify the server's identity and establish # allowing the client to verify the server's identity and establish
# and encrypted channel. # and encrypted channel.
# #
# It is possible to use x509 certificates for authentication too, by # It is possible to use x509 certificates for authentication too, by
# issuing a x509 certificate to every client who needs to connect. # issuing a x509 certificate to every client who needs to connect.
# #
# Enabling this option will reject any client who does not have a # Enabling this option will reject any client who does not have a
# certificate signed by the CA in /etc/pki/libvirt-vnc/ca-cert.pem # certificate signed by the CA in /etc/pki/libvirt-vnc/ca-cert.pem
# #

View File

@ -260,7 +260,7 @@ static const struct qemu_feature_flags const arch_info_x86_64_flags [] = {
}; };
/* The archicture tables for supported QEMU archs */ /* The archicture tables for supported QEMU archs */
const struct qemu_arch_info const qemudArchs[] = { const struct qemu_arch_info const qemudArchs[] = {
/* i686 must be in position 0 */ /* i686 must be in position 0 */
{ "i686", 32, arch_info_x86_machines, "qemu", arch_info_i686_flags }, { "i686", 32, arch_info_x86_machines, "qemu", arch_info_i686_flags },
/* x86_64 must be in position 1 */ /* x86_64 must be in position 1 */
@ -483,13 +483,13 @@ static int qemudParseDiskXML(virConnectPtr conn,
} }
device = xmlGetProp(node, BAD_CAST "device"); device = xmlGetProp(node, BAD_CAST "device");
cur = node->children; cur = node->children;
while (cur != NULL) { while (cur != NULL) {
if (cur->type == XML_ELEMENT_NODE) { if (cur->type == XML_ELEMENT_NODE) {
if ((source == NULL) && if ((source == NULL) &&
(xmlStrEqual(cur->name, BAD_CAST "source"))) { (xmlStrEqual(cur->name, BAD_CAST "source"))) {
if (typ == QEMUD_DISK_FILE) if (typ == QEMUD_DISK_FILE)
source = xmlGetProp(cur, BAD_CAST "file"); source = xmlGetProp(cur, BAD_CAST "file");
else else
@ -520,7 +520,7 @@ static int qemudParseDiskXML(virConnectPtr conn,
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "Invalid floppy device name: %s", target); qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "Invalid floppy device name: %s", target);
goto error; goto error;
} }
if (device && if (device &&
!strcmp((const char *)device, "cdrom") && !strcmp((const char *)device, "cdrom") &&
strcmp((const char *)target, "hdc")) { strcmp((const char *)target, "hdc")) {
@ -2642,7 +2642,7 @@ int qemudScanConfigDir(struct qemud_driver *driver,
} }
closedir(dir); closedir(dir);
return 0; return 0;
} }

View File

@ -298,7 +298,7 @@ qemudShutdown(void) {
qemudRemoveInactiveVM(qemu_driver, vm); qemudRemoveInactiveVM(qemu_driver, vm);
vm = next; vm = next;
} }
/* free inactive VMs */ /* free inactive VMs */
vm = qemu_driver->vms; vm = qemu_driver->vms;
while (vm) { while (vm) {
@ -318,7 +318,7 @@ qemudShutdown(void) {
qemudShutdownNetworkDaemon(NULL, qemu_driver, network); qemudShutdownNetworkDaemon(NULL, qemu_driver, network);
network = next; network = next;
} }
/* free inactive networks */ /* free inactive networks */
network = qemu_driver->networks; network = qemu_driver->networks;
while (network) { while (network) {
@ -1406,7 +1406,7 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
} else { /* root */ } else { /* root */
if (STRNEQ (uri->path, "/system") && if (STRNEQ (uri->path, "/system") &&
STRNEQ (uri->path, "/session")) STRNEQ (uri->path, "/session"))
goto decline; goto decline;
} }
conn->privateData = qemu_driver; conn->privateData = qemu_driver;
@ -1414,7 +1414,7 @@ static virDrvOpenStatus qemudOpen(virConnectPtr conn,
return VIR_DRV_OPEN_SUCCESS; return VIR_DRV_OPEN_SUCCESS;
decline: decline:
return VIR_DRV_OPEN_DECLINED; return VIR_DRV_OPEN_DECLINED;
} }
static int qemudClose(virConnectPtr conn) { static int qemudClose(virConnectPtr conn) {
@ -2166,7 +2166,7 @@ static int qemudDomainRestore(virConnectPtr conn,
if (header.version > QEMUD_SAVE_VERSION) { if (header.version > QEMUD_SAVE_VERSION) {
qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED, qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
"image version is not supported (%d > %d)", "image version is not supported (%d > %d)",
header.version, QEMUD_SAVE_VERSION); header.version, QEMUD_SAVE_VERSION);
close(fd); close(fd);
return -1; return -1;

View File

@ -166,7 +166,7 @@ remoteStartup(void)
* remoteFindServerPath: * remoteFindServerPath:
* *
* Tries to find the path to the libvirtd binary. * Tries to find the path to the libvirtd binary.
* *
* Returns path on success or NULL in case of error. * Returns path on success or NULL in case of error.
*/ */
static const char * static const char *
@ -544,12 +544,12 @@ doRemoteOpen (virConnectPtr conn,
if (flags & VIR_DRV_OPEN_REMOTE_USER) { if (flags & VIR_DRV_OPEN_REMOTE_USER) {
struct passwd *pw; struct passwd *pw;
uid_t uid = getuid(); uid_t uid = getuid();
if (!(pw = getpwuid(uid))) { if (!(pw = getpwuid(uid))) {
error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno)); error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno));
goto failed; goto failed;
} }
if (asprintf (&sockname, "@%s" LIBVIRTD_USER_UNIX_SOCKET, pw->pw_dir) < 0) { if (asprintf (&sockname, "@%s" LIBVIRTD_USER_UNIX_SOCKET, pw->pw_dir) < 0) {
error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno)); error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno));
goto failed; goto failed;
@ -932,7 +932,7 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
int err; int err;
gnutls_session_t session; gnutls_session_t session;
/* Initialize TLS session /* Initialize TLS session
*/ */
err = gnutls_init (&session, GNUTLS_CLIENT); err = gnutls_init (&session, GNUTLS_CLIENT);
if (err) { if (err) {
@ -1023,7 +1023,7 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret)); error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret));
return -1; return -1;
} }
if ((now = time(NULL)) == ((time_t)-1)) { if ((now = time(NULL)) == ((time_t)-1)) {
error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno)); error (conn, VIR_ERR_SYSTEM_ERROR, strerror (errno));
return -1; return -1;
@ -1034,10 +1034,10 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
if (status & GNUTLS_CERT_INVALID) if (status & GNUTLS_CERT_INVALID)
reason = "The certificate is not trusted."; reason = "The certificate is not trusted.";
if (status & GNUTLS_CERT_SIGNER_NOT_FOUND) if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
reason = "The certificate hasn't got a known issuer."; reason = "The certificate hasn't got a known issuer.";
if (status & GNUTLS_CERT_REVOKED) if (status & GNUTLS_CERT_REVOKED)
reason = "The certificate has been revoked."; reason = "The certificate has been revoked.";
@ -1045,7 +1045,7 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
if (status & GNUTLS_CERT_INSECURE_ALGORITHM) if (status & GNUTLS_CERT_INSECURE_ALGORITHM)
reason = "The certificate uses an insecure algorithm"; reason = "The certificate uses an insecure algorithm";
#endif #endif
error (conn, VIR_ERR_RPC, reason); error (conn, VIR_ERR_RPC, reason);
return -1; return -1;
} }
@ -1054,12 +1054,12 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
error (conn, VIR_ERR_RPC, _("Certificate type is not X.509")); error (conn, VIR_ERR_RPC, _("Certificate type is not X.509"));
return -1; return -1;
} }
if (!(certs = gnutls_certificate_get_peers(session, &nCerts))) { if (!(certs = gnutls_certificate_get_peers(session, &nCerts))) {
error (conn, VIR_ERR_RPC, _("gnutls_certificate_get_peers failed")); error (conn, VIR_ERR_RPC, _("gnutls_certificate_get_peers failed"));
return -1; return -1;
} }
for (i = 0 ; i < nCerts ; i++) { for (i = 0 ; i < nCerts ; i++) {
gnutls_x509_crt_t cert; gnutls_x509_crt_t cert;
@ -1068,26 +1068,26 @@ verify_certificate (virConnectPtr conn ATTRIBUTE_UNUSED,
error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret)); error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret));
return -1; return -1;
} }
ret = gnutls_x509_crt_import (cert, &certs[i], GNUTLS_X509_FMT_DER); ret = gnutls_x509_crt_import (cert, &certs[i], GNUTLS_X509_FMT_DER);
if (ret < 0) { if (ret < 0) {
error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret)); error (conn, VIR_ERR_GNUTLS_ERROR, gnutls_strerror (ret));
gnutls_x509_crt_deinit (cert); gnutls_x509_crt_deinit (cert);
return -1; return -1;
} }
if (gnutls_x509_crt_get_expiration_time (cert) < now) { if (gnutls_x509_crt_get_expiration_time (cert) < now) {
error (conn, VIR_ERR_RPC, _("The certificate has expired")); error (conn, VIR_ERR_RPC, _("The certificate has expired"));
gnutls_x509_crt_deinit (cert); gnutls_x509_crt_deinit (cert);
return -1; return -1;
} }
if (gnutls_x509_crt_get_activation_time (cert) > now) { if (gnutls_x509_crt_get_activation_time (cert) > now) {
error (conn, VIR_ERR_RPC, _("The certificate is not yet activated")); error (conn, VIR_ERR_RPC, _("The certificate is not yet activated"));
gnutls_x509_crt_deinit (cert); gnutls_x509_crt_deinit (cert);
return -1; return -1;
} }
if (i == 0) { if (i == 0) {
if (!gnutls_x509_crt_check_hostname (cert, priv->hostname)) { if (!gnutls_x509_crt_check_hostname (cert, priv->hostname)) {
__virRaiseError __virRaiseError

View File

@ -501,7 +501,7 @@ sexpr_lookup(const struct sexpr *sexpr, const char *node)
* NB, even if the key was found sexpr_lookup may return NULL if * NB, even if the key was found sexpr_lookup may return NULL if
* the corresponding value was empty * the corresponding value was empty
* *
* Returns true if the key was found, false otherwise * Returns true if the key was found, false otherwise
*/ */
int int
sexpr_has(struct sexpr *sexpr, const char *node) sexpr_has(struct sexpr *sexpr, const char *node)

View File

@ -50,7 +50,7 @@
#define virLog(msg...) fprintf(stderr, msg) #define virLog(msg...) fprintf(stderr, msg)
static void static void
ReportError(virConnectPtr conn, ReportError(virConnectPtr conn,
virDomainPtr dom, virDomainPtr dom,
virNetworkPtr net, virNetworkPtr net,
@ -124,11 +124,11 @@ _virExec(virConnectPtr conn,
close(pipeout[1]); close(pipeout[1]);
if(non_block) if(non_block)
if(virSetNonBlock(pipeout[0]) == -1) if(virSetNonBlock(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set non-blocking file descriptor flag"); "Failed to set non-blocking file descriptor flag");
if(virSetCloseExec(pipeout[0]) == -1) if(virSetCloseExec(pipeout[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set close-on-exec file descriptor flag"); "Failed to set close-on-exec file descriptor flag");
*outfd = pipeout[0]; *outfd = pipeout[0];
} }
@ -136,11 +136,11 @@ _virExec(virConnectPtr conn,
close(pipeerr[1]); close(pipeerr[1]);
if(non_block) if(non_block)
if(virSetNonBlock(pipeerr[0]) == -1) if(virSetNonBlock(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set non-blocking file descriptor flag"); "Failed to set non-blocking file descriptor flag");
if(virSetCloseExec(pipeerr[0]) == -1) if(virSetCloseExec(pipeerr[0]) == -1)
ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, ReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
"Failed to set close-on-exec file descriptor flag"); "Failed to set close-on-exec file descriptor flag");
*errfd = pipeerr[0]; *errfd = pipeerr[0];
} }
@ -280,7 +280,7 @@ virExecNonBlock(virConnectPtr conn,
int saferead(int fd, void *buf, size_t count) int saferead(int fd, void *buf, size_t count)
{ {
size_t nread = 0; size_t nread = 0;
while (count > 0) { while (count > 0) {
int r = read(fd, buf, count); int r = read(fd, buf, count);
if (r < 0 && errno == EINTR) if (r < 0 && errno == EINTR)
continue; continue;

View File

@ -1136,7 +1136,7 @@ cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
strncpy(params[inputparams].field,str_weight,sizeof(str_weight)); strncpy(params[inputparams].field,str_weight,sizeof(str_weight));
params[inputparams].type = VIR_DOMAIN_SCHED_FIELD_UINT; params[inputparams].type = VIR_DOMAIN_SCHED_FIELD_UINT;
params[inputparams].value.ui = weight; params[inputparams].value.ui = weight;
inputparams++; inputparams++;
} }
if (capfound) { if (capfound) {

View File

@ -101,7 +101,7 @@ virCopyLastError(virErrorPtr to)
/** /**
* virResetError: * virResetError:
* @err: pointer to the virError to clean up * @err: pointer to the virError to clean up
* *
* Reset the error being pointed to * Reset the error being pointed to
*/ */
void void
@ -118,7 +118,7 @@ virResetError(virErrorPtr err)
/** /**
* virResetLastError: * virResetLastError:
* *
* Reset the last error caught at the library level. * Reset the last error caught at the library level.
*/ */
void void

View File

@ -1355,7 +1355,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain,
return -1; return -1;
} }
} }
return 0; return 0;
} }
@ -1658,7 +1658,7 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
if (maplen < 8) { if (maplen < 8) {
new = calloc(1, sizeof(uint64_t)); new = calloc(1, sizeof(uint64_t));
if (!new) { if (!new) {
virXenErrorFunc(NULL, VIR_ERR_NO_MEMORY, __FUNCTION__, virXenErrorFunc(NULL, VIR_ERR_NO_MEMORY, __FUNCTION__,
"allocating private data", 0); "allocating private data", 0);
return (-1); return (-1);
} }
@ -2764,7 +2764,7 @@ xenHypervisorGetDomMaxMemory(virConnectPtr conn, int id)
if (kb_per_pages == 0) { if (kb_per_pages == 0) {
kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
if (kb_per_pages <= 0) if (kb_per_pages <= 0)
kb_per_pages = 4; kb_per_pages = 4;
} }
@ -2825,7 +2825,7 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info)
if (kb_per_pages == 0) { if (kb_per_pages == 0) {
kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
if (kb_per_pages <= 0) if (kb_per_pages <= 0)
kb_per_pages = 4; kb_per_pages = 4;
} }
@ -2920,15 +2920,15 @@ xenHypervisorGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info)
* xenHypervisorNodeGetCellsFreeMemory: * xenHypervisorNodeGetCellsFreeMemory:
* @conn: pointer to the hypervisor connection * @conn: pointer to the hypervisor connection
* @freeMems: pointer to the array of unsigned long long * @freeMems: pointer to the array of unsigned long long
* @startCell: index of first cell to return freeMems info on. * @startCell: index of first cell to return freeMems info on.
* @maxCells: Maximum number of cells for which freeMems information can * @maxCells: Maximum number of cells for which freeMems information can
* be returned. * be returned.
* *
* This call returns the amount of free memory in one or more NUMA cells. * This call returns the amount of free memory in one or more NUMA cells.
* The @freeMems array must be allocated by the caller and will be filled * The @freeMems array must be allocated by the caller and will be filled
* with the amount of free memory in kilobytes for each cell requested, * with the amount of free memory in kilobytes for each cell requested,
* starting with startCell (in freeMems[0]), up to either * starting with startCell (in freeMems[0]), up to either
* (startCell + maxCells), or the number of additional cells in the node, * (startCell + maxCells), or the number of additional cells in the node,
* whichever is smaller. * whichever is smaller.
* *
* Returns the number of entries filled in freeMems, or -1 in case of error. * Returns the number of entries filled in freeMems, or -1 in case of error.
@ -2941,7 +2941,7 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *free
int i, j, ret; int i, j, ret;
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
int nbNodeCells; int nbNodeCells;
if (conn == NULL) { if (conn == NULL) {
virXenErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__, virXenErrorFunc (conn, VIR_ERR_INVALID_ARG, __FUNCTION__,
"invalid argument", 0); "invalid argument", 0);

View File

@ -80,8 +80,8 @@ xenUnifiedError (virConnectPtr conn, virErrorNumber error, const char *info)
/* /*
* Helper functions currently used in the NUMA code * Helper functions currently used in the NUMA code
* Those variables should not be accessed directly but through helper * Those variables should not be accessed directly but through helper
* functions xenNbCells() and xenNbCpu() available to all Xen backends * functions xenNbCells() and xenNbCpu() available to all Xen backends
*/ */
static int nbNodeCells = -1; static int nbNodeCells = -1;
static int nbNodeCpus = -1; static int nbNodeCpus = -1;
@ -190,9 +190,9 @@ xenDomainUsedCpus(virDomainPtr dom)
cpulist[m] = 1; cpulist[m] = 1;
nb++; nb++;
/* if all CPU are used just return NULL */ /* if all CPU are used just return NULL */
if (nb == nb_cpu) if (nb == nb_cpu)
goto done; goto done;
} }
} }
} }
@ -914,7 +914,7 @@ xenUnifiedDomainDumpXML (virDomainPtr dom, int flags)
} }
if (priv->opened[XEN_UNIFIED_PROXY_OFFSET]) if (priv->opened[XEN_UNIFIED_PROXY_OFFSET])
return xenProxyDomainDumpXML(dom, flags); return xenProxyDomainDumpXML(dom, flags);
} }
xenUnifiedError (dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__); xenUnifiedError (dom->conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
return NULL; return NULL;
@ -1087,7 +1087,7 @@ xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams)
if (priv->opened[i] && drivers[i]->domainGetSchedulerType) { if (priv->opened[i] && drivers[i]->domainGetSchedulerType) {
schedulertype = drivers[i]->domainGetSchedulerType (dom, nparams); schedulertype = drivers[i]->domainGetSchedulerType (dom, nparams);
if (schedulertype != NULL) if (schedulertype != NULL)
return(schedulertype); return(schedulertype);
} }
} }
return(NULL); return(NULL);
@ -1161,7 +1161,7 @@ xenUnifiedNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long long *freeMe
GET_PRIVATE (conn); GET_PRIVATE (conn);
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET])
return xenHypervisorNodeGetCellsFreeMemory (conn, freeMems, return xenHypervisorNodeGetCellsFreeMemory (conn, freeMems,
startCell, maxCells); startCell, maxCells);
xenUnifiedError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__); xenUnifiedError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__);
@ -1176,7 +1176,7 @@ xenUnifiedNodeGetFreeMemory (virConnectPtr conn)
GET_PRIVATE (conn); GET_PRIVATE (conn);
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) {
ret = xenHypervisorNodeGetCellsFreeMemory (conn, &freeMem, ret = xenHypervisorNodeGetCellsFreeMemory (conn, &freeMem,
-1, 1); -1, 1);
if (ret != 1) if (ret != 1)
return (0); return (0);

View File

@ -883,7 +883,7 @@ xenDaemonOpen_unix(virConnectPtr conn, const char *path)
* xenDaemonOpen_tcp: * xenDaemonOpen_tcp:
* @conn: an existing virtual connection block * @conn: an existing virtual connection block
* @host: the host name for the Xen Daemon * @host: the host name for the Xen Daemon
* @port: the port * @port: the port
* *
* Creates a possibly remote Xen Daemon connection * Creates a possibly remote Xen Daemon connection
* Note: this doesn't try to check if the connection actually works * Note: this doesn't try to check if the connection actually works
@ -1160,9 +1160,9 @@ xend_detect_config_version(virConnectPtr conn) {
root = sexpr_get(conn, "/xend/node/"); root = sexpr_get(conn, "/xend/node/");
if (root == NULL) if (root == NULL)
return (-1); return (-1);
value = sexpr_node(root, "node/xend_config_format"); value = sexpr_node(root, "node/xend_config_format");
if (value) { if (value) {
priv->xendConfigVersion = strtol(value, NULL, 10); priv->xendConfigVersion = strtol(value, NULL, 10);
} else { } else {
@ -1270,7 +1270,7 @@ xend_log(virConnectPtr xend, char *buffer, size_t n_buffer)
* @xend: the xend connection object * @xend: the xend connection object
* @node: the root of the parsed S-Expression * @node: the root of the parsed S-Expression
* @buf: output buffer object * @buf: output buffer object
* @hvm: true or 1 if no contains HVM S-Expression * @hvm: true or 1 if no contains HVM S-Expression
* @bootloader: true or 1 if a bootloader is defined * @bootloader: true or 1 if a bootloader is defined
* *
* Parse the xend sexp for description of os and append it to buf. * Parse the xend sexp for description of os and append it to buf.
@ -1289,7 +1289,7 @@ xend_parse_sexp_desc_os(virConnectPtr xend, struct sexpr *node, virBufferPtr buf
if (node == NULL || buf == NULL) { if (node == NULL || buf == NULL) {
return(-1); return(-1);
} }
virBufferAddLit(buf, " <os>\n"); virBufferAddLit(buf, " <os>\n");
if (hvm) if (hvm)
virBufferAddLit(buf, " <type>hvm</type>\n"); virBufferAddLit(buf, " <type>hvm</type>\n");
@ -1466,7 +1466,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
if ((cur_mem >= MIN_XEN_GUEST_SIZE) && (cur_mem != max_mem)) if ((cur_mem >= MIN_XEN_GUEST_SIZE) && (cur_mem != max_mem))
virBufferVSprintf(&buf, " <currentMemory>%d</currentMemory>\n", virBufferVSprintf(&buf, " <currentMemory>%d</currentMemory>\n",
cur_mem); cur_mem);
virBufferVSprintf(&buf, " <vcpu"); virBufferVSprintf(&buf, " <vcpu");
if (cpus != NULL) { if (cpus != NULL) {
virBufferVSprintf(&buf, " cpuset='%s'", cpus); virBufferVSprintf(&buf, " cpuset='%s'", cpus);
@ -1961,7 +1961,7 @@ sexpr_to_xend_node_info(const struct sexpr *root, virNodeInfoPtr info)
* *
* Returns 0 in case of success, -1 in case of error * Returns 0 in case of success, -1 in case of error
*/ */
static int static int
sexpr_to_xend_topology_xml(virConnectPtr conn, const struct sexpr *root, sexpr_to_xend_topology_xml(virConnectPtr conn, const struct sexpr *root,
virBufferPtr xml) virBufferPtr xml)
{ {
@ -1996,11 +1996,11 @@ sexpr_to_xend_topology_xml(virConnectPtr conn, const struct sexpr *root,
</topology>\n"); </topology>\n");
if (r < 0) goto vir_buffer_failed; if (r < 0) goto vir_buffer_failed;
return (0); return (0);
vir_buffer_failed: vir_buffer_failed:
virXendError(conn, VIR_ERR_NO_MEMORY, _("allocate new buffer")); virXendError(conn, VIR_ERR_NO_MEMORY, _("allocate new buffer"));
error: error:
return (-1); return (-1);
} }
@ -2348,7 +2348,7 @@ xenDaemonDomainSave(virDomainPtr domain, const char *filename)
__FUNCTION__); __FUNCTION__);
return(-1); return(-1);
} }
/* We can't save the state of Domain-0, that would mean stopping it too */ /* We can't save the state of Domain-0, that would mean stopping it too */
if (domain->id == 0) { if (domain->id == 0) {
@ -2689,7 +2689,7 @@ error:
* xenDaemonNodeGetInfo: * xenDaemonNodeGetInfo:
* @conn: pointer to the Xen Daemon block * @conn: pointer to the Xen Daemon block
* @info: pointer to a virNodeInfo structure allocated by the user * @info: pointer to a virNodeInfo structure allocated by the user
* *
* Extract hardware information about the node. * Extract hardware information about the node.
* *
* Returns 0 in case of success and -1 in case of failure. * Returns 0 in case of success and -1 in case of failure.
@ -2767,7 +2767,7 @@ xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer)
struct sexpr *root; struct sexpr *root;
int major, minor; int major, minor;
unsigned long version; unsigned long version;
if (!VIR_IS_CONNECT(conn)) { if (!VIR_IS_CONNECT(conn)) {
virXendError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__); virXendError(conn, VIR_ERR_INVALID_CONN, __FUNCTION__);
return (-1); return (-1);
@ -2937,7 +2937,7 @@ xenDaemonDomainSetVcpus(virDomainPtr domain, unsigned int vcpus)
* @vcpu: virtual CPU number * @vcpu: virtual CPU number
* @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes) * @cpumap: pointer to a bit map of real CPUs (in 8-bit bytes)
* @maplen: length of cpumap in bytes * @maplen: length of cpumap in bytes
* *
* Dynamically change the real CPUs which can be allocated to a virtual CPU. * Dynamically change the real CPUs which can be allocated to a virtual CPU.
* *
* Returns 0 for success; -1 (with errno) on error * Returns 0 for success; -1 (with errno) on error
@ -2983,7 +2983,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu,
* One cpumap inside cpumaps has the format described in virDomainPinVcpu() API. * One cpumap inside cpumaps has the format described in virDomainPinVcpu() API.
* @maplen: number of bytes in one cpumap, from 1 up to size of CPU map in * @maplen: number of bytes in one cpumap, from 1 up to size of CPU map in
* underlying virtualization system (Xen...). * underlying virtualization system (Xen...).
* *
* Extract information about virtual CPUs of domain, store it in info array * Extract information about virtual CPUs of domain, store it in info array
* and also in cpumaps if this pointer is'nt NULL. * and also in cpumaps if this pointer is'nt NULL.
* *
@ -3142,7 +3142,7 @@ xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
* Launch a new Linux guest domain, based on an XML description similar * Launch a new Linux guest domain, based on an XML description similar
* to the one returned by virDomainGetXMLDesc() * to the one returned by virDomainGetXMLDesc()
* This function may requires priviledged access to the hypervisor. * This function may requires priviledged access to the hypervisor.
* *
* Returns a new domain object or NULL in case of failure * Returns a new domain object or NULL in case of failure
*/ */
static virDomainPtr static virDomainPtr
@ -3211,7 +3211,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
* xenDaemonAttachDevice: * xenDaemonAttachDevice:
* @domain: pointer to domain object * @domain: pointer to domain object
* @xml: pointer to XML description of device * @xml: pointer to XML description of device
* *
* Create a virtual device attachment to backend. * Create a virtual device attachment to backend.
* XML description is translated into S-expression. * XML description is translated into S-expression.
* *
@ -3256,10 +3256,10 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml)
/* device doesn't exist, define it */ /* device doesn't exist, define it */
ret = xend_op(domain->conn, domain->name, "op", "device_create", ret = xend_op(domain->conn, domain->name, "op", "device_create",
"config", conf, NULL); "config", conf, NULL);
} }
else { else {
/* device exists, attempt to modify it */ /* device exists, attempt to modify it */
ret = xend_op(domain->conn, domain->name, "op", "device_configure", ret = xend_op(domain->conn, domain->name, "op", "device_configure",
"config", conf, "dev", ref, NULL); "config", conf, "dev", ref, NULL);
} }
free(sexpr); free(sexpr);
@ -3270,7 +3270,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml)
* xenDaemonDetachDevice: * xenDaemonDetachDevice:
* @domain: pointer to domain object * @domain: pointer to domain object
* @xml: pointer to XML description of device * @xml: pointer to XML description of device
* *
* Destroy a virtual device attachment to backend. * Destroy a virtual device attachment to backend.
* *
* Returns 0 in case of success, -1 in case of failure. * Returns 0 in case of success, -1 in case of failure.

View File

@ -31,7 +31,7 @@ extern "C" {
* \param host The host name to connect to * \param host The host name to connect to
* \param port The port number to connect to * \param port The port number to connect to
* \return 0 in case of success, -1 in case of error * \return 0 in case of success, -1 in case of error
* *
* This method creates a new Xend instance via TCP. * This method creates a new Xend instance via TCP.
* *
* This function may not fail if Xend is not running. * This function may not fail if Xend is not running.
@ -44,7 +44,7 @@ int xenDaemonOpen_tcp(virConnectPtr xend, const char *host, int port);
* \brief Setup the connection to xend instance via a Unix domain socket * \brief Setup the connection to xend instance via a Unix domain socket
* \param path The path to the domain socket * \param path The path to the domain socket
* \return 0 in case of success, -1 in case of error * \return 0 in case of success, -1 in case of error
* *
* This method creates a new xend instance via a Unix domain socket. * This method creates a new xend instance via a Unix domain socket.
* *
* This function may not fail if Xend is not running. * This function may not fail if Xend is not running.
@ -59,7 +59,7 @@ int xenDaemonOpen_unix(virConnectPtr xend, const char *path);
* \param xend A xend instance * \param xend A xend instance
* \param name The domain's name * \param name The domain's name
* \return 0 for success; -1 (with errno) on error * \return 0 for success; -1 (with errno) on error
* *
* xen_create() returns after a domain has been allocated including * xen_create() returns after a domain has been allocated including
* its memory. This does not guarentee, though, that the devices * its memory. This does not guarentee, though, that the devices
* have come up properly. For instance, if you create a VBD with an * have come up properly. For instance, if you create a VBD with an

View File

@ -2334,7 +2334,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "uuid config parameter is missing"); xenXMError(conn, VIR_ERR_INTERNAL_ERROR, "uuid config parameter is missing");
goto error; goto error;
} }
if (!(olddomain = virGetDomain(conn, value->str, uuid))) if (!(olddomain = virGetDomain(conn, value->str, uuid)))
goto error; goto error;

View File

@ -302,7 +302,7 @@ virParseCpuSet(virConnectPtr conn, const char **str, char sep,
* virParseXenCpuTopology: * virParseXenCpuTopology:
* @conn: connection * @conn: connection
* @xml: XML output buffer * @xml: XML output buffer
* @str: the topology string * @str: the topology string
* @maxcpu: number of elements available in @cpuset * @maxcpu: number of elements available in @cpuset
* *
* Parse a Xend CPU topology string and build the associated XML * Parse a Xend CPU topology string and build the associated XML
@ -436,7 +436,7 @@ virConvertCpuSet(virConnectPtr conn, const char *str, int maxcpu) {
virXMLError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"), 0); virXMLError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"), 0);
return(NULL); return(NULL);
} }
ret = virParseCpuSet(conn, &cur, 0, cpuset, maxcpu); ret = virParseCpuSet(conn, &cur, 0, cpuset, maxcpu);
if (ret < 0) { if (ret < 0) {
free(cpuset); free(cpuset);
@ -911,7 +911,7 @@ virDomainParseXMLOSDescHVM(virConnectPtr conn, xmlNodePtr node,
return -1; return -1;
} }
/* /*
* Originally XenD abused the 'kernel' parameter for the HVM * Originally XenD abused the 'kernel' parameter for the HVM
* firmware. New XenD allows HVM guests to boot from a kernel * firmware. New XenD allows HVM guests to boot from a kernel
* and if this is enabled, the HVM firmware must use the new * and if this is enabled, the HVM firmware must use the new
@ -1112,7 +1112,7 @@ virDomainParseXMLOSDescKernel(virConnectPtr conn ATTRIBUTE_UNUSED,
} }
cur = cur->next; cur = cur->next;
} }
virBufferVSprintf(buf, "(kernel '%s')", (const char *) kernel); virBufferVSprintf(buf, "(kernel '%s')", (const char *) kernel);
if (initrd != NULL) if (initrd != NULL)
@ -1592,7 +1592,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name,
} }
} }
free(cpuset); free(cpuset);
if (res < 0) if (res < 0)
goto error; goto error;
} else { } else {
virXMLError(conn, VIR_ERR_NO_MEMORY, xmldesc, 0); virXMLError(conn, VIR_ERR_NO_MEMORY, xmldesc, 0);

View File

@ -48,7 +48,7 @@ static void xmlRpcError(virErrorNumber error, const char *info, int value)
static xmlRpcValuePtr xmlRpcValueNew(xmlRpcValueType type) static xmlRpcValuePtr xmlRpcValueNew(xmlRpcValueType type)
{ {
xmlRpcValuePtr ret = malloc(sizeof(*ret)); xmlRpcValuePtr ret = malloc(sizeof(*ret));
if (!ret) if (!ret)
xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate value"), sizeof(*ret)); xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate value"), sizeof(*ret));
else else
@ -95,7 +95,7 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalDateTime(xmlNodePtr node ATTRIBUTE_UNU
static xmlRpcValuePtr xmlRpcValueUnmarshalString(xmlNodePtr node) static xmlRpcValuePtr xmlRpcValueUnmarshalString(xmlNodePtr node)
{ {
xmlRpcValuePtr ret = xmlRpcValueNew(XML_RPC_STRING); xmlRpcValuePtr ret = xmlRpcValueNew(XML_RPC_STRING);
if (ret) if (ret)
ret->value.string = xmlGetText(node); ret->value.string = xmlGetText(node);
return ret; return ret;
@ -112,7 +112,7 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalInteger(xmlNodePtr node)
{ {
xmlRpcValuePtr ret = xmlRpcValueNew(XML_RPC_INTEGER); xmlRpcValuePtr ret = xmlRpcValueNew(XML_RPC_INTEGER);
char *value = xmlGetText(node); char *value = xmlGetText(node);
if (ret && value) if (ret && value)
ret->value.integer = atoi(value); ret->value.integer = atoi(value);
free(value); free(value);
@ -216,15 +216,15 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalDict(xmlNodePtr node)
if (!ret) if (!ret)
return NULL; return NULL;
ret->value.dict.root = root; ret->value.dict.root = root;
for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) { for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) {
*elem = xmlRpcValueUnmarshalDictElement(cur); *elem = xmlRpcValueUnmarshalDictElement(cur);
if (*elem==NULL) { if (*elem==NULL) {
xmlRpcValueFree(ret); xmlRpcValueFree(ret);
return NULL; return NULL;
} }
elem = &(*elem)->next; elem = &(*elem)->next;
} }
@ -353,7 +353,7 @@ void xmlRpcValueMarshal(xmlRpcValuePtr value, virBufferPtr buf, int indent)
TODO TODO
break; break;
case XML_RPC_STRING: case XML_RPC_STRING:
virBufferStrcat(buf, virBufferStrcat(buf,
"<string>", value->value.string, "</string>", NULL); "<string>", value->value.string, "</string>", NULL);
break; break;
case XML_RPC_NIL: case XML_RPC_NIL:
@ -377,10 +377,10 @@ virBufferPtr xmlRpcMarshalRequest(const char *request,
" <methodName>", request, "</methodName>\n" " <methodName>", request, "</methodName>\n"
" <params>\n", NULL); " <params>\n", NULL);
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
virBufferStrcat(buf, virBufferStrcat(buf,
" <param>\n", NULL); " <param>\n", NULL);
xmlRpcValueMarshal(argv[i], buf, 6); xmlRpcValueMarshal(argv[i], buf, 6);
virBufferStrcat(buf, virBufferStrcat(buf,
" </param>\n", NULL); " </param>\n", NULL);
} }
virBufferStrcat(buf, virBufferStrcat(buf,
@ -508,7 +508,7 @@ xmlRpcArgvNew(const char *fmt, va_list ap, int *argc)
xmlRpcValuePtr *argv; xmlRpcValuePtr *argv;
const char *ptr; const char *ptr;
int i; int i;
*argc = strlen(fmt); *argc = strlen(fmt);
if (!(argv = malloc(sizeof(*argv) * *argc))) { if (!(argv = malloc(sizeof(*argv) * *argc))) {
xmlRpcError(VIR_ERR_NO_MEMORY, _("read response"), sizeof(*argv) * *argc); xmlRpcError(VIR_ERR_NO_MEMORY, _("read response"), sizeof(*argv) * *argc);
@ -573,22 +573,22 @@ int xmlRpcCall(xmlRpcContextPtr context, const char *method,
void *retval = NULL; void *retval = NULL;
va_start(ap, fmt); va_start(ap, fmt);
if (retfmt && *retfmt) if (retfmt && *retfmt)
retval = va_arg(ap, void *); retval = va_arg(ap, void *);
if (!(argv = xmlRpcArgvNew(fmt, ap, &argc))) if (!(argv = xmlRpcArgvNew(fmt, ap, &argc)))
return -1; return -1;
va_end(ap); va_end(ap);
buf = xmlRpcMarshalRequest(method, argc, argv); buf = xmlRpcMarshalRequest(method, argc, argv);
xmlRpcArgvFree(argc, argv); xmlRpcArgvFree(argc, argv);
if (!buf) if (!buf)
return -1; return -1;
ret = xmlRpcCallRaw(context->uri, buf->content); ret = xmlRpcCallRaw(context->uri, buf->content);
virBufferFree(buf); virBufferFree(buf);
@ -644,7 +644,7 @@ int xmlRpcCall(xmlRpcContextPtr context, const char *method,
xmlFreeDoc(xml); xmlFreeDoc(xml);
if (fault) { if (fault) {
/* FIXME we need generic dict routines */ /* FIXME we need generic dict routines */
/* FIXME we need faultMessage propagate to libvirt error API */ /* FIXME we need faultMessage propagate to libvirt error API */
context->faultCode = value->value.dict.root->value->value.integer; context->faultCode = value->value.dict.root->value->value.integer;

View File

@ -21,7 +21,7 @@
#include <stdint.h> #include <stdint.h>
#include <xen/dom0_ops.h> #include <xen/dom0_ops.h>
#include <xen/version.h> #include <xen/version.h>
#include <xen/xen.h> #include <xen/xen.h>
@ -256,7 +256,7 @@ virDomainGetVM(virDomainPtr domain)
* @vm: the xenstore vm path * @vm: the xenstore vm path
* @name: the value's path * @name: the value's path
* *
* Internal API extracting one information the device used * Internal API extracting one information the device used
* by the domain from xensttore * by the domain from xensttore
* *
* Returns the new string or NULL in case of error * Returns the new string or NULL in case of error
@ -325,7 +325,7 @@ xenStoreOpen(virConnectPtr conn,
* remote) mechanism. * remote) mechanism.
*/ */
if (getuid() == 0) { if (getuid() == 0) {
virXenStoreError(NULL, VIR_ERR_NO_XEN, virXenStoreError(NULL, VIR_ERR_NO_XEN,
_("failed to connect to Xen Store")); _("failed to connect to Xen Store"));
} }
return (-1); return (-1);
@ -662,7 +662,7 @@ xenStoreDomainShutdown(virDomainPtr domain)
if (domain->id == -1 || domain->id == 0) if (domain->id == -1 || domain->id == 0)
return(-1); return(-1);
/* /*
* this is very hackish, the domU kernel probes for a special * this is very hackish, the domU kernel probes for a special
* node in the xenstore and launch the shutdown command if found. * node in the xenstore and launch the shutdown command if found.
*/ */
return(virDomainDoStoreWrite(domain, "control/shutdown", "halt")); return(virDomainDoStoreWrite(domain, "control/shutdown", "halt"));
@ -690,7 +690,7 @@ xenStoreDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED)
if (domain->id == -1 || domain->id == 0) if (domain->id == -1 || domain->id == 0)
return(-1); return(-1);
/* /*
* this is very hackish, the domU kernel probes for a special * this is very hackish, the domU kernel probes for a special
* node in the xenstore and launch the shutdown command if found. * node in the xenstore and launch the shutdown command if found.
*/ */
return(virDomainDoStoreWrite(domain, "control/shutdown", "reboot")); return(virDomainDoStoreWrite(domain, "control/shutdown", "reboot"));
@ -731,7 +731,7 @@ xenStoreDomainGetOSType(virDomainPtr domain) {
* @domid: id of the domain * @domid: id of the domain
* *
* Return the port number on which the domain is listening for VNC * Return the port number on which the domain is listening for VNC
* connections. * connections.
* *
* Returns the port number, -1 in case of error * Returns the port number, -1 in case of error
*/ */

View File

@ -52,6 +52,6 @@ int main(void) {
virConnectClose(conn); virConnectClose(conn);
printf("OK\n"); printf("OK\n");
exit(0); exit(0);
} }

View File

@ -6,7 +6,7 @@ do
./conftest $f > conftest.$$ ./conftest $f > conftest.$$
outfile=`echo "$f" | sed s+\.conf$+\.out+` outfile=`echo "$f" | sed s+\.conf$+\.out+`
diff $outfile conftest.$$ > /dev/null diff $outfile conftest.$$ > /dev/null
if [ $? != 0 ] if [ $? != 0 ]
then then
if [ -n "$DEBUG_TESTS" ]; then if [ -n "$DEBUG_TESTS" ]; then
diff -u $outfile conftest.$$ diff -u $outfile conftest.$$

View File

@ -17,7 +17,7 @@
extern "C" { extern "C" {
#endif #endif
double virtTestCountAverage(double *items, double virtTestCountAverage(double *items,
int nitems); int nitems);

View File

@ -283,12 +283,12 @@ main(int argc, char **argv)
buffer[PATH_MAX-1] = '\0'; buffer[PATH_MAX-1] = '\0';
progname = argv[0]; progname = argv[0];
custom_uri = buffer; custom_uri = buffer;
if (argc > 1) { if (argc > 1) {
fprintf(stderr, "Usage: %s\n", progname); fprintf(stderr, "Usage: %s\n", progname);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (virtTestRun("virsh list (default)", if (virtTestRun("virsh list (default)",
1, testCompareListDefault, NULL) != 0) 1, testCompareListDefault, NULL) != 0)
ret = -1; ret = -1;

View File

@ -256,7 +256,7 @@ main(int argc, char **argv)
fprintf(stderr, "missing enviroment variable abs_top_srcdir\n"); fprintf(stderr, "missing enviroment variable abs_top_srcdir\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (argc > 1) { if (argc > 1) {
fprintf(stderr, "Usage: %s\n", progname); fprintf(stderr, "Usage: %s\n", progname);

View File

@ -38,12 +38,12 @@ testMethodPlusINT(const void *data)
{ {
int retval = 0; int retval = 0;
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data; xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
if (xmlRpcCall(cxt, "plus", "i", "ii", if (xmlRpcCall(cxt, "plus", "i", "ii",
(const char *) &retval, 10, 10) < 0) (const char *) &retval, 10, 10) < 0)
return -1; return -1;
return retval==(10+10) ? 0 : -1; return retval==(10+10) ? 0 : -1;
} }
static int static int
@ -51,12 +51,12 @@ testMethodPlusDOUBLE(const void *data)
{ {
double retval = 0; double retval = 0;
xmlRpcContextPtr cxt = (xmlRpcContextPtr) data; xmlRpcContextPtr cxt = (xmlRpcContextPtr) data;
if (xmlRpcCall(cxt, "plus", "f", "ff", if (xmlRpcCall(cxt, "plus", "f", "ff",
(const char *) &retval, 10.1234, 10.1234) < 0) (const char *) &retval, 10.1234, 10.1234) < 0)
return -1; return -1;
return retval==(10.1234+10.1234) ? 0 : -1; return retval==(10.1234+10.1234) ? 0 : -1;
} }
static virBufferPtr static virBufferPtr
@ -66,11 +66,11 @@ marshalRequest(const char *fmt, ...)
xmlRpcValuePtr *argv; xmlRpcValuePtr *argv;
virBufferPtr buf; virBufferPtr buf;
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
argv = xmlRpcArgvNew(fmt, ap, &argc); argv = xmlRpcArgvNew(fmt, ap, &argc);
va_end(ap); va_end(ap);
buf = xmlRpcMarshalRequest("test", argc, argv); buf = xmlRpcMarshalRequest("test", argc, argv);
xmlRpcArgvFree(argc, argv); xmlRpcArgvFree(argc, argv);
@ -84,32 +84,32 @@ checkRequestValue(const char *xmlstr, const char *xpath, int type, void *expecte
xmlXPathContextPtr ctxt = NULL; xmlXPathContextPtr ctxt = NULL;
xmlXPathObjectPtr obj = NULL; xmlXPathObjectPtr obj = NULL;
int ret = -1; int ret = -1;
xml = xmlReadDoc((const xmlChar *) xmlstr, "xmlrpctest.xml", NULL, xml = xmlReadDoc((const xmlChar *) xmlstr, "xmlrpctest.xml", NULL,
XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING); XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
if (!xml) if (!xml)
goto error; goto error;
if (!(ctxt = xmlXPathNewContext(xml))) if (!(ctxt = xmlXPathNewContext(xml)))
goto error; goto error;
if (!(obj = xmlXPathEval(BAD_CAST xpath, ctxt))) if (!(obj = xmlXPathEval(BAD_CAST xpath, ctxt)))
goto error; goto error;
switch(type) { switch(type) {
case XML_RPC_INTEGER: case XML_RPC_INTEGER:
if ((obj->type != XPATH_NUMBER) || if ((obj->type != XPATH_NUMBER) ||
((int) obj->floatval != *((int *)expected))) ((int) obj->floatval != *((int *)expected)))
goto error; goto error;
break; break;
case XML_RPC_DOUBLE: case XML_RPC_DOUBLE:
if ((obj->type != XPATH_NUMBER) || if ((obj->type != XPATH_NUMBER) ||
((double) obj->floatval != *((double *)expected))) ((double) obj->floatval != *((double *)expected)))
goto error; goto error;
break; break;
case XML_RPC_STRING: case XML_RPC_STRING:
if ((obj->type != XPATH_STRING) || if ((obj->type != XPATH_STRING) ||
(strcmp((const char *)obj->stringval, (const char *)expected))) (strcmp((const char *)obj->stringval, (const char *)expected)))
goto error; goto error;
break; break;
@ -118,7 +118,7 @@ checkRequestValue(const char *xmlstr, const char *xpath, int type, void *expecte
} }
ret = 0; ret = 0;
error: error:
if (obj) if (obj)
xmlXPathFreeObject(obj); xmlXPathFreeObject(obj);
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
@ -136,10 +136,10 @@ testMarshalRequestINT(const void *data)
virBufferPtr buf = marshalRequest("i", num); virBufferPtr buf = marshalRequest("i", num);
if (check) if (check)
ret = checkRequestValue(buf->content, ret = checkRequestValue(buf->content,
"number(/methodCall/params/param[1]/value/int)", "number(/methodCall/params/param[1]/value/int)",
XML_RPC_INTEGER, (void *) &num); XML_RPC_INTEGER, (void *) &num);
virBufferFree(buf); virBufferFree(buf);
return ret; return ret;
} }
@ -152,8 +152,8 @@ testMarshalRequestSTRING(const void *data ATTRIBUTE_UNUSED)
int check = data ? *((int *)data) : 0; int check = data ? *((int *)data) : 0;
virBufferPtr buf = marshalRequest("s", str); virBufferPtr buf = marshalRequest("s", str);
if (check) if (check)
ret = checkRequestValue(buf->content, ret = checkRequestValue(buf->content,
"string(/methodCall/params/param[1]/value/string)", "string(/methodCall/params/param[1]/value/string)",
XML_RPC_STRING, (void *) str); XML_RPC_STRING, (void *) str);
virBufferFree(buf); virBufferFree(buf);
@ -169,10 +169,10 @@ testMarshalRequestDOUBLE(const void *data)
virBufferPtr buf = marshalRequest("f", num); virBufferPtr buf = marshalRequest("f", num);
if (check) if (check)
ret = checkRequestValue(buf->content, ret = checkRequestValue(buf->content,
"number(/methodCall/params/param[1]/value/double)", "number(/methodCall/params/param[1]/value/double)",
XML_RPC_DOUBLE, (void *) &num); XML_RPC_DOUBLE, (void *) &num);
virBufferFree(buf); virBufferFree(buf);
return ret; return ret;
} }
@ -182,7 +182,7 @@ testBufferStrcat(const void *data ATTRIBUTE_UNUSED)
{ {
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */ virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
int i; int i;
for (i=0; i < 1000; i++) for (i=0; i < 1000; i++)
virBufferStrcat(buf, "My name is ", "libvirt", ".\n", NULL); virBufferStrcat(buf, "My name is ", "libvirt", ".\n", NULL);
@ -195,7 +195,7 @@ testBufferVSprintf(const void *data ATTRIBUTE_UNUSED)
{ {
virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */ virBufferPtr buf = virBufferNew(1000*32); /* don't waste time with realloc */
int i; int i;
for (i=0; i < 1000; i++) for (i=0; i < 1000; i++)
virBufferVSprintf(buf, "My name is %s.\n", "libvirt"); virBufferVSprintf(buf, "My name is %s.\n", "libvirt");
@ -215,14 +215,14 @@ main(int argc, char **argv)
if (argc > 2) if (argc > 2)
{ {
fprintf(stderr, "Usage: %s [url]\n", progname); fprintf(stderr, "Usage: %s [url]\n", progname);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (argc == 2) if (argc == 2)
url = argv[1]; url = argv[1];
/* /*
* client-server tests * client-server tests
*/ */
if (!(cxt = xmlRpcContextNew(url))) if (!(cxt = xmlRpcContextNew(url)))
{ {
@ -230,37 +230,37 @@ main(int argc, char **argv)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (virtTestRun("XML-RPC methodCall INT+INT", if (virtTestRun("XML-RPC methodCall INT+INT",
NLOOPS, testMethodPlusINT, (const void *) cxt) != 0) NLOOPS, testMethodPlusINT, (const void *) cxt) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC methodCall DOUBLE+DOUBLE", if (virtTestRun("XML-RPC methodCall DOUBLE+DOUBLE",
NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0) NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0)
ret = -1; ret = -1;
xmlRpcContextFree(cxt); xmlRpcContextFree(cxt);
/* /*
* regression / performance tests * regression / performance tests
*/ */
if (virtTestRun("XML-RPC request marshalling: INT (check)", if (virtTestRun("XML-RPC request marshalling: INT (check)",
1, testMarshalRequestINT, (const void *) &check) != 0) 1, testMarshalRequestINT, (const void *) &check) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC request marshalling: INT", if (virtTestRun("XML-RPC request marshalling: INT",
NLOOPS, testMarshalRequestINT, NULL) != 0) NLOOPS, testMarshalRequestINT, NULL) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC request marshalling: DOUBLE (check)", if (virtTestRun("XML-RPC request marshalling: DOUBLE (check)",
1, testMarshalRequestDOUBLE, (const void *) &check) != 0) 1, testMarshalRequestDOUBLE, (const void *) &check) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC request marshalling: DOUBLE", if (virtTestRun("XML-RPC request marshalling: DOUBLE",
NLOOPS, testMarshalRequestDOUBLE, NULL) != 0) NLOOPS, testMarshalRequestDOUBLE, NULL) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC request marshalling: STRING (check)", if (virtTestRun("XML-RPC request marshalling: STRING (check)",
1, testMarshalRequestSTRING, (void *) &check) != 0) 1, testMarshalRequestSTRING, (void *) &check) != 0)
ret = -1; ret = -1;
if (virtTestRun("XML-RPC request marshalling: STRING", if (virtTestRun("XML-RPC request marshalling: STRING",
NLOOPS, testMarshalRequestSTRING, NULL) != 0) NLOOPS, testMarshalRequestSTRING, NULL) != 0)
ret = -1; ret = -1;
@ -268,7 +268,7 @@ main(int argc, char **argv)
ret = -1; ret = -1;
if (virtTestRun("Buffer: sprintf", NLOOPS, testBufferVSprintf, NULL) != 0) if (virtTestRun("Buffer: sprintf", NLOOPS, testBufferVSprintf, NULL) != 0)
ret = -1; ret = -1;
exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
} }

42
virsh.1
View File

@ -188,15 +188,15 @@ This prints a small synopsis about all commands available for \fBvirsh\fR
quit this interactive terminal quit this interactive terminal
.IP "\fBversion\fR" 4 .IP "\fBversion\fR" 4
.IX Item "version" .IX Item "version"
Will print out the major version info about what this built from. Will print out the major version info about what this built from.
.RS 4 .RS 4
.Sp .Sp
.RS 4 .RS 4
\&\fBExample\fR \&\fBExample\fR
.Sp .Sp
\&\fBvirsh\fR version \&\fBvirsh\fR version
.Sp .Sp
Compiled against library: libvir 0.0.6 Compiled against library: libvir 0.0.6
.Sp .Sp
Using library: libvir 0.0.6 Using library: libvir 0.0.6
.Sp .Sp
@ -250,20 +250,20 @@ specified it prints out information about all domains.
An example format for the list is as follows: An example format for the list is as follows:
.Sp .Sp
\&\fBvirsh\fR list \&\fBvirsh\fR list
Id Name State Id Name State
.Sp .Sp
\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
.Sp .Sp
.Vb 2 .Vb 2
\& 0 Domain-0 running \& 0 Domain-0 running
\& 2 fedora paused \& 2 fedora paused
.Ve .Ve
.Sp .Sp
Name is the name of the domain. \s-1ID\s0 the domain numeric id. Name is the name of the domain. \s-1ID\s0 the domain numeric id.
State is the run state (see below). State is the run state (see below).
.IP "\fBfreecell\fR optional \fIcellno\fR" 4 .IP "\fBfreecell\fR optional \fIcellno\fR" 4
.IX Item "freecell optional cellno" .IX Item "freecell optional cellno"
Prints the available amount of memory on the machine or within a Prints the available amount of memory on the machine or within a
\&\s-1NUMA\s0 cell if \fIcellno\fR is provided. \&\s-1NUMA\s0 cell if \fIcellno\fR is provided.
.RS 4 .RS 4
.Sp .Sp
@ -290,7 +290,7 @@ scheduling by the Xen hypervisor.
.IP "\fBs \- shutdown\fR" 4 .IP "\fBs \- shutdown\fR" 4
.IX Item "s - shutdown" .IX Item "s - shutdown"
The domain is in the process of shutting down, i.e. the guest operating system The domain is in the process of shutting down, i.e. the guest operating system
has been notified and should be in the process of stopping its operations has been notified and should be in the process of stopping its operations
gracefully. gracefully.
.IP "\fBc \- crashed\fR" 4 .IP "\fBc \- crashed\fR" 4
.IX Item "c - crashed" .IX Item "c - crashed"
@ -318,11 +318,11 @@ The option \fI\-\-disable\fR disable autostarting.
Connect the virtual serial console for the guest. Connect the virtual serial console for the guest.
.IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4 .IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4
.IX Item "create FILE" .IX Item "create FILE"
Create a domain from an \s-1XML\s0 <file> an easy way to create one if you have a pre-existing xen guest created via \fBxm\fR create <\s-1XMLFILE\s0>. Create a domain from an \s-1XML\s0 <file> an easy way to create one if you have a pre-existing xen guest created via \fBxm\fR create <\s-1XMLFILE\s0>.
.Sp .Sp
\&\fBExample\fR \&\fBExample\fR
.Sp .Sp
virsh dumpxml <domain\-id> > file. virsh dumpxml <domain\-id> > file.
.IP "\fBdefine\fR \fI\s-1FILE\s0\fR" 4 .IP "\fBdefine\fR \fI\s-1FILE\s0\fR" 4
.IX Item "define FILE" .IX Item "define FILE"
Define a domain from an \s-1XML\s0 <file>. The domain definitions is registered Define a domain from an \s-1XML\s0 <file>. The domain definitions is registered
@ -353,7 +353,7 @@ convert a domain Id to domain name
Returns state about a running domain. Returns state about a running domain.
.IP "\fBdumpxml\fR \fIdomain-id\fR" 4 .IP "\fBdumpxml\fR \fIdomain-id\fR" 4
.IX Item "dumpxml domain-id" .IX Item "dumpxml domain-id"
Output the domain informations as an \s-1XML\s0 dump to stdout, this format can be used by the \fBcreate\fR command. Output the domain informations as an \s-1XML\s0 dump to stdout, this format can be used by the \fBcreate\fR command.
.IP "\fBreboot\fR \fIdomain-id\fR" 4 .IP "\fBreboot\fR \fIdomain-id\fR" 4
.IX Item "reboot domain-id" .IX Item "reboot domain-id"
Reboot a domain. This acts just as if the domain had the \fBreboot\fR Reboot a domain. This acts just as if the domain had the \fBreboot\fR
@ -385,19 +385,19 @@ kilobytes.
.IP "\fBsetmaxmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4 .IP "\fBsetmaxmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4
.IX Item "setmaxmem domain-id kilobytes" .IX Item "setmaxmem domain-id kilobytes"
Change the maximum memory allocation limit in the guest domain. This should Change the maximum memory allocation limit in the guest domain. This should
not change the current memory use. The memory limit is specified in not change the current memory use. The memory limit is specified in
kilobytes. kilobytes.
.IP "\fBsetvcpus\fR \fIdomain-id\fR \fIcount\fR" 4 .IP "\fBsetvcpus\fR \fIdomain-id\fR \fIcount\fR" 4
.IX Item "setvcpus domain-id count" .IX Item "setvcpus domain-id count"
Change the number of virtual CPUs active in the guest domain. Note that Change the number of virtual CPUs active in the guest domain. Note that
\&\fIcount\fR may be limited by host, hypervisor or limit coming from the \&\fIcount\fR may be limited by host, hypervisor or limit coming from the
original description of domain. original description of domain.
.IP "\fBshutdown\fR \fIdomain-id\fR" 4 .IP "\fBshutdown\fR \fIdomain-id\fR" 4
.IX Item "shutdown domain-id" .IX Item "shutdown domain-id"
Gracefully shuts down a domain. This coordinates with the domain \s-1OS\s0 Gracefully shuts down a domain. This coordinates with the domain \s-1OS\s0
to perform graceful shutdown, so there is no guarantee that it will to perform graceful shutdown, so there is no guarantee that it will
succeed, and may take a variable length of time depending on what succeed, and may take a variable length of time depending on what
services must be shutdown in the domain. services must be shutdown in the domain.
.Sp .Sp
For a xen guest vm the behavior of what happens to a domain when it reboots is set by the For a xen guest vm the behavior of what happens to a domain when it reboots is set by the
\&\fIon_shutdown\fR parameter of the xmdomain.cfg file when the domain was \&\fIon_shutdown\fR parameter of the xmdomain.cfg file when the domain was
@ -491,7 +491,7 @@ The \fI\-\-disable\fR option disable autostarting.
.IP "\fBnet-create\fR \fIfile\fR" 4 .IP "\fBnet-create\fR \fIfile\fR" 4
.IX Item "net-create file" .IX Item "net-create file"
Create a virtual network from an \s-1XML\s0 \fIfile\fR, see the documentation to get Create a virtual network from an \s-1XML\s0 \fIfile\fR, see the documentation to get
a description of the \s-1XML\s0 network format used by libvirt. a description of the \s-1XML\s0 network format used by libvirt.
.IP "\fBnet-define\fR \fIfile\fR" 4 .IP "\fBnet-define\fR \fIfile\fR" 4
.IX Item "net-define file" .IX Item "net-define file"
Define a virtual network from an \s-1XML\s0 \fIfile\fR, the network is just defined but Define a virtual network from an \s-1XML\s0 \fIfile\fR, the network is just defined but
@ -536,18 +536,18 @@ format as accepted by the \fBconnect\fR option.
.SH "AUTHOR" .SH "AUTHOR"
.IX Header "AUTHOR" .IX Header "AUTHOR"
.Vb 2 .Vb 2
\& Andrew Puch <apuch @ redhat.com> \& Andrew Puch <apuch @ redhat.com>
\& Daniel Veillard <veillard @ redhat.com> \& Daniel Veillard <veillard @ redhat.com>
.Ve .Ve
.Sp .Sp
.Vb 3 .Vb 3
\& Based on the xm man paged by \& Based on the xm man paged by
\& Sean Dague <sean at dague dot net> \& Sean Dague <sean at dague dot net>
\& Daniel Stekloff <dsteklof at us dot ibm dot com> \& Daniel Stekloff <dsteklof at us dot ibm dot com>
.Ve .Ve
.SH "BUGS" .SH "BUGS"
.IX Header "BUGS" .IX Header "BUGS"
Bugs can be view on the RedHat buzilla page under the libvirt Bugs can be view on the RedHat buzilla page under the libvirt
<https://bugzilla.redhat.com/> <https://bugzilla.redhat.com/>
.Sp .Sp
<https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr> <https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr>