Commit Graph

1688 Commits

Author SHA1 Message Date
Mark McLoughlin
04cbe68797 Detect newer qemu-kvm versions
The KVM version string can be one of the following:

  - qemu-kvm-x.y.z in stable releases
  - kvm-XX for kvm versions up to kvm-85
  - qemu-kvm-devel-XX for kvm version kvm-86 and later

There are only a few of places where we need to detect
differences between KVM versions based on 0.9.1:

  1) VNET_HDR introduced in kvm-74

  2) -incoming tcp introduced in kvm-79

  3) -incoming exec introduced in kvm-80

  4) -incoming stdio in all earlier kvm versions

With qemu-kvm-0.10.x, we can now assume that (1) is available
if it's a KVM release, (2) and (3) is always available and
(4) is never available.

So, from now on we should only need to check the qemu version
number and the "is_kvm" flag for detecting feature availability.
We only need the KVM version number for older releases.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-11 14:15:49 +00:00
Mark McLoughlin
56ecebf22d Re-factor qemu version parsing
This patch is purely re-factoring without any functional changes
to make way for the next patch.

The main thing achieved by the refactoring is that we now have
easier access to the parenthesised string that KVM folks seem
to delight in changing.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-06-11 14:12:30 +00:00
Daniel Veillard
abed6fca87 find and use kvm-img, qemu-img or qcow-create dynamically
* configure.in src/libvirt_private.syms src/storage_backend_fs.c
  src/util.c src/util.h: find and use kvm-img, qemu-img or qcow-create
  dynamically at runtime, patch by Doug Goldstein
* AUTHORS: add Doug Goldstein
Daniel
2009-06-11 13:18:56 +00:00
Daniel Veillard
f969e393a9 Fix a memory error on Xen device removal
* src/xm_internals.c: the memory shrinking on device removal
  didn't copy the right amount of memory, patch by Daniel Berrange
  fixes #497051
daniel
2009-06-04 13:56:49 +00:00
Daniel P. Berrange
3166570f7c Add NUMA memory APIs to vbox driver 2009-06-03 14:32:18 +00:00
Daniel Veillard
e11013d19c * src/network_driver.c: forbid set Autostart on transcient networks
daniel
2009-06-03 13:52:06 +00:00
Daniel P. Berrange
69d4634635 Switch to positional struct initializers in vbox driver table 2009-06-03 13:30:19 +00:00
Daniel P. Berrange
0ca460eada Implement capabilities and nodeinfo APIs 2009-06-03 13:29:23 +00:00
Daniel P. Berrange
b0b968efd5 Generic shared impls of all NUMA apis 2009-06-03 13:28:02 +00:00
Daniel Veillard
3621d42e0f * src/openvz_conf.c src/virsh.c: various typo or english fixups
raised by Runa Bhattacharjee
daniel
2009-06-03 12:13:52 +00:00
Daniel P. Berrange
1b28a99d14 Fix HAL driver restart thread safety 2009-06-03 11:24:21 +00:00
Daniel P. Berrange
c0d74ed43b Support networking in UML driver 2009-06-03 11:13:33 +00:00
Daniel P. Berrange
7cce4768ae Misc User Mode Linux startup/shutdown bugs 2009-06-03 10:55:33 +00:00
Daniel Veillard
81d0ffbc3b NPIV implementation for node device create and destroy
* src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
  src/node_device_hal.[ch] src/node_device_hal_linux.c
  src/qemu_driver.c src/remote_internal.c src/storage_backend.c
  src/virsh.c src/xen_unified.c tests/nodedevxml2xmltest.c
  po/POTFILES.in: implementation for node device create and destroy
  in NPIV support, patch by David Allan
Daniel
2009-06-02 15:12:53 +00:00
Daniel Veillard
66220e3e61 release of libvirt-0.6.4
* configure.in libvirt.spec.in NEWS docs/* po/*: release of
  libvirt-0.6.4
* src/libvirt.c src/virterror.c: some comments cleanups
Daniel
2009-05-29 16:51:15 +00:00
Daniel P. Berrange
8a1a2ac558 Fix Win32 portability problems with 'inteface' symbol clash 2009-05-29 14:29:22 +00:00
Daniel Veillard
43692df590 portability fix
* src/lxc_container.c: fix a portability issue if PR_CAPBSET_DROP is
  not defined.
Daniel
2009-05-29 14:27:04 +00:00
Cole Robinson
b121c7871f network driver: Fix regression defining colliding networks at daemon startup.
If two virtual networks have the same hardcoded bridge device (which
prevents them from being active simultaneously) we still want to define
them at daemon startup, so the user has a fighting chance of correcting
the XML error.

Add an extra flag to SetBridge to avoid reporting an error if there is
a bridge collision, and use this when loading network configs at startup.

This regressed via commit 4c3f3b4d.
2009-05-29 14:18:57 +00:00
Cole Robinson
545c815c4c networkDestroy: Report error if network is inactive
This follows the same convention as domain drivers.
2009-05-29 14:14:32 +00:00
Cole Robinson
34497fdb37 qemu_driver: Fix another domain startup error reporting race.
Parse the command line output a bit earlier so we have a better chance
of reporting the full error output on failure.

I hit this when QEMU would try to boot an invalid kernel (virtinst bug).
2009-05-29 14:12:50 +00:00
Cole Robinson
4ff19ced3a qemuDomainLookupByUUID: print correct UUID string on failed lookup.
Currently we print the raw UUID which isn't very useful in ascii format.
2009-05-29 14:01:55 +00:00
Cole Robinson
58c73c1789 virsh: Use consistent spacing for net-list
There is different spacing when listing active vs. inactive networks. Ex:

Name                 State      Autostart
-----------------------------------------
default              active     yes
xxxxxx               inactive no
2009-05-29 14:00:41 +00:00
Daniel Veillard
525c3d40a9 PPC Qemu Machine Type update
* src/qemu_conf.c docs/schemas/domain.rng
  tests/capabilityschemadata/caps-qemu-kvm.xml: PPC Qemu Machine Type
  changed from g3bw to g3beige some time ago, patch by Thomas Baker
Daniel
2009-05-29 13:32:06 +00:00
Daniel P. Berrange
8c13e4fef0 Fix missing break in network parsing code 2009-05-29 13:26:45 +00:00
Daniel P. Berrange
c31300e69f Fix misc bugs in ARGV -> XML convertor 2009-05-28 13:21:19 +00:00
Daniel P. Berrange
2afc3bfd8b Avoid broken networking with new QEMU/KVM >= 86 2009-05-28 13:15:57 +00:00
Daniel P. Berrange
ee8553e156 Fix misc syntax problems with open nebula driver 2009-05-28 13:11:22 +00:00
Daniel P. Berrange
dcd9865385 Include function/line nr at all logging levels 2009-05-28 12:54:07 +00:00
Daniel P. Berrange
fb828ed21d Fix error location logging 2009-05-27 12:10:47 +00:00
Daniel Veillard
b811851b8d Include the OpenNebula driver
* src/opennebula/one_conf.[ch] src/opennebula/one_driver.[ch]:
  the OpenNebula driver
* configure.in include/libvirt/virterror.h qemud/Makefile.am
  qemud/qemud.c src/Makefile.am src/domain_conf.[ch] src/driver.h
  src/libvirt.c src/virterror.c: integration of the OpenNebula
  driver in the libvirt infrastructure
* AUTHORS: add Abel Miguez Rodriguez
daniel
2009-05-25 11:56:00 +00:00
Daniel P. Berrange
3d4a0ccbc6 QEMU domain XML conversion from QEMU argv 2009-05-21 14:16:55 +00:00
Daniel P. Berrange
7828b5ccb0 Fix typo s/ES97/AC97/ 2009-05-21 14:16:06 +00:00
Daniel P. Berrange
d8dbd61107 Basic domain XML conversions for Xen/QEMU drivers 2009-05-21 14:14:01 +00:00
Daniel P. Berrange
60d4777190 Remote protocol support for domain XML conversion APIs 2009-05-21 13:50:56 +00:00
Daniel P. Berrange
4d5383fd36 public API for domain XML conversions 2009-05-21 13:46:35 +00:00
Daniel Veillard
73bc011483 Add the Interface config APIs
* configure.in include/libvirt/libvirt.h[.in]
  include/libvirt/virterror.h qemud/remote.c
  qemud/remote_dispatch_args.h qemud/remote_dispatch_prototypes.h
  qemud/remote_dispatch_ret.h qemud/remote_dispatch_table.h
  qemud/remote_protocol.[chx] src/Makefile.am src/datatypes.c
  src/datatypes.h src/driver.h src/libvirt.c src/remote_internal.c
  src/virterror.c src/libvirt_private.syms src/libvirt_public.syms:
  Add the Interface config APIs and remote stubs for those, patch
  by Laine Stump
* AUTHORS: add Laine
daniel
2009-05-20 14:26:49 +00:00
Daniel Veillard
e8da987570 cleanup of some direct stderr logging
* qemud/qemud.c src/console.c src/network_driver.c
  src/node_device_conf.c src/node_device_hal.c src/storage_conf.c
  src/util.c: cleanup of some direct stderr logging
daniel
2009-05-20 13:37:30 +00:00
Daniel Veillard
d879d360eb * src/pci.c: small portability patch
daniel
2009-05-20 13:34:15 +00:00
Daniel Veillard
6a140adb78 * src/lxc_driver.c: fix a couple of error code, patch by Amy Griffis
daniel
2009-05-20 07:12:00 +00:00
Cole Robinson
2d1de285b3 VolumeCreateXMLFrom FS storage backend implementation.
Add an extra 'inputvol' parameter to the file volume building routines. This
allows us to easily reuse the duplicate functionality.
2009-05-19 13:43:48 +00:00
Cole Robinson
4aa0959d60 Storage driver implementation for CreateXMLFrom
There is some funkiness here, since we are either dealing with 2 different
pools (which means validation x 2) or the same pool, where we have to be
careful not to deadlock.
2009-05-19 13:37:51 +00:00
Cole Robinson
5f99a7fd23 Fix node device media insert/eject detection.
We were correctly registering a callback , but weren't telling hal to
actually notify us of any property changes.
2009-05-19 13:35:57 +00:00
Cole Robinson
6244c173ba Fix a possible deadlock in HAL nodedev driver.
The cap_lost and prop_modified callbacks could deadlock if an existing
device needed to be refreshed, since dev_create expects the driver to
be unlocked.
2009-05-19 13:26:14 +00:00
Cole Robinson
adf4384501 Use virAsprintf, rather than VIR_ALLOC + strcpy + strcat 2009-05-19 13:15:50 +00:00
Cole Robinson
bb175dfc53 Don't validate disk type in virsh attach-disk
Let the underlying driver tell us what it supports. At the moment
we are at least erroneously denying floppy eject/insert.
2009-05-19 13:04:46 +00:00
Daniel P. Berrange
de658ab4e4 Fix misc locking bugs identified by lock checker 2009-05-19 11:06:25 +00:00
Daniel P. Berrange
6962a2dd7e Added an optional OCaml+CIL test program for mutex lock validation 2009-05-19 10:17:17 +00:00
Daniel P. Berrange
3ce55d22e4 Declare support for QEMU migration in capabilities 2009-05-18 15:10:51 +00:00
Daniel Veillard
67cc35ade9 Finish hostonly networks support in vbox
* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: last patch for
  hostonly networks support in vbox driver, patch by Pritesh Kothari
daniel
2009-05-15 14:00:50 +00:00
Daniel Veillard
37623bf49a * src/vbox/vbox_tmpl.c: implement vbox vrdp/sdl/gui support,
patches by Pritesh Kothari
daniel
2009-05-15 13:45:40 +00:00
Daniel Veillard
cd223d93da generic support for RDP and desktop graphic extensions
* docs/schemas/domain.rng src/domain_conf.[ch] src/qemu_driver.c:
  extend the generic code for the RDP and desktop extensions of
  the graphic tag needed for vbox, patch by Pritesh Kothari
Daniel
2009-05-15 09:43:51 +00:00
Daniel Veillard
fa1ceca232 * src/xend_internal.c: remove [] around cpumaps for recent xend
patch by Tatsuro Enokura
daniel
2009-05-14 10:31:11 +00:00
Cole Robinson
ee0d7552e2 Fix a few 'used uninitialized' warnings. 2009-05-13 17:43:47 +00:00
Daniel Veillard
7afe94e7e2 * src/buf.c: avoid an XML attribute escaping bug #499791
daniel
2009-05-13 16:19:59 +00:00
Daniel P. Berrange
0d11a25e6d Replace sys/capability.h with linux/capability.h 2009-05-13 11:37:16 +00:00
Cole Robinson
be9e5185b4 Break out FS volume build routines to their own functions.
Improves readability, particularly wrt the pending CreateFromXML changes.
This will also help implementing File->Block volume creation in the future,
since some of this code will need to be moved to a backend agnostic file.
2009-05-12 20:27:17 +00:00
Cole Robinson
6852c88fc7 Virsh commands vol-clone and vol-create-from
vol-clone is a convenience function, requiring only a volume to clone and a
new name.

vol-create-from is a direct mapping to the public API, which allows cloning
across pools, converting between formats, etc, but requires an xml file to be
passed
2009-05-12 20:17:21 +00:00
Cole Robinson
3804161eb6 Test driver implementation of virStorageVolCreateXMLFrom 2009-05-12 20:15:56 +00:00
Cole Robinson
885de7f8cf Remote driver plumbing for virStorageVolCreateXMLFrom 2009-05-12 20:13:52 +00:00
Cole Robinson
5b31c7d08a Add public API stubs for virStorageVolCreateXMLFrom
Also checkin regenerated docs due to API change.
2009-05-12 20:10:50 +00:00
Cole Robinson
52c5f7adc8 Fix error squashing when refreshing file volumes 2009-05-12 19:59:46 +00:00
Daniel P. Berrange
1a60d6bcd6 Improve driver open URI handling 2009-05-12 15:35:18 +00:00
Daniel Veillard
e978774ec6 * src/network_driver.c: enable bridges which are not up
without an IP address, patch by Ludwig Nussel
Daniel
2009-05-12 15:31:22 +00:00
Daniel P. Berrange
6582d5872d Make hash destructors call internal unref methods to free objects 2009-05-11 15:27:37 +00:00
Daniel P. Berrange
65ecb4b434 Fix unused variable warning in LXC driver 2009-05-11 15:26:23 +00:00
Daniel P. Berrange
426f9772b8 Fix QEMU ARGV detection with kvm >= 85 2009-05-11 15:14:24 +00:00
Daniel P. Berrange
9927ca6274 Report detailed error if initial connection open attempt fails 2009-05-11 14:55:52 +00:00
Daniel Veillard
9959a1dd9d drop CAP_SYS_BOOT capability from LXC containers
* src/lxc_container.c: drop LXC CAP_SYS_BOOT capability to avoid
  reboot from inside containers, patch by Ryota Ozaki
Daniel
2009-05-11 14:05:27 +00:00
Cole Robinson
0c8a9d2d51 Check that QEMU is still alive while reading startup output.
By checking the pid every retry period, we can quickly determine if
the process crashed at startup, rather than make the user wait for
the entire timeout (3 seconds).
2009-05-11 13:52:31 +00:00
Cole Robinson
a331653dad Add pidfile argument to __virExec
virExec will write out the pid of the daemonized process only. Use this
in the QEMU driver, rather than QEMU's pidfile, so we can catch errors we
might miss if the emulator bails early.
2009-05-11 13:50:38 +00:00
Cole Robinson
27d72bd517 Report qemu log data if we fail to daemonize the process.
This ensures the user will actually see 'hook' function error output.
2009-05-11 13:37:19 +00:00
Cole Robinson
79d9d2432f Add helper function virExecDaemonize
Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate
process to ensure we don't end up with any zombies, and differentiates between
original process errors and intermediate process errors.
2009-05-11 13:34:37 +00:00
Daniel Veillard
2e878906e4 "Host only" and "Internal" network support for vbox
* src/vbox/vbox_tmpl.c: "Host only" and "Internal" network support
  for vbox, patch by Pritesh Kothari
daniel
2009-05-11 09:56:04 +00:00
Daniel Veillard
070c1c82b0 Support for 'internal' network
* src/domain_conf.[ch] docs/schemas/domain.rng: add support
  for internal network in the generic part of the code, and
  update the Relax-NG grammar accordingly, patch by Pritesh Kothari
daniel
2009-05-11 09:50:27 +00:00
Daniel P. Berrange
b81c7c0892 Create cgroups mode 755, not 655 (Ryota Ozaki) 2009-05-08 10:24:11 +00:00
Daniel P. Berrange
328eac61cd Fix /dev/ population to use char devices (Ryota Ozaki) 2009-05-08 10:22:46 +00:00
Guido Günther
6059354da6 return VIR_DRV_OPEN_DECLINED instead of VIR_DRV_OPEN_ERROR when vbox can't be
found so other hypervisors can be probed. Patch by Pritesh Kothari.
2009-05-08 10:18:26 +00:00
Guido Günther
67e2804ecb fix crash when init fails early (i.e. due to vbox not being installed) 2009-05-08 10:14:30 +00:00
Daniel P. Berrange
54ebbde1e1 Improve name & UUID uniqueness checking in QEMU driver 2009-05-08 10:11:14 +00:00
Daniel P. Berrange
88e22e4e8c Enable save/restore/migrate for QEMU >= 0.10.0 2009-05-08 10:07:15 +00:00
Daniel P. Berrange
0fb9066aaf Log dlopen() errors more verbosely 2009-05-08 10:05:56 +00:00
Daniel P. Berrange
7022759b7e Add new VIR_ERR_OPERATION_INVALID error code & use it in Xen & QEMU drivers 2009-05-08 09:58:46 +00:00
Guido Günther
1dfc35677e check for NULL pointers in pidfile functions 2009-05-07 07:29:51 +00:00
Daniel Veillard
7ee54d8356 Changes needed for multiple graphics adapters
* src/domain_conf.c src/domain_conf.h: parse and save multiple
  graphics elements instead of one, patch by Pritesh Kothari
* src/qemu_conf.c src/qemu_driver.c: adapt the qemu/kvm driver for
  the new structures, patch by Pritesh Kothari
* src/xend_internal.c src/xm_internal.c: same thing for Xen drivers
Daniel
2009-05-07 07:27:49 +00:00
Guido Günther
9f9ce6130d don't crash when called without arguments 2009-05-07 07:17:25 +00:00
Mark McLoughlin
1d6c713b18 Fix qemu driver's interpretation of <hostdev managed='yes'/>
This change:

  Tue Mar  3 08:55:13 GMT 2009 Daniel P. Berrange <berrange@redhat.com>

       Don't try to detach & reset PCI devices while running test
       suite for XML-> ARGV conversion.
       * src/qemu_driver.c: Add qemuPrepareHostDevices() helper to
       detach and reset PCI devices.
       * src/qemu_conf.c: Don't detach & reset PCI devices while
       building the command line argv

accidentally did this:

-            if (hostdev->managed) {
+        if (!hostdev->managed) {

Which results in managed='yes' not causing the device to be
detached when the guest is starting.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2009-05-06 15:56:20 +00:00
Cole Robinson
4f10759024 Refresh QEMU driver capabilities for each getCapabilities call.
Also fix up a couple issues where caps are accessed without locking
the driver structure.
2009-05-06 14:20:34 +00:00
Daniel Veillard
5432ec8ded VirtualBox version improvement and cleanups
* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: changes in
  VirtualBox driver version detection and move informations
  from a global variable into a driver structure, patch by Pritesh
  Kothari.
Daniel
2009-05-06 13:51:19 +00:00
Daniel Veillard
9ccdbb5d61 * src/vbox/vbox_XPCOMCGlue.[ch]: improve VirtualBox path detection
patch by Pritesh Kothari
Daniel
2009-05-06 13:23:44 +00:00
Cole Robinson
840955ff7c Don't throw away StartVM errors when migrating/restoring in qemu driver. 2009-05-05 14:26:02 +00:00
Cole Robinson
03f3736511 Small cleanups in test driver VolCreateXML 2009-05-05 14:19:59 +00:00
Cole Robinson
2a9ca74164 Remove some debug code from storage_driver.c 2009-05-05 14:18:51 +00:00
Cole Robinson
48e9d6862a Use proper error code in virStorageVolCreateXML 2009-05-05 14:17:50 +00:00
Cole Robinson
3f24e6c21c Fix a comment typo in storage_backend_fs.c 2009-05-04 15:44:44 +00:00
Cole Robinson
5314dffc85 virExec: Delay daemonizing as long as possible.
This way the caller can catch more errors (e.g. from a hook callback) from
the intermediate process.
2009-05-04 15:43:25 +00:00
Cole Robinson
a4d0a3fd50 Add some documentation to __virExec and virExec 2009-05-04 15:41:46 +00:00
Daniel P. Berrange
cb4a6614fa Fix check for -Wformat-security which depends on -Wformat 2009-04-28 10:55:45 +00:00
Daniel Veillard
9cae1d5ed6 release of 0.6.3
* NEWS configure.in libvirt.spec.in docs/*: release of 0.6.3
* po/*: regenerated
* src/libvirt.c src/virterror.c: fixed some function comments
Daniel
2009-04-24 14:04:54 +00:00
Daniel P. Berrange
62aa1b56d6 Add virNodeDeviceCreateXML / virNodeDeviceDestroy boilerplate public API and remote protocol impl 2009-04-24 13:11:23 +00:00
Daniel P. Berrange
1aac8114ae Fix Xen dlopen module missing export 2009-04-24 12:19:00 +00:00