Commit Graph

760 Commits

Author SHA1 Message Date
Laine Stump
fe053dbea7 Enable tuning of qemu network tap device "sndbuf" size
This is in response to a request in:

   https://bugzilla.redhat.com/show_bug.cgi?id=665293

In short, under heavy load, it's possible for qemu's networking to
lock up due to the tap device's default 1MB sndbuf being
inadequate. adding "sndbuf=0" to the qemu commandline -netdevice
option will alleviate this problem (sndbuf=0 actually sets it to
0xffffffff).

Because we must be able to explicitly specify "0" as a value, the
standard practice of "0 means not specified" won't work here. Instead,
virDomainNetDef also has a sndbuf_specified, which defaults to 0, but
is set to 1 if some value was given.

The sndbuf value is put inside a <tune> element of each <interface> in
the domain. The intent is that further tunable settings will also be
placed inside this element.

     <interface type='network'>
       ...
       <tune>
         <sndbuf>0</sndbuf>
       ...
       </tune>
     </interface>
2011-01-14 14:46:38 -05:00
Laine Stump
175077fd70 Add XML config switch to enable/disable vhost-net support
This patch is in response to

  https://bugzilla.redhat.com/show_bug.cgi?id=643050

The existing libvirt support for the vhost-net backend to the virtio
network driver happens automatically - if the vhost-net device is
available, it is always enabled, otherwise the standard userland
virtio backend is used.

This patch makes it possible to force whether or not vhost-net is used
with a bit of XML. Adding a <driver> element to the interface XML, eg:

     <interface type="network">
       <model type="virtio"/>
       <driver name="vhost"/>

will force use of vhost-net (if it's not available, the domain will
fail to start). if driver name="qemu", vhost-net will not be used even
if it is available.

If there is no <driver name='xxx'/> in the config, libvirt will revert
to the pre-existing automatic behavior - use vhost-net if it's
available, and userland backend if vhost-net isn't available.
2011-01-14 14:46:21 -05:00
Jim Fehlig
79f56c669f Document HAP domain feature
Add HAP feature to schema and documentation.
2011-01-13 09:30:26 -07:00
Daniel Veillard
657cd084a9 Fix old PHP syntax in the search online form 2011-01-13 14:09:13 +08:00
Justin Clift
85347321b3 docs: fix trivial typos in currentMemory description 2011-01-13 08:33:09 +11:00
Justin Clift
c7f6d6fcc9 docs: reorder apps page alphabetically, plus add libguestfs entries 2011-01-13 01:24:42 +11:00
Justin Clift
e90014e16c docs: add entry for archipel to the apps page 2011-01-12 08:03:28 +11:00
Justin Clift
3cc872d982 docs: use xml entity encoding for extended character last name 2011-01-12 08:00:15 +11:00
Justin Clift
718a8dc6dd docs: updated memtune info again in virsh command reference 2011-01-11 07:33:15 +11:00
Justin Clift
d96fddee1d docs: updated release of virsh cmd reference, with memtune info 2011-01-07 05:37:23 +11:00
Eric Blake
2d44cb4960 schema: tighten <serial><protocol type=...> relaxNG
* docs/schemas/domain.rng (qemucdevSrcDef): Restrict list of
supported <protocol type=> values.
2011-01-06 08:15:50 -07:00
Eric Blake
1000d9c2b0 maint: document dislike of mismatched if/else bracing
* docs/hacking.html.in (Curly braces): Tighten recommendations to
disallow if (cond) one-line; else { block; }.
* HACKING: Regenerate.
Suggested by Daniel P. Berrange.
2011-01-05 11:05:28 -07:00
Justin Clift
6ea4c85919 docs: added libvirt-announce to contact page
Also added explicit links to the subscription and
archive pages for the user and developer mailing
lists.
2011-01-05 18:07:30 +11:00
Daniel Veillard
6675e00744 Release of libvirt-0.8.7
* configure.ac libvirt.spec.in docs/news.html.in: bump version and add
  documentation
* po/*po*: regenerate po and pot files
2011-01-04 03:37:17 +01:00
MORITA Kazutaka
d0b9eea8c9 update docs for network disks
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
2010-12-24 08:16:54 -07:00
Laine Stump
6ccce75240 Turn on IPv6 support in the bridge_driver.c virtual network driver
At this point everything is already in place to make IPv6 happen, we just
need to add a few rules, remove some checks for IPv4-only, and document
the changes to the XML on the website.
2010-12-23 15:54:46 -05:00
Laine Stump
a950dd2a31 Change virtual network XML parsing/formatting to support IPv6
This commit adds support for IPv6 parsing and formatting to the
virtual network XML parser, including moving around data definitions
to allow for multiple <ip> elements on a single network, but only
changes the consumers of this API to accommodate for the changes in
API/structure, not to add any actual IPv6 functionality. That will
come in a later patch - this patch attempts to maintain the same final
functionality in both drivers that use the network XML parser - vbox
and "bridge" (the Linux bridge-based driver used by the qemu
hypervisor driver).

* src/libvirt_private.syms: Add new private API functions.
* src/conf/network_conf.[ch]: Change C data structure and
  parsing/formatting.
* src/network/bridge_driver.c: Update to use new parser/formatter.
* src/vbox/vbox_tmpl.c: update to use new parser/formatter
* docs/schemas/network.rng: changes to the schema -
  * there can now be more than one <ip> element.
  * ip address is now an ip-addr (ipv4 or ipv6) rather than ipv4-addr
  * new optional "prefix" attribute that can be used in place of "netmask"
  * new optional "family" attribute - "ipv4" or "ipv6"
    (will default to ipv4)
  * define data types for the above
* tests/networkxml2xml(in|out)/nat-network.xml: add multiple <ip> elements
  (including IPv6) to a single network definition to verify they are being
  correctly parsed and formatted.
2010-12-23 15:53:55 -05:00
Laine Stump
008abeeeb9 make the <dhcp> element optional in network.rng
In practice this has always been optional, but the RNG has shown it as
mandatory, and since all the examples for make check had it, it was
never noticed. One of the existing test cases has been changed to
check for this.

I also noticed that the dhcp/host/ip was still defined as <text/>,
but should really be <ref name='ipv4-addr'/>
2010-12-23 15:53:44 -05:00
Matthias Bolte
e1cee1085a docs: Make VMware Workstation / Player page appear in the menu
By adding it to sitemap.html.in. Also <ul> can't be nested in <p>.
2010-12-23 17:01:17 +01:00
Jean-Baptiste Rouault
3ed3198a4e Add info about VMware driver to the libvirt website 2010-12-23 08:12:15 -07:00
Justin Clift
c207b6d9f9 docs: fixed typo, added table of contents 2010-12-22 23:48:25 +11:00
Justin Clift
2954eb7b35 docs: added compiling page and significantly expanded windows page
Also added an additional menu placement for the windows page, in
order to attract further potential testers.
2010-12-21 20:55:10 +11:00
Matthias Bolte
1e55c382fe docs: Add additional indentation to level 3 menu items
formatnetwork.html has a menu item at level 3. libvirt.css
doesn't have a explicit rule for level 3 and level 3 and
level 2 items end up at the same indentation level.

Add an additional 1em indentation to level 3 menu items.
2010-12-17 23:10:33 +01:00
Hu Tao
e8e9397cf7 Update documentation of watchdog dump option and add test data for it
The xml watchdog dump option is converted to qemu watchdog pause arg
but it is not reasonable to convert it back from qemu watchdog pause
arg since there already is a xml watchdog pause option, so a test for
the dump option to convert it from arg to xml is not added.
2010-12-10 08:00:05 -07:00
Josh Durgin
85400fb992 qemu: Add RBD support and some network disk fixes
Changes common to all network disks:
-Make source name optional in the domain schema, since NBD doesn't use it
-Add a hostName type to the domain schema, and use it instead of genericName, which doesn't include .
-Don't leak host names or ports
-Set the source protocol in qemuParseCommandline

Signed-off-by: Josh Durgin <joshd@hq.newdream.net>
2010-12-09 14:20:53 -07:00
MORITA Kazutaka
036ad5052b add network disk support
This patch adds network disk support to libvirt/QEMU.  The currently
supported protocols are nbd, rbd, and sheepdog.  The XML syntax is like
this:

    <disk type="network" device="disk">
      <driver name="qemu" type="raw" />
      <source protocol='rbd|sheepdog|nbd' name="...some image identifier...">
        <host name="mon1.example.org" port="6000">
        <host name="mon2.example.org" port="6000">
        <host name="mon3.example.org" port="6000">
      </source>
      <target dev="vda" bus="virtio" />
    </disk>

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
2010-12-09 14:09:12 -07:00
Justin Clift
3b45eec5a4 docs: updated virsh command reference download links to new version
The new version lists every virsh command, its description, and
the version of libvirt where it became available.
2010-12-08 17:35:34 +11:00
Eric Blake
cc5e2a849c command: improve behavior on no output
Guarantee that outbuf/errbuf are allocated on success, even if to the
empty string.  Caller always has to free the result, and empty output
check requires checking if *outbuf=='\0'.  Makes the API easier to use
safely.  Failure is best effort allocation (some paths, like
out-of-memory, cannot allocate a buffer, but most do), so caller must
free buffer on failure.

* docs/internals/command.html.in: Update documentation.
* src/util/command.c (virCommandSetOutputBuffer)
(virCommandSetErrorBuffer, virCommandProcessIO) Guarantee empty
string on no output.
* tests/commandtest.c (test17): New test.
2010-12-07 15:35:30 -07:00
Eric Blake
ee11729d7f command: enforce fd vs. buffer considerations
* docs/internals/command.html.in: Better documentation of buffer
vs. fd considerations.
* src/util/command.c (virCommandRunAsync): Reject raw execution
with string io.
(virCommandRun): Reject execution with user-specified fds not
visiting a regular file.
2010-12-07 15:30:24 -07:00
Eric Blake
a7666b9e38 smbios: allow () in smbios strings
* docs/schemas/domain.rng (sysinf-value): Expand pattern.
* tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Prefer '' over
"" for attribute values.  Copy real hardware values.
* tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
2010-12-07 08:49:45 -07:00
Eric Blake
8cad56037b smbios: support system family
* docs/schemas/domain.rng (sysinfo-system-name): Also allow
family.
* src/util/sysinfo.h (struct _virSysinfoDef): Add system_family.
* src/conf/domain_conf.c (virSysinfoParseXML)
(virDomainSysinfoDefFormat): Support it.
* src/util/sysinfo.c (virSysinfoDefFree, virSysinfoRead): Likewise.
* src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Adjust test.
* tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
2010-12-07 08:49:45 -07:00
Jiri Denemark
5f5c6a1b90 build: Fix internal docs generation in VPATH builds 2010-12-06 10:11:44 +01:00
Daniel P. Berrange
a317c50a04 virCommand: docs for usage of new command APIs
* docs/internals/command.html.in: New file.
* docs/Makefile.am: Build new docs.
* docs/subsite.xsl: New glue file.
* docs/internals.html.in, docs/sitemap.html.in: Update glue.
2010-12-02 16:00:47 -07:00
Jiri Denemark
a7283d849c schemas: Fix cpu element schema
Both vendor and topology elements are optional.
2010-12-02 11:02:57 +01:00
Daniel Veillard
a33db6cbfb Release of libvirt 0.8.6
- configure.ac libvirt.spec.in: bump version, add a missing systemtap
  build requirement
- docs/news.html.in: add informations about the release
- po/*: updated Polish and Dutch localizations, and regenerated
- tests/qemuxml2argvtest.c: Fix build problem
2010-11-30 20:42:46 +01:00
Justin Clift
2f723ea74d docs: updated c# bindings with arnauds latest changes 2010-11-30 02:22:38 +11:00
Jiri Denemark
5414d6b6ae doc: Fix spelling of virBufferVSprintf 2010-11-25 18:14:58 +01:00
Philipp Hahn
338289a629 Fix broken XML entity for '>'
Add missing 'g' to '&gt;' of '<product />' source-element.

Signed-off-by: Philipp Hahn <hahn@univention.de>
2010-11-25 10:40:07 +01:00
Eric Blake
149c492137 libvirtd: fix bug when shrinking number of clients
* daemon/libvirtd.c (qemudRunLoop): Pass allocation size, not
current count, to VIR_SHRINK_N.
* docs/hacking.html.in: Update doc example.
* HACKING: Regenerate.
2010-11-23 08:43:00 -07:00
Daniel P. Berrange
b6e5a0a26e Fix parsing of port attribute in storage XML configuration
The XML docs describe a 'port' attribute for the
storage source <host> element, but the parser never
handled it.

* docs/schemas/storagepool.rng: Define port attribute
* src/conf/storage_conf.c: Add missing parsing/formatting
  of host port number
* src/conf/storage_conf.h: Remove bogus/unused 'protocol' field
2010-11-23 14:55:33 +00:00
Cole Robinson
4610a2d51a schemas: domain: Add more valid file path chars
Also, standardize path usage on 'filePath' and 'absFilePath'
2010-11-22 16:37:20 -05:00
Eric Blake
269d3b72f6 memory: make it easier to avoid quadratic scaling of arrays
* src/util/memory.h (VIR_RESIZE_N): New macro.
* src/util/memory.c (virResizeN): New function.
* src/libvirt_private.syms: Export new helper.
* docs/hacking.html.in: Document it.
* HACKING: Regenerate.
2010-11-18 12:17:49 -07:00
Eric Blake
5a0beacc12 memory: make it safer to expand arrays
* src/util/memory.h (VIR_REALLOC_N): Update docs.
(VIR_EXPAND_N, VIR_SHRINK_N): New macros.
(virAlloc, virAllocN, virReallocN, virAllocVar, virFree): Add some
gcc attributes.
* src/util/memory.c (virExpandN, virShrinkN): New functions.
(virReallocN): Update docs.
* src/libvirt_private.syms: Export new helpers.
* docs/hacking.html.in: Prefer newer interfaces over
VIR_REALLOC_N, since uninitialized memory can bite us.
* HACKING: Regenerate.
2010-11-18 12:11:43 -07:00
Eric Blake
e8aba782e7 maint: avoid remaining sprintf uses
* cfg.mk (sc_prohibit_sprintf): New rule.
(sc_prohibit_asprintf): Avoid false positives.
* docs/hacking.html.in (Printf-style functions): Document the
policy.
* HACKING: Regenerate.
* .x-sc_prohibit_sprintf: New exemptions.
* Makefile.am (syntax_check_exceptions): Ship new file.
* src/vbox/vbox_tmpl.c (vboxStartMachine, vboxAttachUSB): Use
virAsprintf instead.
* src/uml/uml_driver.c (umlOpenMonitor): Use snprintf instead.
* tools/virsh.c (cmdDetachInterface): Likewise.
* src/security/security_selinux.c (SELinuxGenSecurityLabel):
Likewise.
* src/openvz/openvz_driver.c (openvzDomainDefineCmd): Likewise,
and ensure large enough buffer.
2010-11-17 10:13:12 -07:00
Eric Blake
0d5f54bb21 maint: use gnulib configmake rather than open-coding things
* bootstrap.conf (gnulib_modules): Add configmake.
* daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by
gnulib.
* src/Makefile.am (INCLUDES): Likewise.
* tests/Makefile.am (INCLUDES): Likewise.
* tools/Makefile.am (virsh_CFLAGS): Likewise.
* daemon/libvirtd.c (qemudInitPaths, usage, main): Update
clients.
* src/cpu/cpu_map.c (CPUMAPFILE): Likewise.
* src/driver.c (DEFAULT_DRIVER_DIR): Likewise.
* src/internal.h (_): Likewise.
* src/libvirt.c (virInitialize): Likewise.
* src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR):
Likewise.
* src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig):
Likewise.
* src/network/bridge_driver.c (NETWORK_PID_DIR)
(NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise.
* src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup):
Likewise.
* src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise.
* src/qemu/qemu_driver.c (qemudStartup): Likewise.
* src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET)
(LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE)
(LIBVIRT_PKI_DIR): Likewise.
* src/secret/secret_driver.c (secretDriverStartup): Likewise.
* src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise.
* src/security/virt-aa-helper.c (main): Likewise.
* src/storage/storage_backend_disk.c (PARTHELPER): Likewise.
* src/storage/storage_driver.c (storageDriverStartup): Likewise.
* src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise.
* src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise.
* tools/virsh.c (main): Likewise.
* docs/hooks.html.in: Likewise.
2010-11-17 08:58:58 -07:00
Stefan Berger
7b7cb1ecc9 deprecate fclose() and introduce VIR_{FORCE_}FCLOSE()
Similarly to deprecating close(), I am now deprecating fclose() and
introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Also, fdopen() is replaced with
VIR_FDOPEN().

Most of the files are opened in read-only mode, so usage of
VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write
mode already had the fclose()<  0 check and I converted those to
VIR_FCLOSE()<  0.

I did not find occurrences of possible double-closed files on the way.
2010-11-16 21:13:29 -05:00
Laine Stump
e7e595b4f0 interface.rng: Make miimon and arpmon optional for bond interfaces
This has been optional in netcf for awhile, but the change hadn't been
propogated to the libvirt copy of the RNG.
2010-11-15 14:22:42 -05:00
Laine Stump
9e3eaaf15d Fix ipv4-addr definition in interface.rng
Eric Blake pointed out a deficiency in this regex when it was
copy-pasted into network.rng. This is just propogating the fix back to
its origin.
2010-11-15 13:42:16 -05:00
Justin Clift
96390edc21 docs: updated virsh command reference with libvirt.org links 2010-11-14 00:00:46 +11:00
Matthias Bolte
34ed4e9809 Generate HACKING from docs/hacking.html.in 2010-11-12 19:47:20 +01:00