Commit Graph

5998 Commits

Author SHA1 Message Date
Eric Blake
8e2b26db94 build: allow older libselinux again
* configure.ac (with_selinux): Check for <selinux/label.h>.
* src/security/security_selinux.c (getContext): New function.
(SELinuxRestoreSecurityFileLabel): Use it to restore compilation
when using older libselinux.
2010-12-20 10:26:15 -07:00
Eric Blake
8837d3c7de build: allow autoconf 2.59 again
Autoconf 2.59 doesn't define ${localedir}, so libvirt was failing
to compile due to a missing LOCALEDIR until today's configmake fix.

* .gnulib: Update to latest for configmake fix.
* configure.ac (libpcap): Avoid AS_CASE.
2010-12-20 10:18:54 -07:00
Wen Congyang
4c6f68925e build: fix typo that broke 'make dist'
* src/Makefile.am (VMWARE_DRIVER_SOURCES): Fix vmware_driver.h.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
2010-12-20 09:09:29 -07:00
Eric Blake
a21db2952f libvirt-guests: avoid sourcing failure
* tools/libvirt-guests.init.in (libvirtd): Skip function library
if it is not present.
Suggested by Guido Günther.
2010-12-20 08:56:29 -07:00
Paweł Krześniak
ed039abc09 bridge_driver: avoid double call to VIR_FREE
While not technically a double free (since VIR_FREE NULLs the
pointer), this is unnecessary extra code.

This crept in when the function was converted from virRun to virCommand.

The AUTHORS file has also been updated.
2010-12-20 08:30:08 -05: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
Matthias Bolte
80d80fed9e vbox: Don't leak domain names in vboxListDefinedDomains 2010-12-17 23:03:01 +01:00
Matthias Bolte
8c572b6c78 vbox: Don't leak arrays from XPCOM
XPCOM returns an array as a pointer to an array of pointers to the
actual items. When the array isn't needed anymore the items are
released, but the actual array containing the pointers to the items
was not freed and leaked.

Free the actual array using ComUnallocMem.

This doesn't affect MSCOM as SafeArrayDestroy releases all items
and frees the array.
2010-12-17 23:02:56 +01:00
Matthias Bolte
d5b1933e56 vbox: Handle different array representations of XPCOM and MSCOM
Add a vboxArray to hide the details from the general driver code.
2010-12-17 23:02:33 +01:00
Matthias Bolte
448347f8b0 vbox: Add glue layer for MSCOM on Windows
Don't require dlopen, but link to ole32 and oleaut32 on Windows.

Don't expose g_pVBoxFuncs anymore. It was only used to get the
version of the API. Make VBoxCGlueInit return the version instead.
This simplifies the implementation of the MSCOM glue layer.

Get the VirtualBox version from the registry.

Add a dummy implementation of the nsIEventQueue to the MSCOM glue
as there seems to be no direct equivalent with MSCOM. It might be
implemented using the normal window message loop. This requires
additional investigation.
2010-12-17 22:51:33 +01:00
Matthias Bolte
abd0e1dce7 vbox: Match struct layout of the MSCOM implementation on Windows 2010-12-17 22:15:24 +01:00
Matthias Bolte
e3ce43cdd9 vbox: Use stdcall convention for all COM methods on Windows
MSCOM requires stdcall convention.
2010-12-17 22:13:43 +01:00
Jean-Baptiste Rouault
cddd2a0628 Add VMware Workstation and Player driver 2010-12-17 21:19:39 +01:00
Eric Blake
65532f4558 maint: improve tests distribution
* tests/Makefile.am (EXTRA_DIST): Sort, and add directories.
(SUBDIRS): Drop automake recursion into subdirs.
* tests/commanddata/Makefile.am: Delete.
* tests/confdata/Makefile.am: Likewise.
* tests/sexpr2xmldata/Makefile.am: Likewise.
* tests/xencapsdata/Makefile.am: Likewise.
* tests/xmconfigdata/Makefile.am: Likewise.
* tests/xml2sexprdata/Makefile.am: Likewise.
2010-12-17 11:57:11 -07:00
Eric Blake
a0db66cfb2 build: fix typo that broke 'make dist'
* src/Makefile.am (QEMU_DRIVER_SOURCES): Ship qemu_cgroup.h.
2010-12-17 11:56:32 -07:00
Daniel P. Berrange
1d16f05674 Update QEMU test cases for new file locations & API renames
* qemuargv2xmltest.c, qemuhelptest.c,
  qemuxml2argvtest.c, testutilsqemu.c: Update includes and
  cope with API renames
2010-12-17 16:41:51 +00:00
Daniel P. Berrange
acabd9d0ff Move QEMU hotplug helper code out of the QEMU driver
The QEMU driver file is far too large. Move all the hotplug
helper code out into a separate file. No functional change.

* src/qemu/qemu_hotplug.c, src/qemu/qemu_hotplug.h,
  src/Makefile.am: Add hotplug helper file
* src/qemu/qemu_driver.c: Delete hotplug code
2010-12-17 13:58:54 +00:00
Daniel P. Berrange
679d628c43 Move QEMU domain lock / job helper code to separate file
To allow the APIs to be used from separate files, move the domain
lock / job helper code into qemu_domain.c

* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add domain lock
  / job code
* src/qemu/qemu_driver.c: Remove domain lock / job code
2010-12-17 13:58:54 +00:00
Daniel P. Berrange
22f4cb855c Move QEMU driver lock helpers to a separate file
To allow their use from other source files, move qemuDriverLock
and qemuDriverUnlock to qemu_conf.h and make them non-static

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuDriverLock
  qemuDriverUnlock
* src/qemu/qemu_driver.c: Remove qemuDriverLock and qemuDriverUnlock
2010-12-17 13:50:47 +00:00
Daniel P. Berrange
01abc8a1b8 Move QEMU hostdev helper code out of the QEMU driver
The QEMU driver file is far too large. Move all the hostdev
helper code out into a separate file. No functional change.

* src/qemu/qemu_hostdev.c, src/qemu/qemu_hostdev.h,
  src/Makefile.am: Add hostdev helper file
* src/qemu/qemu_driver.c: Delete hostdev code
2010-12-17 13:50:21 +00:00
Daniel P. Berrange
52271cfc28 Move QEMU cgroup helper code out of the QEMU driver
The QEMU driver file is far too large. Move all the cgroup
helper code out into a separate file. No functional change.

* src/qemu/qemu_cgroup.c, src/qemu/qemu_cgroup.h,
  src/Makefile.am: Add cgroup helper file
* src/qemu/qemu_driver.c: Delete cgroup code
2010-12-17 13:48:30 +00:00
Daniel P. Berrange
1aecb6348c Move QEMU audit helper code out of the QEMU driver
The QEMU driver file is far too large. Move all the audit
helper code out into a separate file. No functional change.

* src/qemu/qemu_audit.c, src/qemu/qemu_audit.h,
  src/Makefile.am: Add audit helper file
* src/qemu/qemu_driver.c: Delete audit code
2010-12-17 13:46:15 +00:00
Daniel P. Berrange
df4aabafbe Move QEMU private data & namespace code into separate file
Move the code for handling the QEMU virDomainObjPtr private
data, and custom XML namespace into a separate file

* src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: New file
  for private data & namespace code
* src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
  private data & namespace code
* src/qemu/qemu_driver.h, src/qemu/qemu_command.h: Update
  includes
* src/Makefile.am: Add src/qemu/qemu_domain.c
2010-12-17 13:44:54 +00:00
Daniel P. Berrange
0f2e4b9c68 Move QEMU command line management into a separate file
The qemu_conf.c code is doing three jobs, driver config file
loading, QEMU capabilities management and QEMU command line
management. Move the command line code into its own file

* src/qemu/qemu_command.c, src/qemu/qemu_command.h: New
  command line management code
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete command
  line code
* src/qemu/qemu_conf.h, src/qemu_conf.c: Adapt for API renames
* src/Makefile.am: add src/qemu/qemu_command.c
* src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Add
  import of qemu_command.h
2010-12-17 13:43:20 +00:00
Daniel P. Berrange
d8ae147d8e Move QEMU capabilities management into a separate file
The qemu_conf.c code is doing three jobs, driver config file
loading, QEMU capabilities management and QEMU command line
management. Move the capabilities code into its own file

* src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: New
  capabilities management code
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete capabilities
  code
* src/qemu/qemu_conf.h: Adapt for API renames
* src/Makefile.am: add src/qemu/qemu_capabilities.c
2010-12-17 13:39:18 +00:00
Eric Blake
02b4d34a04 maint: doc fix
* src/libvirt.c: Avoid duplicate word.
2010-12-16 11:57:11 -07:00
Hu Tao
226f40542e Add a new function doStartCPUs 2010-12-14 08:43:53 -07:00
Hu Tao
fa139130fb Add a new function doStopCPUs 2010-12-14 08:40:26 -07:00
Hu Tao
54c6833392 Add a macro timeval_to_ms to compute micro seconds from timeval 2010-12-14 08:38:41 -07:00
Jiri Denemark
8806c0db63 cpu: Unify CPUID data structures
So far, CPUID data were stored in two different data structures. First
of them was a structure allowing direct access for CPUID data according
to function number and the second was a plain array of struct
cpuX86cpuid. This was a silly design which resulted in converting data
from one type to the other and back again or implementing similar
functionality for both data structures.

The patch leaves only the direct access structure. This makes the code
both smaller and more maintainable since operations on different objects
can use common low-level operations.

All 57 tests for cpu subsystem still pass after this rewrite.
2010-12-14 11:12:58 +01:00
Jiri Denemark
4262ff45e1 util: Fix logical error in virReportSystemErrorFull 2010-12-14 10:53:35 +01:00
Jiri Denemark
5b2c9f92ca util: Fix error message in __virExec
Remove superfluous ": %s" suffix from the error message.
2010-12-14 10:53:35 +01:00
Jiri Denemark
99800e54b7 daemon: Change CWD to / before daemonizing
We were doing so for child processes but not for libvirtd itself.
2010-12-14 10:53:35 +01:00
Matthias Bolte
e3fb2908cb esx: Add support for storage volume cloning 2010-12-14 01:13:51 +01:00
Eric Blake
6679943f94 selinux: avoid memory overhead of matchpathcon
https://bugzilla.redhat.com/show_bug.cgi?id=658657

* src/security/security_selinux.c
(SELinuxRestoreSecurityFileLabel): Use selabel_lookup instead of
matchpathcon.
Suggested by Daniel Walsh.
2010-12-13 17:01:57 -07:00
Eric Blake
6e9a29c887 daemon, threads: plug a memory leak
* daemon/libvirtd.c (qemudStartWorker, qemudStartEventLoop): Avoid
leaking pthread_attr resources.
* src/util/threads-pthread.c (virThreadCreate): Likewise.
2010-12-13 17:01:14 -07:00
Eric Blake
e414dab4d6 tests: test Fedora 14 qemu-kvm -help parsing
* tests/qemuhelpdata/qemu-kvm-0.13.0: New file.
* tests/qemuhelptest.c (mymain): New test from Fedora 14 qemu-kvm,
which covers some options (like -fstype passthrough) not tested elsewhere.
2010-12-13 16:30:02 -07:00
Eric Blake
d5a710eec1 tests: test RHEL 6.0 qemu-kvm -help parsing
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60: New file.
* tests/qemuhelptest.c (mymain): New test from RHEL 6.0 qemu-kvm,
which covers some options (like -vga=qxl) not tested elsewhere.
* .x-sc_prohibit_empty_lines_at_EOF: Exempt qemu help output.
2010-12-13 16:30:02 -07:00
Eric Blake
3ce483af8c sysinfo: convert to virCommand
* src/util/sysinfo.c (virSysinfoRead): Use virCommand instead of
virExec.
2010-12-13 16:27:48 -07:00
Eric Blake
046ca3f411 sysinfo: formatting cleanups
* src/util/sysinfo.c: Indentation and () fixups.
2010-12-13 16:17:27 -07:00
Eric Blake
3fbc30d96a build: allow mingw compilation with virCommand
Allows compilation, but no creation of child processes yet.  Take it
one step at a time.

* src/util/util.c (virExecWithHook) [WIN32]: New dummy function.
* src/libvirt_private.syms: Export it.
2010-12-13 16:09:50 -07:00
Eric Blake
65c0f17acd build: update gnulib for pipe on mingw
* .gnulib: Update to latest.
* bootstrap.conf (gnulib_modules): Import pipe-posix and waitpid
for mingw.
* src/remote/remote_driver.c (pipe) [WIN32]: Drop dead macro.
* daemon/event.c (pipe) [WIN32]: Drop dead function.
2010-12-13 16:09:50 -07:00
Eric Blake
7aaf4e6439 test: fix commandtest under autobuild.sh
* tests/commandtest.c (mymain): Kill off any leaked-in fds.
* autobuild.sh: Don't leak fds.

Signed-off-by: Eric Blake <eblake@redhat.com>
2010-12-13 16:04:56 -07:00
Diego Elio Pettenò
30a4ee84c4 build: quote AC_LANG_PROGRAM to avoid warnings with autoconf 2.68 2010-12-13 11:01:15 -07:00
Diego Elio Pettenò
0b9ab2abf1 build: properly handle ./configure --with-libpcap
Without this fix, ./configure --with-libpcap will cause --with-libpcap=yes
to be implicitly passed down, which cause yes/bin/pcap-config to be
searched for rather than /usr/bin/pcap-config.

Also output pcap: no when pcap is not found or disabled.
2010-12-13 11:01:11 -07:00
Osier Yang
5faf88fe98 qemu: Introduce two new job types
Currently, all of domain "save/dump/managed save/migration"
use the same function "qemudDomainWaitForMigrationComplete"
to wait the job finished, but the error messages are all
about "migration", e.g. when a domain saving job is canceled
by user, "migration was cancled by client" will be throwed as
an error message, which will be confused for user.

As a solution, intoduce two new job types(QEMU_JOB_SAVE,
QEMU_JOB_DUMP), and set "priv->jobActive" to "QEMU_JOB_SAVE"
before saving, to "QEMU_JOB_DUMP" before dumping, so that we
could get the real job type in
"qemudDomainWaitForMigrationComplete", and give more clear
message further.

And as It's not important to figure out what's the exact job
is in the DEBUG and WARN log, also we don't need translated
string in logs, simply repace "migration" with "job" in some
statements.

* src/qemu/qemu_driver.c
2010-12-13 10:20:29 -07:00
Laurent Léonard
84094af780 Missing "Default-Stop" field in LSB comment in libvirt-guests
The "Default-Stop" field in LSB comment in libvirt-guests is missing and should
be added. I also suggests to add runlevel 2 to the "Default-Start" field.

--
Laurent Léonard
2010-12-13 10:13:13 -07:00
Eric Blake
24384a7579 daemon: plug a memory leak
* daemon/libvirtd.c (qemudFreeClient): Avoid a leak.
(qemudDispatchServer): Avoid null dereference.
2010-12-13 09:49:26 -07:00
Roopa Prabhu
013c000a6c 802.1Qbh: Add support for IFLA_VF_MAC
Current code does not pass VM mac address to a 802.1Qbh direct attach
interface using IFLA_VF_MAC.  This patch adds support in macvtap code to
send IFLA_VF_MAC netlink request during port profile association on a
802.1Qbh interface.

Stefan Cc'ed for comments because this patch changes a condition for
802.1Qbg

802.1Qbh support for IFLA_VF_MAC in enic driver has been posted and is
pending acceptance at http://marc.info/?l=linux-netdev&m=129185244410557&w=2
2010-12-13 11:07:38 -05:00
Eric Blake
e8d05c978d command: ease use with virBuffer, and fix qemu leak
* src/util/command.h (virCommandAddArgBuffer)
(virCommandAddEnvBuffer): New prototypes.
* src/util/command.c (virCommandAddArgBuffer)
(virCommandAddEnvBuffer): Implement them.
* src/libvirt_private.syms (command.h): Export them.
* src/qemu/qemu_conf.c (qemudBuildCommandLine): Use them, plugging
a memory leak on rbd_hosts in the process.
2010-12-10 14:37:09 -07:00