Commit Graph

169 Commits

Author SHA1 Message Date
Bharata B Rao
5f7b71b413 XML definitions for guest NUMA and parsing routines
This patch adds XML definitions for guest NUMA specification and contains
routines to parse the same. The guest NUMA specification looks like this:

<cpu>
        ...
        <topology sockets='2' cores='4' threads='2'/>
        <numa>
                <cell cpus='0-7' memory='512000'/>
                <cell cpus='8-15' memory='512000'/>
        </numa>
        ...
</cpu>

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
2011-11-17 13:34:42 -07:00
Stefan Berger
b1451b6c07 maint: Add Michael Wood as an author
Add Michael Wood <esiotrot@gmail.com> as an author.
2011-11-14 15:28:40 -05:00
Eli Qiao
329b2b2819 util: fix compile error on debian
Add virnetdev.h,virnetdevbridge.h,virnetdevtap.h to private symbols,
since debian linker no longer allows transitive link resolution

Signed-off-by: Eli Qiao <taget@linux.vnet.ibm.com>
2011-11-11 17:04:33 -07:00
Eric Blake
613f9ea8f7 maint: use mailmap, not AUTHORS, for secondary addresses
* AUTHORS: Move Stefan's second entry...
* .mailmap: ...here.
2011-11-11 08:56:19 -07:00
Stefan Berger
fde59b4059 maint: fix make syntax-check
Add my 2nd email to the list of AUTHORS to get 'make syntax-check'
to pass.
2011-11-10 11:34:53 -05:00
Patrice LACHANCE
5759a5ccb5 esx: Support vSphere 5.x
And virtual hardware version 8.
2011-11-01 18:00:34 +01:00
Wen Ruo Lv
8bec4ff2f1 Fix URI alias prefix matching
with /etc/libvirt/libvirt.conf below:
uri_aliases = [
  "hail=qemu:///system",
  "sleet=qemu+ssh://root 9 115 122 57/system",
  "sam=qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock",
]
Neither "virsh -c hailly" nor "hai" should result in matching "hail=qemu:///system"

Fix URI alias prefix matching when connecting

Signed-off-by: Wen Ruo Lv <lvroyce@linux.vnet.ibm.com>
2011-11-01 10:47:35 -06:00
Josh Durgin
5bd6271f59 storage: add auth to virDomainDiskDef
Add additional fields to let you specify the how to authenticate with a disk.
The secret to use may be referenced by a usage string or a UUID, i.e.:

<auth username='myuser'>
 <secret type='ceph' usage='secretname'/>
</auth>

or

<auth username='myuser'>
 <secret type='ceph' uuid='0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f'/>
</auth>

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
2011-10-28 12:51:22 -06:00
Tyler Coumbes
279084537f bridge: modify for use when sVirt is enabled with qemu
This refactors the TAP creation code out of brAddTap into a new
function brCreateTap to allow it to be used on its own. I have also
changed ifSetInterfaceMac to brSetInterfaceMac and exported it since
it is will be needed by code outside of util/bridge.c in the next
patch.

 AUTHORS                 |    1 +
 src/libvirt_bridge.syms |    2 +
 src/util/bridge.c       |  116 +++++++++++++++++++++++++++++++----------------
 src/util/bridge.h       |    9 ++++
 4 files changed, 89 insertions(+), 39 deletions(-)
2011-10-27 20:28:39 -06:00
David L Stevens
a61e9ff60d support continue/return targets in nwfilter
This patch adds support for "continue" and "return" actions
in filter rules.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
2011-10-20 17:37:38 -06:00
Sage Weil
7f197559f2 buf: implement generic virBufferEscape
Implement a generic helper to escape a given set of characters with a
leading '\'.  Generalizes virBufferEscapeSexpr().

Signed-off-by: Sage Weil <sage@newdream.net>
2011-10-12 11:05:41 -06:00
Dan Horák
099dc93b7c disable xenlight for non-Xen platforms
when building libvirt in Fedora/s390x I've found that xenlight needs to
be explicitly disabled in the spec file. Configure properly sets the
library as non-existent, but the %files section still wants to package
the 3 /var/*/libvirt/libxl directories. See also
https://bugzilla.redhat.com/show_bug.cgi?id=745020
2011-10-11 14:24:18 -06:00
tangchen
d5c4067d7b virsh: Update the help information for undefine command.
virsh undefine command can now undefine an active guest, but the help information is still the old.
This patch modifies it and make it coincident to the manpage of virsh.

Signed-off-by: tangchen <tangchen@cn.fujitsu.com>
2011-10-07 09:55:30 -06:00
Peter Krempa
196acebbce maint: update authors 2011-09-23 19:15:37 +02:00
Michal Privoznik
afc984af2e virnetsocket: Pass KRB5CCNAME env variable
So we can allow GSSAPI authentication for ssh.

Signed-off-by: Matthias Witte <witte@netzquadrat.de>
2011-09-09 15:59:26 +02:00
Lei Li
5a1f272875 Check for source conflicts in storage pools
Fix bug #611823 storage driver should prohibit pools with duplicate
underlying storage.

Add internal API virStoragePoolSourceFindDuplicate() to do uniqueness
check based on source location infomation for pool type.

* AUTHORS: add Lei Li
2011-09-05 15:52:03 +08:00
Xu He Jie
bf71201865 libvirtd: create run dir when running at non-root user
When libvirtd is running at non-root user, it won't create ${HOME}/.libvirt.

It will show error message:
17:44:16.838: 7035: error : virPidFileAcquirePath:322 : Failed to open pid file

Signed-off-by: Xu He Jie <xuhj@linux.vnet.ibm.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-09-01 20:32:10 -06:00
Jim Fehlig
cd592a91de Change my email domain
I'd like to change my primary email address to jfehlig@suse.com.
This patch changes it in AUTHORS and .mailmap.
2011-09-01 16:13:34 -06:00
Steve Hodgson
3468bdafaf maint: attribute second author of previous patch
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-08-24 10:48:20 -06:00
Shradha Shah
c0f025b8ba pci: fix pciDeviceListSteal on multiple devices
pciDeviceListSteal(pcidevs, dev) removes dev from pcidevs reducing
the length of pcidevs, so moving onto what was the next dev is wrong.

Instead callers should pop entry 0 repeatedly until pcidevs is empty.

Signed-off-by: Steve Hodgson <shodgson@solarflare.com>
Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2011-08-24 10:31:29 -06:00
Tom Vijlbrief
108ca33357 qemu: disk migration verbose progress
A virsh command like:

migrate --live --copy-storage-all Guest qemu+ssh://user@host/system
--persistent --verbose

shows

Migration: [  0 %]

during the storage copy and does not start counting
until the ram transfer starts

Fix this by scraping optional disk transfer status, and adding it
into the progress meter.
2011-08-17 08:01:12 -06:00
Douglas Schilling Landgraf
841a403f94 libvirtd.init.in: stop/restart() - wrong return value in case of failure
The function stop() was always returning 0 (OK) from killproc() even
in case of error.
2011-08-15 15:44:39 +08:00
Wieland Hoffmann
2fdf2173f3 driver.h: Fix two driver documentation mistakes 2011-07-25 13:50:32 +08:00
Supriya Kannery
2de8aa8fd0 virsh: Avoid using magic numbers for logging
Replace magic numbers with loglevel variables.

Signed-off-by: Supriya Kannery <supriyak@in.ibm.com>
2011-07-14 07:03:40 -06:00
Nan Zhang
23cbf1e0d4 virsh: fix missing prompt message for 'snapshot-delete' command
Make the command 'virsh snapshot-delete' has the appropriate prompt
message when executing sucessful or failed.
2011-07-13 11:28:42 -06:00
Peter Krempa
36caaddde6 qemu: build failed due to unused variables
While compiling on F15 build crashed (probably because of new GCC).
2011-07-13 11:22:28 -06:00
Oskari Saarenmaa
9a0e6a8fae remote/ssh: support for no_verify.
Set StrictHostKeyChecking=no to auto-accept new ssh host keys if the
no_verify extra parameter was specified.  This won't disable host key
checking for already known hosts.  Includes a test and documentation.
2011-07-12 15:09:05 +02:00
Alex Jia
7518ad753f remote: Fix memory leak
Detected in valgrind run:

==9184== 1 bytes in 1 blocks are definitely lost in loss record 1 of 19
==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
==9184==    by 0x4CF97C9: xdr_remote_domain_get_security_label_ret (remote_protocol.c:1696)
==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
==9184==    by 0x4CE3887: call (remote_driver.c:3933)
==9184==    by 0x4CF71C6: remoteDomainGetSecurityLabel (remote_driver.c:1580)
==9184==    by 0x4CCA480: virDomainGetSecurityLabel (libvirt.c:7340)
==9184==    by 0x41993A: cmdDominfo (virsh.c:2414)
==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
==9184==    by 0x4211ED: main (virsh.c:14076)
==9184==
==9184== 2 bytes in 1 blocks are definitely lost in loss record 2 of 19
==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
==9184==    by 0x4CF974F: xdr_remote_node_get_security_model_ret (remote_protocol.c:1713)
==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
==9184==    by 0x4CE3887: call (remote_driver.c:3933)
==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
==9184==    by 0x4211ED: main (virsh.c:14076)
==9184==
==9184== 8 bytes in 1 blocks are definitely lost in loss record 3 of 19
==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
==9184==    by 0x4CF9729: xdr_remote_node_get_security_model_ret (remote_protocol.c:1710)
==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
==9184==    by 0x4CE3887: call (remote_driver.c:3933)
==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
==9184==    by 0x4211ED: main (virsh.c:14076)
==9184==
==9184== LEAK SUMMARY:
==9184==    definitely lost: 11 bytes in 3 blocks

* src/remote/remote_driver.c: Avoid leak on remoteDomainGetSecurityLabel
  and remoteNodeGetSecurityModel.
2011-07-11 09:50:07 -06:00
Michael Santos
b0b85c454c qemu: clean up OOM checks 2011-07-08 09:39:23 -06:00
John Williams
a1092070d4 microblaze: Add architecture support
Add libvirt support for MicroBlaze architecture as a QEMU target.  Based on mips/mipsel pattern.

Signed-off-by: John Williams <john.williams@petalogix.com>
2011-07-07 17:49:21 -06:00
Guannan Ren
416814e66a pci: initialize state values on reattach
add a new API pciDeviceReAttachInit() in pci.c to initialize state values for nodedev reattach

Initialize three state value of device driver to 1. This is just for a new call to
qemudNodeDeviceReAttach()
2011-07-05 11:42:38 -06:00
Scott Moser
d42b749abf fix virParseVersionString with linux 3.0
linux 3.0 has no micro version number, and that is causing problems
for virParseVersionString.  The patch below should allow for:
  major
  major.minor
  major.minor.micro

If major or minor are not present they just default to zero.
We found this in Ubuntu (https://bugs.launchpad.net/bugs/802977)
2011-07-01 07:09:48 -06:00
Ruben Kerkhof
ca43756800 Only include parthelper if built with storage_disk
Parthelper is only compiled if both --with-libvirtd
and --with-storage-disk are set.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2011-06-27 08:50:40 -06:00
David S. Wang
93d6fd1d09 documenting the 802.1Qbh parameters of a 'direct' interface
This patch adds documentation about the 802.1Qbh related parameters
of the virtualport element for 'direct' interfaces.

Signed-off-by: David S. Wang <dwang2@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
2011-06-23 11:05:24 -06:00
Daniel Gollub
c4bd6d96f4 support for Xen HVM Viridian (Hyper-V) enlightenment interface
Introduce libvirt support for Xen HVM Viridian (Hyper-V) enlightenment
interface guest feature.

 src/conf/domain_conf.c     |    3 ++-
 src/conf/domain_conf.h     |    1 +
 src/xen/xen_hypervisor.c   |   11 +++++++++++
 src/xenapi/xenapi_driver.c |    2 ++
 src/xenapi/xenapi_utils.c  |    2 ++
 src/xenxs/xen_sxpr.c       |    4 ++++
 src/xenxs/xen_xm.c         |   12 +++++++++++-
 7 files changed, 33 insertions(+), 2 deletions(-)
2011-06-15 08:02:47 -06:00
Michael Chapman
30697181dc Fix autostart flag when loading running domains
Drivers load running persistent and transient domain configs before
inactive persistent domain configs, however only the latter would set a
domain's autostart flag. This mismatch between the loaded and on-disk
state could later cause problems with "virsh autostart":

  # virsh autostart example
  error: Failed to mark domain example as autostarted
  error: Failed to create symlink '/etc/libvirt/qemu/autostart/example.xml to '/etc/libvirt/qemu/example.xml': File exists

This patch ensures the autostart flag is set correctly even when the
domain is already defined.

Fixes:

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

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
2011-06-14 14:21:23 -06:00
Ohad Levy
a2d401d3ba docs: updated list of applications using libvirt.
Added:
* Virt ruby bindings
* Foreman for provisioning and webui.
2011-06-14 11:03:56 -06:00
Neil Wilson
5b8d2e6d92 Correct 'cputune' documentation example.
Signed-off-by: Neil Wilson <neil@aldur.co.uk>
2011-06-03 08:40:51 -06:00
Heath Petersen
39b59dbdb4 uml: correct command line networking parameters
I have been finding that some UML command line networking parameters are
being generated incorrectly.

For more information, see
https://bugzilla.redhat.com/show_bug.cgi?id=706295 .
2011-06-02 13:52:26 -06:00
Taisuke Yamada
3aab7f2d6b openvz: Fix regression in config file parsing
As reported by Diego Blanco in

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

commit f0443765 which replaced openvz_readline to getline(3)
broke OpenVZ driver as it changed semantics of EOF-handling
when parsing OpenVZ configuration.

There're several other issues reported with current OpenVZ driver:

 #1: unclear error message when parsing "CPUS=" line
 #2: openvz driver goes into crashing loop
 #3: "NETIF=" line in configuration is not parsed correctly
 #4: aborts even when optional parameter is missing
 #5: there's a potential memory leak

This updated patch to fix #[145]. This patch does not fix #[23]
as I haven't verified these yet, but this at least got me to run
OpenVZ on libvirt once again.
2011-05-26 19:49:18 +02:00
Federico Simoncelli
18c2a59206 qemu: allow blkstat/blkinfo calls during migration
Originally most of libvirt domain-specific calls were blocking
during a migration.
A new mechanism to allow specific calls (blkstat/blkinfo) to be
executed in such condition has been implemented.
In the long term it'd be desirable to get a more general
solution to mark further APIs as migration safe, without needing
special case code.

 * src/qemu/qemu_migration.c: add some additional job signal
   flags for doing blkstat/blkinfo during a migration
 * src/qemu/qemu_domain.c: add a condition variable that can be
   used to efficiently wait for the migration code to clear the
   signal flag
 * src/qemu/qemu_driver.c: execute blkstat/blkinfo using the
   job signal flags during migration
2011-05-26 11:05:04 -06:00
Doug Goldstein
a67407fa36 Use per-user TLS certificates when possible
When using TLS authentication and operating as the non-root user,
initially attempt to use that specific user's TLS certificates before
attempting to use the system wide TLS certificates.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2011-05-23 13:18:14 -06:00
Dirk Herrendorefer
5252a06d65 Add support for 'passthru' mode for direct network interfaces
starting with kernel 2.6.38 macvtap supports a 'passthru' mode for
attaching virtual functions of a SRIOV capable network card directly to a VM.
This patch adds the capability to configure such a device.

Signed-off-by: Dirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
2011-05-18 08:15:08 -06:00
Michal Privoznik
5d09c31495 Add warning message to XML definition files stored on disk
Users often edit XML file stored in configuration directory
thinking of modifying a domain/network/pool/etc. Thus it is wise
to let them know they are using the wrong way and give them hint.
2011-05-06 16:48:52 +02:00
Supriya Kannery
0431551435 virsh: fix regression in log to file
Commit 36deff04 introduced a regression due to which virsh is not able
to log to a file - msg_buf was changed from an array to a pointer
without corresponding change to usage of "sizeof()".

Fix regression in virsh logging

Signed-off-by: Supriya Kannery <supriyak@in.ibm.com>
2011-04-30 10:28:02 -06:00
Yufang Zhang
a88916665d xen: check if device is assigned to guest before reattaching
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=664059

Reattaching pci device back to host without destroying guest or
detaching device from guest would cause host to crash. This patch adds
a check before doing device reattach. If the device is being assigned
to guest, libvirt refuses to reattach device to host. The patch only
works for Xen, for it just checks xenstore to get pci device
information.

Signed-off-by: Yufang Zhang <yuzhang@redhat.com>
2011-04-28 14:45:31 -06:00
Mark Wu
d9b46a0d04 Make crash and live flags mutually exclusive in virDomainCoreDump
They don't make any sense when used together.
2011-04-26 13:37:21 +02:00
Richard Laager
cf7124946a Fix two out-of-date comments in LVM backend 2011-04-17 08:37:31 +02:00
Alexander Todorov
d934bd0a58 libvirt-guests: implement START_DELAY
Allow libvirt-guests to stage a delay between guest startups,
to avoid system load caused by back-to-back startup.
2011-04-15 11:15:06 -06:00
Christophe Fergeau
454e50beee Fix gcc 4.6 warnings
gcc 4.6 warns when a variable is initialized but isn't used afterwards:

vmware/vmware_driver.c:449:18: warning: variable 'vmxPath' set but not used [-Wunused-but-set-variable]

This patch fixes these warnings. There are still 2 offending files:

- vbox_tmpl.c: the variable is used inside an #ifdef and is assigned several
  times outside of #ifdef. Fixing the warning would have required wrapping
  all the assignment inside #ifdef which hurts readability.

vbox/vbox_tmpl.c: In function 'vboxAttachDrives':
vbox/vbox_tmpl.c:3918:22: warning: variable 'accessMode' set but not used [-Wunused-but-set-variable]

- esx_vi_types.generated.c: the name implies it's generated code and I
  didn't want to dive into the code generator

esx/esx_vi_types.generated.c: In function 'esxVI_FileQueryFlags_Free':
esx/esx_vi_types.generated.c:1203:3: warning: variable 'item' set but not used [-Wunused-but-set-variable]
2011-04-14 19:09:12 +02:00