Commit Graph

221 Commits

Author SHA1 Message Date
Ata E Husain Bohra
04d9cf8e6c ESX: Fix ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY
Fix addresses two issues:
1. Fix generator code to allow deep copy operation for objects with
   Dynamic_Cast capabilities.
2. Add missing deep copy routine to Long datatype.

Signed-off-by: Ata E Husain Bohra <ata.husain@hotmail.com>
2012-07-21 23:24:25 +02:00
Sebastian Wiedenroth
29bc4fe646 Add a sheepdog backend for the storage driver
This patch brings support to manage sheepdog pools and volumes to libvirt.
It uses the "collie" command-line utility that comes with sheepdog for that.

A sheepdog pool in libvirt maps to a sheepdog cluster.
It needs a host and port to connect to, which in most cases
is just going to be the default of localhost on port 7000.

A sheepdog volume in libvirt maps to a sheepdog vdi.
To create one specify the pool, a name and the capacity.
Volumes can also be resized later.

In the volume XML the vdi name has to be put into the <target><path>.
To use the volume as a disk source for virtual machines specify
the vdi name as "name" attribute of the <source>.
The host and port information from the pool are specified inside the host tag.

  <disk type='network'>
    ...
    <source protocol="sheepdog" name="vdi_name">
      <host name="localhost" port="7000"/>
    </source>
  </disk>

To work right this patch parses the output of collie,
so it relies on the raw output option. There recently was a bug which caused
size information to be reported wrong. This is fixed upstream already and
will be in the next release.

Signed-off-by: Sebastian Wiedenroth <wiedi@frubar.net>
2012-07-18 20:08:27 +01:00
Chuck Short
db4eba91a7 ARMHF: CPU Support for armhf.
Adding CPU encoder/decoder for armhf to avoid runtime error messages.

Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-07-13 10:03:22 -06:00
Sascha Peilicke
5079a7b3e2 Fix directory removal in filesystem storage driver
Fix the virStorageBackendFileSystemVolDelete method to not use
unlink() unconditionally. It must use rmdir() for volumes which
are directories. It should also raise an error if given a volume
which has the network/block type.
2012-07-11 16:42:06 +01:00
Eric Blake
6bbbe53bea maint: update preferred contributor name
Based on off-list discussion with Royce.

* AUTHORS: Update to Royce Lv's preferred anglicized name.
* .mailmap: Likewise.
2012-07-09 13:05:06 -06:00
Josh Durgin
78290b1641 qemu: add rbd to whitelist of migration-safe formats
QEMU (and librbd) flush the cache on the source before the
destination starts, and the destination does not read any
changeable data before that, so live migration with rbd caching
is safe.

This makes 'virsh migrate' work with rbd and caching without the
--unsafe flag.

Reported-by: Vladimir Bashkirtsev <vladimir@bashkirtsev.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-07-02 14:52:27 -06:00
Eiichi Tsukata
0ac3baee2c Fix vm's outbound traffic control problem
Hello,

This is a patch to fix vm's outbound traffic control problem.

Currently, vm's outbound traffic control by libvirt doesn't go well.
This problem was previously discussed at libvir-list ML, however
it seems that there isn't still any answer to the problem.
http://www.redhat.com/archives/libvir-list/2011-August/msg00333.html

I measured Guest(with virtio-net) to Host TCP throughput with the
command "netperf -H".
Here are the outbound QoS parameters and the results.

outbound average rate[kilobytes/s] : Guest to Host throughput[Mbit/s]
======================================================================
1024  (8Mbit/s)                    : 4.56
2048  (16Mbit/s)                   : 3.29
4096  (32Mbit/s)                   : 3.35
8192  (64Mbit/s)                   : 3.95
16384 (128Mbit/s)                  : 4.08
32768 (256Mbit/s)                  : 3.94
65536 (512Mbit/s)                  : 3.23

The outbound traffic goes down unreasonably and is even not controled.

The cause of this problem is too large mtu value in "tc filter" command run by
libvirt. The command uses burst value to set mtu and the burst is equal to
average rate value if it's not set. This value is too large. For example
if the average rate is set to 1024 kilobytes/s, the mtu value is set to 1024
kilobytes. That's too large compared to the size of network packets.
Here libvirt applies tc ingress filter to Host's vnet(tun) device.
Tc ingress filter is implemented with TBF(Token Buckets Filter) algorithm. TBF
uses mtu value to calculate the amount of token consumed by each packet. With too
large mtu value, the token consumption rate is set too large. This leads to
token starvation and deterioration of TCP throughput.

Then, should we use the default mtu value 2 kilobytes?
The anser is No, because Guest with virtio-net device uses 65536 bytes
as mtu to transmit packets to Host, and the tc filter with the default mtu
value 2k drops packets whose size is larger than 2k. So, the most packets
is droped and again leads to deterioration of TCP throughput.

The appropriate mtu value is 65536 bytes which is equal to the maximum value
of network interface device defined in <linux/netdevice.h>. The value is
not so large that it causes token starvation and not so small that it
drops most packets.
Therefore this patch set the mtu value to 64kb(== 65535 bytes).

Again, here are the outbound QoS parameters and the TCP throughput with
the libvirt patched.

outbound average rate[kilobytes/s] : Guest to Host throughput[Mbit/s]
======================================================================
1024  (8Mbit/s)                    : 8.22
2048  (16Mbit/s)                   : 16.42
4096  (32Mbit/s)                   : 32.93
8192  (64Mbit/s)                   : 66.85
16384 (128Mbit/s)                  : 133.88
32768 (256Mbit/s)                  : 271.01
65536 (512Mbit/s)                  : 547.32

The outbound traffic conforms to the given limit.

Thank you,

Signed-off-by: Eiichi Tsukata <eiichi.tsukata.xh@hitachi.com>
2012-06-29 10:56:13 +02:00
Michal Privoznik
d092aae120 AUTHORS: Update
Latest patchset enabling libvirt on s390(x) was developed by
  Viktor Mihajlovski   <mihajlov@linux.vnet.ibm.com>
  Thang Pham           <thang.pham@us.ibm.com>
Add them to the AUTHORS file.
2012-06-25 16:56:44 +02:00
Gerd Hoffmann
fd4fd420b4 qemu: Add xhci support
qemu 1.1 features a xhci controller,
this patch adds support for it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-06-21 16:33:00 +02:00
Dipankar Sarma
d1778b7148 Fix default USB controller for ppc64
Fix the default usb controller for pseries systems if none
specified.

Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
2012-06-19 15:41:55 -06:00
Osier Yang
d41d252694 Update AUTHORS
Commit a80bb970 forgot to update authors.
2012-06-11 22:08:09 +08:00
Beat Jörg
7508338ff3 Fix for parallel port passthrough for QEMU
I came across a bug that the command line generated for passthrough
of the host parallel port /dev/parport0 by libvirt for QEMU is incorrect.

It currently produces:
-chardev tty,id=charparallel0,path=/dev/parport0
-device isa-parallel,chardev=charparallel0,id=parallel0

The first parameter is "tty". It sould be "parport".

If I launch qemu with -chardev parport,... it works as expected.

I have already filled a bug report (
https://bugzilla.redhat.com/show_bug.cgi?id=823879 ), the topic was
already on the list some months ago:

https://www.redhat.com/archives/libvirt-users/2011-September/msg00095.html

Signed-off-by: Eric Blake <eblake@redhat.com>
2012-06-04 16:46:23 -06:00
Radu Caragea
107f51b69c Fix sync issue in virNetClientStreamEventRemoveCallback
The stream lock is unlocked twice instead of being locked and then
unlocked. Probably a typo.
2012-06-04 09:32:37 +02:00
Marti Raudsepp
195fa214b6 qemu: move -name arg to be 1st in "ps x" output
Currently, monitoring QEMU virtual machines with standard Unix
sysadmin tools is harder than it has to be. The QEMU command line is
often miles long and mostly redundant, it's hard to tell which process
is which.

This patch reorders the QEMU -name argument to be the first, so it's
immediately visible in "ps x", htop and "atop -c" output.
2012-06-01 15:06:56 -06:00
David Weber
b8012ce931 sanlock: fix locking for readonly devices
Add ignore param for readonly and shared disk in sanlock
2012-05-14 16:44:09 -06:00
Eric Blake
aaf36b15a6 maint: fix AUTHORS
Use the address specified in the actual commit, to placate
'make syntax-check'.
2012-05-14 09:14:19 -06:00
William Jon McCann
32a9aac2e0 Use XDG Base Directories instead of storing in home directory
As defined in:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

This offers a number of advantages:
 * Allows sharing a home directory between different machines, or
sessions (eg. using NFS)
 * Cleanly separates cache, runtime (eg. sockets), or app data from
user settings
 * Supports performing smart or selective migration of settings
between different OS versions
 * Supports reseting settings without breaking things
 * Makes it possible to clear cache data to make room when the disk
is filling up
 * Allows us to write a robust and efficient backup solution
 * Allows an admin flexibility to change where data and settings are stored
 * Dramatically reduces the complexity and incoherence of the
system for administrators
2012-05-14 15:15:58 +01:00
Dmitry Guryanov
287737f413 util: add functions for interating over json object
Add function virJSONValueObjectKeysNumber, virJSONValueObjectGetKey
and virJSONValueObjectGetValue, which allow you to iterate over all
fields of json object: you can get number of fields and then get
name and value, stored in field with that name by index.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
2012-05-03 09:07:25 -06:00
Eugen Feller
93b21be929 Added Snooze cloud manager to the IaaS section 2012-05-02 12:20:38 -06:00
Wido den Hollander
122fa379de storage: Allow multiple hosts for a storage pool
The current storage pools for NFS and iSCSI only require one host to
connect to. Future storage pools like RBD and Sheepdog will require
multiple hosts.

This patch allows multiple source hosts and rewrites the current
storage drivers.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2012-04-30 18:44:44 +08:00
Ryan Woodsmall
b126715a48 esx: Fix segfault in esxConnectToHost
Caused by commit 4445e16bfa that
made the code used the connection private data pointer before
it was initialized.
2012-04-21 14:13:22 +02:00
Jan Kiszka
dde91ab917 Do not enforce source type of console[0]
If console[0] is an alias for serial[0], do not enforce the former to
have a PTY source type. This breaks serial consoles on stdio and makes
no sense.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-04-16 22:24:20 -06:00
Daniel Veillard
360a88c317 Set Martin Kletzander as a commiter 2012-04-16 16:57:06 +08:00
MATSUDA, Daiki
257191c9e4 UML: fix iteration over consoles
I found typo in UML driver.

MATSUDA Daiki
2012-04-09 10:21:07 -06:00
Stefan Bader
fb98da0050 xen config: No vfb in HVM guest configuration
This causes an implicit vkbd device to be added which takes
6min to finally fail being initialized in the guest.

http://lists.xen.org/archives/html/xen-devel/2012-04/msg00409.html

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2012-04-06 12:54:16 +08:00
Ilja Livenson
37075dfe6c openvz: support vzctl 3.1
https://bugzilla.redhat.com/show_bug.cgi?id=809895

Basically, openvz dropped strict version numbering (3.1 vs 3.1.0),
which caused parsing to fail.
2012-04-04 14:32:15 -06:00
Christian Benvenuti
a02500d010 qemu: Make migration fail when port profile association fails on the dst host
In the current V3 migration protocol, Libvirt does not
check the result of the function

  qemuMigrationVPAssociatePortProfiles

This means that it is possible for a migration to complete
successfully even when the VM loses network connectivity on
the destination host.

With this change libvirt aborts the migration
(during the "finish" step) when the above function fails, that
is to say when at least one of the port profile associations fails.

Signed-off by: Christian Benvenuti <benve@cisco.com>
2012-03-28 10:45:22 -06:00
Stef Walter
53e1d56dd4 Change the default of mdns_adv to false
* Don't advertise information on the network without consent of
   the user, either through manual configuration, or a user
   interface that drives this option.
 * Since libvirtd must be configured for network access anyway
   (for all but ssh), this setting was not useful "out of the box",
   so changing this default setting does not remove "out of the box"
   functionality.
2012-03-27 09:54:49 -06:00
Li Zhang
8120325750 Add qemu support for ppc64 on FC16 or above for rpm packaging
On Fedora16 or above, qemu is supported now. So it is added
in rpm packaging.

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
2012-03-23 12:40:13 -04:00
Peng Zhou
896e6ac4f8 qemu: spice agent-mouse support
spice agent-mouse support

Usage:
  <graphics type='spice'>
    <mouse mode='client'|'server'/>
  <graphics/>

Signed-off-by: Osier Yang <jyang@redhat.com>
2012-03-09 15:26:24 +08:00
Duncan Rance
e91c8b1805 Build error on OSX in src/util/virnetlink.c
I'm building on OSX with no libnl. I had to do this to get src/util/virnetlink.c to compile:
2012-03-06 09:25:38 -07:00
Benjamin Cama
cff5573da2 virterror: Misleading error message when name is missing
[forwarding this here from RH bug #796732]

When creating a network (virsh net-create) with an erroneous XML
containing an empty <name> element, the error message is misleading:

error: Failed to create network from foo.xml
error: missing domain name information

It took me a bit of time to figure out that it was the *network* name
that was missing (I generate this xml and didn't look at it, first).

I realized that the same message is used for missing name when creating
a domain, network, or device node.
2012-02-23 16:31:45 -07:00
Peter Robinson
cb8b9963fe spec: use ix86 macros
* libvirt.spec.in: Use %{ix86} rather than open-coded list.
2012-02-20 09:37:52 -07:00
Lincoln Myers
102690648d Fix compilation on MacOS X
* src/util/virfile.h: the virFileWrapperFdFlags being defined as
  a globa variable instead of a type ended up generating a duplicate
  symbol error.
* AUTHORS: added Lincoln Myers
2012-02-20 11:21:00 +08:00
Ansis Atteka
df81004632 network: support Open vSwitch
This patch allows libvirt to add interfaces to already
existing Open vSwitch bridges. The following syntax in
domain XML file can be used:

    <interface type='bridge'>
      <mac address='52:54:00:d0:3f:f2'/>
      <source bridge='ovsbr'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'/>
      </virtualport>
      <address type='pci' domain='0x0000' bus='0x00'
                          slot='0x03' function='0x0'/>
    </interface>

or if libvirt should auto-generate the interfaceid use
following syntax:

    <interface type='bridge'>
      <mac address='52:54:00:d0:3f:f2'/>
      <source bridge='ovsbr'/>
      <virtualport type='openvswitch'>
      </virtualport>
      <address type='pci' domain='0x0000' bus='0x00'
                          slot='0x03' function='0x0'/>
    </interface>

It is also possible to pass an optional profileid. To do that
use following syntax:

   <interface type='bridge'>
     <source bridge='ovsbr'/>
     <mac address='00:55:1a:65:a2:8d'/>
     <virtualport type='openvswitch'>
       <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'
                   profileid='test-profile'/>
     </virtualport>
   </interface>

To create Open vSwitch bridge install Open vSwitch and
run the following command:

    ovs-vsctl add-br ovsbr
2012-02-15 16:04:54 -05:00
Alex Jia
7b448cae4a Update myself in AUTHORS
Move myself from 'Previous maintainers' section to 'the primary maintainers and
people with commit access rights' section, because I have a commit rights now.

Signed-off-by: Alex Jia <ajia@redhat.com>
2012-02-06 23:39:18 +08:00
Eric Blake
9a3fc7f3f7 maint: prune duplicate listings in AUTHORS
* AUTHORS: Remove duplicates.
* .mailmap: Update accordingly.
2012-02-03 09:56:45 -07:00
Hendrik Schwartke
484a0bab39 qemu: Fix segfault in qemuMonitorTextGetBlockInfo
If some error occurs then the cleanup code calls VIR_FREE(info)
without ensuring that info is initialized.
2012-01-30 13:48:34 +01:00
Marcelo Cerri
98b01e8f2b Update VIRT_CONTROL audit record with pid.
Added a new field "vm-pid" to the VIRT_CONTROL audit record. This information
is useful to correlated another audit events to the events generated by
libvirt.
2012-01-26 16:49:02 -07:00
Zeeshan Ali (Khattak)
fa981fc945 Allow custom metadata in domain configuration XML
Applications can now insert custom nodes and hierarchies into domain
configuration XML. Although currently not enforced, applications are
required to use their own namespaces on every custom node they insert,
with only one top-level element per namespace.
2012-01-24 17:06:34 -07:00
Laszlo Ersek
d19149dda8 virCommandProcessIO(): make poll() usage more robust
POLLIN and POLLHUP are not mutually exclusive. Currently the following
seems possible: the child writes 3K to its stdout or stderr pipe, and
immediately closes it. We get POLLIN|POLLHUP (I'm not sure that's possible
on Linux, but SUSv4 seems to allow it). We read 1K and throw away the
rest.

When poll() returns and we're about to check the /revents/ member in a
given array element, let's map all the revents bits to two (independent)
ideas: "let's attempt to read()", and "let's attempt to write()". This
should cover all errors, EOFs, and normal conditions; the read()/write()
call should report any pending error.

Under this approach, both POLLHUP and POLLERR are mapped to "needs read()"
if we're otherwise prepared for POLLIN. POLLERR also maps to "needs
write()" if we're otherwise prepared for POLLOUT. The rest of the mappings
(POLLPRI etc.) would be easy, but probably useless for pipes.

Additionally, SUSv4 doesn't appear to forbid POLLIN|POLLERR (or
POLLOUT|POLLERR) set simultaneously. One could argue that the read() or
write() call would return without blocking in these cases (with an error),
so POLLIN / POLLOUT would be justified beside POLLERR.

The code now penalizes POLLIN|POLLERR differently from plain POLLERR. The
former (ie. read() returning -1) is terminal and we jump to cleanup, while
plain POLLERR masks only the affected file descriptor for the future.
Let's unify those.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2012-01-24 13:50:45 -07:00
Martin Kletzander
b54de0830a Added check for maximum number of vcpus exceeding topology limit
Earlier, when the number of vcpus was greater than the topology allowed,
libvirt didn't raise an error and continued, resulting in running qemu
with parameters making no sense. Even though qemu did not report any
error itself, the number of vcpus was set to maximum allowed by the
topology.
2012-01-12 16:02:08 -07:00
Deepak C Shetty
99fbb3866c Do not generate security_model when fs driver is anything but 'path'
QEMU does not support security_model for anything but 'path' fs driver type.
Currently in libvirt, when security_model ( accessmode attribute) is not
specified it auto-generates it irrespective of the fs driver type, which
can result in a qemu error for drivers other than path. This patch ensures
that the qemu cmdline is correctly generated by taking into account the
fs driver type.

Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
2012-01-11 13:48:52 -07:00
Yuri Chornoivan
524ba58bb9 Fix typos in messages.
https://bugzilla.redhat.com/show_bug.cgi?id=770954
2012-01-03 20:30:33 -07:00
Osier Yang
dcaeb74a31 Maint: Update AUTHORs
Add Rommer in.
2011-12-12 21:58:52 +08:00
Michael Ellerman
e1636f47ae qemu: Use spapr-vscsi on pseries machine type
On the PPC64 pseries machine type we need to use the spapr-vscsi device
rather than an lsi.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
2011-12-09 13:03:33 -07:00
Christophe Fergeau
dbe5eb2d3a maint: move my name to commiters
Since I have commit rights on libvirt-glib, I can also push to
libvirt, Eric Blake told to move my name up to committers to better
reflect reality.
2011-12-08 11:20:51 +01:00
Prerna Saxena
f9bb67ec6a Add PPC cpu driver.
To add support for running libvirt on PowerPC, a CPU driver for the
PowerPC platform must be added.
Most generic cpu driver routines such as CPU compare, decode, etc
are based on CPUID comparison and are not relevant for non-x86
platforms.
Here, we introduce stubs for relevant PowerPC routines invoked by libvirt.

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Anton Blanchard <anton@au.ibm.com>
2011-11-30 12:38:17 -07:00
Christian Franke
d360795d60 virnetsocket: pass XAUTORITY for ssh connection
When spawning an ssh connection, the environment variables
DISPLAY, SSH_ASKPASS, ... are passed. However XAUTHORITY,
which is necessary if the .Xauthority is in a non default
place, was not passed.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
2011-11-28 09:30:49 -07:00
Lorin Hochstein
8078a90a24 conf: make virt-xml-validate work with vbox domains
virt-xml-validate fails when run on a domain XML file of type 'vbox'.

For failing test case, see https://bugzilla.redhat.com/show_bug.cgi?id=757097

This patch updates the XML schema to accept all valid hypervisor
types, as well as dropping hypervisor types that are not in use
by the current code base.

Signed-off-by: Eric Blake <eblake@redhat.com>
2011-11-28 09:16:07 -07:00