]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoStandardise ./configure --help options reporting.
Diego Elio Pettenò [Sun, 17 Jan 2010 14:48:45 +0000 (15:48 +0100)]
Standardise ./configure --help options reporting.

Always use AC_HELP_STRING for the help text for options at ./configure,
so that the output is properly aligned.

Use proper quadrigraphs for outputting the brackets.

Always use autoconf-style [default=$foo] output to state the default, both
where it was stated before and where it wasn't.

This time, include Matthias Bolte notes regarding defaults, and removing
PFX specification from phyp.

15 years agoqemu: Use log output for pty assignment if 'info chardev' is unavailable
Matthias Bolte [Sat, 16 Jan 2010 17:32:56 +0000 (18:32 +0100)]
qemu: Use log output for pty assignment if 'info chardev' is unavailable

qemudFindCharDevicePTYsMonitor reports an error if 'info chardev' didn't
provide information for a requested device, even if the log output parsing
had found the pty path for that device. This makes pty assignment fail for
older QEMU/KVM versions. For example KVM 72 on Debian doesn't support
'info chardev', so qemuMonitorTextGetPtyPaths cannot parse any useful
information and the hash for device-id-to-pty-path mapping stays empty.

Make qemudFindCharDevicePTYsMonitor report an error only if the log output
parsing and the 'info chardev' parsing failed to provide the pty path.

15 years agoesx: Add VNC support
Matthias Bolte [Sat, 16 Jan 2010 12:52:34 +0000 (13:52 +0100)]
esx: Add VNC support

* src/conf/domain_conf.c: add defaults for the video device
* src/esx/esx_vmx.[ch]: add VNC support to the VMX handling
* tests/vmx2xmltest.c, tests/xml2vmxtest.c: add tests for the VNC support

15 years agoesx: Make the domain part of the hostname optional
Matthias Bolte [Sat, 16 Jan 2010 00:08:27 +0000 (01:08 +0100)]
esx: Make the domain part of the hostname optional

Before the driver assumed that there is always a domain part. That's
not true. Now the domain part is handled as optional.

15 years agoesx: Add stubs for secondary driver types
Matthias Bolte [Fri, 15 Jan 2010 15:01:02 +0000 (16:01 +0100)]
esx: Add stubs for secondary driver types

This stops libvirt from probing for a libvirtd on the ESX server and
sets the base for the implementation of the secondary drivers.

15 years agoBZs 528709 548485
David Jorm [Sun, 17 Jan 2010 23:48:39 +0000 (09:48 +1000)]
BZs 528709 548485

15 years agoFix validation of news.html
Matthias Bolte [Fri, 15 Jan 2010 18:18:09 +0000 (19:18 +0100)]
Fix validation of news.html

15 years agoFix build of Xen proxy daemon
Daniel P. Berrange [Fri, 15 Jan 2010 17:55:11 +0000 (17:55 +0000)]
Fix build of Xen proxy daemon

* src/conf/domain_conf.c: Allow virDomainDeviceInfoIsSet,
  virDomainDeviceInfoClear & virDomainDeviceInfoFormat when
  building Xen proxy

15 years agoRemove obsolete comment in QEMU JSON code
Daniel P. Berrange [Fri, 15 Jan 2010 16:59:23 +0000 (16:59 +0000)]
Remove obsolete comment in QEMU JSON code

* src/qemu/qemu_monitor_json.c: We fill in the PCI function number
   now, so remove obsolete XXX comment

15 years agoSpecify bus/unit instead of index for disks with QEMU
Daniel P. Berrange [Thu, 10 Dec 2009 19:07:16 +0000 (19:07 +0000)]
Specify bus/unit instead of index for disks with QEMU

The current code for using -drive simply sets the -drive 'index'
parameter. QEMU internally converts this to bus/unit depending
on the type of drive. This does not give us precise control over
the bus/unit assignment though. This change switches over to make
libvirt explicitly calculate the bus/unit number.

In addition bus/unit/index are actually irrelevant for VirtIO
disks, since each virtio disk is a separate PCI device. No disk
controller is involved.

Doing the conversion to bus/unit in libvirt allows us to correctly
attach SCSI controllers when required.

* src/qemu/qemu_conf.c: Specify bus/unit instead of index for
  disks
* tests/qemuxml2argvdata/qemuxml2argv-disk*.args: Switch over from
  using index=NNNN, to bus=NN, unit=NN for SCSI/IDE/Floppy disks

15 years agoSplit code for building QEMU -drive arg in separate method
Daniel P. Berrange [Thu, 10 Dec 2009 21:11:56 +0000 (21:11 +0000)]
Split code for building QEMU -drive arg in separate method

To enable it to be called from multiple locations, split out
the code for building the -drive arg string. This will be needed
by later patches which do drive hotplug, the conversion to use
-device, and the conversion to controller/bus/unit addressing

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuBuildDriveStr
  for building -drive arg string

15 years agoConvert monitor over to use virDomainDeviceAddress
Daniel P. Berrange [Mon, 7 Dec 2009 19:07:39 +0000 (19:07 +0000)]
Convert monitor over to use virDomainDeviceAddress

Convert the QEMU monitor APIs over to use virDomainDeviceAddress
structs for passing addresses in/out, instead of individual bits.
This makes the number of parameters smaller & easier to deal with.
No functional change

* src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
  src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
  src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
  take an explicit address ptr for all host/guest addresses

15 years agoMinor fixes for API extension doc
Jim Fehlig [Fri, 15 Jan 2010 17:45:18 +0000 (10:45 -0700)]
Minor fixes for API extension doc

Update the API Extensions doc to reflect new source directory layout.

15 years agoAdd new domain device: "controller"
Wolfgang Mauerer [Wed, 2 Dec 2009 19:15:38 +0000 (19:15 +0000)]
Add new domain device: "controller"

This augments virDomainDevice with a <controller> element
that is used to represent disk controllers (e.g., scsi
controllers). The XML format is given by

  <controller type="scsi" index="<num>">
     <address type="pci" domain="0xNUM" bus="0xNUM" slot="0xNUM"/>
  </controller>

where type denotes the disk interface (scsi, ide,...), index
is an integer that identifies the controller for association
with disks, and the <address> element specifies the controller
address on the PCI bus as described in previous commits
The address element can be omitted; in this case, an address
will be assigned automatically.

Most of the code in this patch is from Wolfgang Mauerer's
previous disk controller series

 * docs/schemas/domain.rng: Define syntax for <controller>
   XML element
 * src/conf/domain_conf.c, src/conf/domain_conf.h: Define
   virDomainControllerDef struct, and routines for parsing
   and formatting XML
* src/libvirt_private.syms: Add virDomainControllerInsert
   and virDomainControllerDefFree

15 years agoSet default disk controller/bus/unit props
Daniel P. Berrange [Tue, 22 Dec 2009 16:53:20 +0000 (16:53 +0000)]
Set default disk controller/bus/unit props

When parsing the <disk> element specification, if no <address>
is provided for the disk, then automatically assign one based on
the <target dev='sdXX'/> device name. This provides for backwards
compatability with existing applications using libvirt, while also
allowing new apps to have complete fine grained control.

* src/conf/domain_conf.h, src/conf/domain_conf.c,
  src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
  for assigning a controller/bus/unit address based on disk target
* src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
  generating XML from ARGV
* tests/qemuxml2argvdata/*.xml: Add in drive address information
  to all XML files

15 years agoAdd address info to sound, video and watchdog devices
Daniel P. Berrange [Thu, 10 Dec 2009 19:19:08 +0000 (19:19 +0000)]
Add address info to sound, video and watchdog devices

Add the virDomainDeviceAddress information to the sound, video
and watchdog devices. This means all of them gain the new XML
element

  <address .... />

This brings them upto par with disk/net/hostdev devices which
already have address info

* src/conf/domain_conf.h: Add virDomainDeviceAddress to sound,
  video & watchdog device struts.
* src/conf/domain_conf.c: Hook up parsing/formatting for
  virDomainDeviceAddress in sound, video & watchdog devices
* docs/schemas/domain.rng: Associate device address info
  with sound, video & watchdog

15 years agoExtend the virDomainDeviceAddress struture to allow disk controller addresses
Daniel P. Berrange [Tue, 1 Dec 2009 16:56:24 +0000 (16:56 +0000)]
Extend the virDomainDeviceAddress struture to allow disk controller addresses

Introduce a new structure

      struct _virDomainDeviceDriveAddress {
        unsigned int controller;
        unsigned int bus;
        unsigned int unit;
      };

and plug that into virDomainDeviceAddress and generates XML that
looks like

  <address type='drive' controller='1' bus='0' unit='5'/>

This syntax will be used by the QEMU driver to explicitly control
how drives are attached to the bus

* src/conf/domain_conf.h, src/conf/domain_conf.c: Parsing and
  formatting of drive addresses
* docs/schemas/domain.rng: Define new address format for drives

15 years agoIntroduce a standardized data structure for device addresses
Daniel P. Berrange [Mon, 30 Nov 2009 18:35:58 +0000 (18:35 +0000)]
Introduce a standardized data structure for device addresses

All guest devices now use a common device address structure
summarized by:

  enum virDomainDeviceAddressType {
    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
    VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
  };

  struct _virDomainDevicePCIAddress {
    unsigned int domain;
    unsigned int bus;
    unsigned int slot;
    unsigned int function;
  };

  struct _virDomainDeviceInfo {
    int type;
    union {
        virDomainDevicePCIAddress pci;
    } addr;
  };

This replaces the anonymous structs in Disk/Net/Hostdev data
structures. Where available, the address is *always* printed
in the XML file, instead of being hidden in the internal state
file.

  <address type='pci' domain='0x0000' bus='0x1e' slot='0x07' function='0x0'/>

The structure definition is based on Wolfgang Mauerer's disk
controller patch series.

* docs/schemas/domain.rng: Define the <address> syntax and
  associate it with disk/net/hostdev devices
* src/conf/domain_conf.h, src/conf/domain_conf.c,
  src/libvirt_private.syms: APIs for parsing/formatting address
  information. Also remove the QEMU specific 'pci_addr' attributes
* src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with
  new standardized format.

15 years agoMake test suite output less verbose
Daniel P. Berrange [Mon, 30 Nov 2009 19:01:31 +0000 (19:01 +0000)]
Make test suite output less verbose

Only print out '.' for each test case, full test output can be
re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX

Sample output now looks like

  TEST: statstest
        ........................................ 40
        ...................................      75  OK
  PASS: statstest
  TEST: qparamtest
        ................................         32  OK
  PASS: qparamtest
  TEST:
        ............                             12  OK

15 years agoFix compilation of virt-aa-helper.c
Matthias Bolte [Thu, 14 Jan 2010 23:27:12 +0000 (00:27 +0100)]
Fix compilation of virt-aa-helper.c

Commit 5073aa994af460e775cb3e548528e28d7660fcc8 added an additional
'}' to a case block that messed up the block structure of the get_files
function.

15 years agoxen: do not report a write-to-Xen-daemon failure as a read failure
Jim Meyering [Fri, 15 Jan 2010 09:22:08 +0000 (10:22 +0100)]
xen: do not report a write-to-Xen-daemon failure as a read failure

* src/xen/xend_internal.c (wr_sync): Correct the diagnostic.

15 years agoFix linkage of virt-aa-helper to libgnu.a
Matthias Bolte [Thu, 14 Jan 2010 00:41:09 +0000 (01:41 +0100)]
Fix linkage of virt-aa-helper to libgnu.a

15 years agoutil: Make sure virExec hook failures are raised
Cole Robinson [Wed, 13 Jan 2010 20:22:28 +0000 (15:22 -0500)]
util: Make sure virExec hook failures are raised

With the introduction virDispatchError, hook function errors are
never sent through the error callback, so users will never see
these messages.

Fix this by calling virDispatchError after hook failure.

15 years agoImplement path lookup for USB by vendor:product
Cole Robinson [Mon, 11 Jan 2010 16:40:46 +0000 (11:40 -0500)]
Implement path lookup for USB by vendor:product

Based off how QEMU does it, look through /sys/bus/usb/devices/* for
matching vendor:product info, and if found, use info from the surrounding
files to build the device's /dev/bus/usb path.

This fixes USB device assignment by vendor:product when running qemu
as non-root (well, it should, but for some reason I couldn't reproduce
the failure people are seeing in [1], but it appears to work properly)

[1] https://bugzilla.redhat.com/show_bug.cgi?id=542450

15 years agodaemon: Don't blindly unregister domain events
Cole Robinson [Wed, 13 Jan 2010 18:21:30 +0000 (13:21 -0500)]
daemon: Don't blindly unregister domain events

The daemon will attempt to unregister domain events on client disconnect,
even if no events were ever registered. This raises an unneeded error.

Track in the qemu_client structure if events have been registered, and
check this when performing cleanup.

15 years agodaemon: Fix various error reporting issues
Cole Robinson [Wed, 13 Jan 2010 17:07:01 +0000 (12:07 -0500)]
daemon: Fix various error reporting issues

Many node device calls weren't properly relaying error messages, and
domain event registeration was not checking for error.

15 years agoevents: Report errors on failure
Cole Robinson [Wed, 13 Jan 2010 18:11:33 +0000 (13:11 -0500)]
events: Report errors on failure

15 years agonode_device: udev: Fix memory leak
Cole Robinson [Tue, 12 Jan 2010 20:01:21 +0000 (15:01 -0500)]
node_device: udev: Fix memory leak

We are setting the same property two different ways without
free'ing in between. Just drop the second assignment.

15 years agonode_device: udev: Enumerate floppy devices
Cole Robinson [Tue, 12 Jan 2010 19:56:56 +0000 (14:56 -0500)]
node_device: udev: Enumerate floppy devices

There are quite a few differences between how udev exposes legacy
and USB floppy devs, but this patch takes care of both variants.

15 years agonode_device: udev: Use base 16 for product/vendor
Cole Robinson [Tue, 12 Jan 2010 18:39:46 +0000 (13:39 -0500)]
node_device: udev: Use base 16 for product/vendor

udev doesn't prefix USB product/vendor info with '0x', so the
strtol conversions were wrong for the product field (vendor already
set the correct base). Make the change for PCI product/vendor as
well to be safe.

This fixes USB device assignment via virt-manager.

15 years agoutil: Remove logging handlers in virExec
Cole Robinson [Fri, 8 Jan 2010 17:08:06 +0000 (12:08 -0500)]
util: Remove logging handlers in virExec

This allows debug statements and raised errors in hook functions to
actually be logged somewhere (stderr). Users can enable debugging in the
daemon and now see more info in /var/log/libvirt/...

15 years agoFix migration in xend driver
Jim Fehlig [Tue, 12 Jan 2010 18:18:34 +0000 (11:18 -0700)]
Fix migration in xend driver

Upstream xen has changed parameters to the migration operation
several times over the past 18 months.  Changeset 17553 removed
the resouce parameter,  Changesets 17709, 17753, and 20326 added
ssl, node, and change_home_server parameters respectively.

Fortunately, testing has revealed that xend will fail the
operation if a parameter is missing but happily honor it if
unknown parameters are provided.  Thus all currently supported
parameters can be provided, satisfying current xend but not
regressing older versions.

15 years agoCommit bootstrap .gitignore additions
Cole Robinson [Tue, 12 Jan 2010 19:36:11 +0000 (14:36 -0500)]
Commit bootstrap .gitignore additions

15 years agoqemu: Disable errors in qemudShutdownVMDaemon
Cole Robinson [Sat, 9 Jan 2010 02:07:37 +0000 (21:07 -0500)]
qemu: Disable errors in qemudShutdownVMDaemon

15 years agolibvirt.c: Preserve MigratePerform failure
Cole Robinson [Sat, 9 Jan 2010 02:00:31 +0000 (21:00 -0500)]
libvirt.c: Preserve MigratePerform failure

15 years agoqemu: migrate: Save MigratePerform error in MigrateFinish.
Cole Robinson [Sat, 9 Jan 2010 01:55:14 +0000 (20:55 -0500)]
qemu: migrate: Save MigratePerform error in MigrateFinish.

This way we won't squash the original error report in
MigratePerform, as is done for P2P and Tunneled migration.

15 years agovirterror: Add virSetError
Cole Robinson [Sat, 9 Jan 2010 01:38:55 +0000 (20:38 -0500)]
virterror: Add virSetError

Can be used to re-set an old error, which may have been squashed by
other functions (like cleanup routines). Will be used in subsequent patches

15 years agoEnsure error handling callback functions are called from safe context
Daniel P. Berrange [Wed, 30 Sep 2009 15:11:47 +0000 (16:11 +0100)]
Ensure error handling callback functions are called from safe context

The virRaiseErrorFull() may invoke the error handler callback
functions an application has registered. This is not good
because the connection object may not be available at this
point, and the caller may be holding locks. This creates a
problem if the error handler calls back into libvirt.

The solutuon is to move invocation of the handler into the
final cleanup code in the public API entry points, where it
is guarenteed to have safe state.

* src/libvirt.c: Invoke virDispatchError() in all error paths
* src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
  replacing with virDispatchError(). Move invocation of the
  error callbacks into virDispatchError() instead of the
  virRaiseErrorFull function which is not in a safe context

15 years agoRevert 7aee22939f7f67a60e24472e5acc40b3b5b9d152
Daniel P. Berrange [Tue, 12 Jan 2010 12:48:34 +0000 (12:48 +0000)]
Revert 7aee22939f7f67a60e24472e5acc40b3b5b9d152

Revert commit 7aee22939f7f67a60e24472e5acc40b3b5b9d152 since it
is mistakenly adding an extra parameter to virsh that does not
belong there.

15 years agocpu_shares parameter limit documented
David Jorm [Tue, 12 Jan 2010 02:24:04 +0000 (12:24 +1000)]
cpu_shares parameter limit documented

15 years agoDocument the domain XML cache attribute for disk devices
Matthias Bolte [Mon, 11 Jan 2010 00:20:56 +0000 (01:20 +0100)]
Document the domain XML cache attribute for disk devices

15 years agoqemu: Fix a memory leak in qemudExtractTTYPath
Matthias Bolte [Sat, 9 Jan 2010 20:19:08 +0000 (21:19 +0100)]
qemu: Fix a memory leak in qemudExtractTTYPath

qemudWaitForMonitor calls qemudReadLogOutput with qemudFindCharDevicePTYs
as callback. qemudFindCharDevicePTYs calls qemudExtractTTYPath to assign
a string to chr->data.file.path. Afterwards qemudWaitForMonitor may call
qemudFindCharDevicePTYsMonitor that overwrites chr->data.file.path without
freeing the old value. This results in leaking the memory allocated by
qemudExtractTTYPath.

Report an OOM error if the strdup in qemudFindCharDevicePTYsMonitor fails.

15 years agoAlso look for dmi information in /sys/class
Guido Günther [Thu, 7 Jan 2010 09:13:51 +0000 (10:13 +0100)]
Also look for dmi information in /sys/class

older kernels such as 2.6.26 have it there.

15 years agoFix UUID random generator to use /dev/random
Laine Stump [Mon, 11 Jan 2010 09:05:38 +0000 (10:05 +0100)]
Fix UUID random generator to use /dev/random

Only use pseudo-random generator for uuid if using /dev/random fails.
* src/util/uuid.c: The original code. would only print the warning
  message if using /dev/random failed, but would still go ahead and call
  virUUIDGeneratePseudoRandomBytes in all cases anyway.

15 years agoavoid another "make distcheck" failure
Jim Meyering [Sat, 9 Jan 2010 08:56:20 +0000 (09:56 +0100)]
avoid another "make distcheck" failure

* docs/Makefile.am (uninstall-local): Separate $$f from preceding
dir name with a "/" and use $$(basename $$f) rather than $$f, since
some values of $$f are prefixed with devhelp/.

15 years agoavoid newly-introduced test failure
Jim Meyering [Sat, 9 Jan 2010 08:25:04 +0000 (09:25 +0100)]
avoid newly-introduced test failure

* tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Update
expected output to match, now that we use -mem-prealloc.

15 years agoproxy_internal.c: mark "request" parameter as nonnull
Jim Meyering [Thu, 7 Jan 2010 18:48:05 +0000 (19:48 +0100)]
proxy_internal.c: mark "request" parameter as nonnull

* src/xen/proxy_internal.c (xenProxyCommand): Mark "request"
as an always-non-NULL parameter.

15 years agodon't test "res == NULL" after we've already dereferenced "res"
Jim Meyering [Wed, 6 Jan 2010 11:45:07 +0000 (12:45 +0100)]
don't test "res == NULL" after we've already dereferenced "res"

* src/xen/proxy_internal.c (xenProxyCommand): "res" is known to be
non-NULL at that point, so remove the "res == NULL" guard.

15 years agofix 7 "make check" test failures in non-srcdir build
Jim Meyering [Sat, 9 Jan 2010 07:37:22 +0000 (08:37 +0100)]
fix 7 "make check" test failures in non-srcdir build

* tests/capabilityschematest: Define and use $srcdir.
* tests/domainschematest: Likewise.
* tests/interfaceschematest: Likewise.
* tests/networkschematest: Likewise.
* tests/nodedevschematest: Likewise.
* tests/storagepoolschematest: Likewise.
* tests/storagevolschematest: Likewise.

15 years agolet "configure --disable-shared" work once again
Jim Meyering [Thu, 7 Jan 2010 20:07:42 +0000 (21:07 +0100)]
let "configure --disable-shared" work once again

Without this change, ./autogen.sh --disable-shared && make would
evoke a "can not build a shared library" failure for libvirtmod.la
due to the new use of libtool's -shared link option in
python/Makefile.am.  Now, --disable-shared also
disables building python.

* configure.in: Make --disable-shared imply --without-python and
silently override --with-python.
Improved by: Diego Elio Pettenò <flameeyes@gmail.com>

15 years agoesx: Dump the raw response in case of an SOAP fault
Matthias Bolte [Tue, 5 Jan 2010 01:44:33 +0000 (02:44 +0100)]
esx: Dump the raw response in case of an SOAP fault

Currently only the faultcode and faultstring are deserialized, the
detail part is ignored. The implementation of many new SOAP types
would be necessary to deserialize the detail part correctly. As an
intermediate solution the raw response is dumped to the debug log.

15 years agoesx: Warn if the ESX server is in maintenance mode
Matthias Bolte [Tue, 5 Jan 2010 01:29:52 +0000 (02:29 +0100)]
esx: Warn if the ESX server is in maintenance mode

15 years agoReplace old CVS references with GIT
Matthias Bolte [Fri, 8 Jan 2010 00:40:38 +0000 (01:40 +0100)]
Replace old CVS references with GIT

15 years agoQemu: ask for memory preallocation with large pages
Daniel Veillard [Thu, 7 Jan 2010 13:48:06 +0000 (14:48 +0100)]
Qemu: ask for memory preallocation with large pages

The -mem-prealloc flag should be used when using large pages
This ensures qemu tries to allocate all required memory immediately,
rather than when first used. The latter mode will crash qemu
if hugepages aren't available when accessed, while the former
should gracefully fallback to non-hugepages.

* src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line
  when using large pages

15 years agoxen hypervisor: xen domctl version 6
Jim Fehlig [Thu, 7 Jan 2010 20:05:35 +0000 (13:05 -0700)]
xen hypervisor: xen domctl version 6

xen-unstable c/s 20685 changed the domctl interface, adding a field to
xen_domctl_getdomaininfo structure.  This additional field causes stack
corruption in libvirt.  xen-unstable c/s 20711 rightly bumped the domctl
interface version so it is at least possible to handle the new field.
This change accounts for shr_pages field added to xen_domctl_getdomaininfo
structure.

15 years agonetwork/bridge_driver.c: avoid potential NULL-dereference
Jim Meyering [Tue, 5 Jan 2010 14:48:42 +0000 (15:48 +0100)]
network/bridge_driver.c: avoid potential NULL-dereference

* src/network/bridge_driver.c (networkBuildDnsmasqArgv): Correct
test for NULL *argv.

15 years agovirsh: Use VIR_FREE instead of free
Matthias Bolte [Sun, 3 Jan 2010 16:13:27 +0000 (17:13 +0100)]
virsh: Use VIR_FREE instead of free

virsh uses other parts of the internal API already, so use VIR_FREE also.

15 years agovirsh: Add persistent history using libreadline
Matthias Bolte [Sun, 3 Jan 2010 14:45:10 +0000 (15:45 +0100)]
virsh: Add persistent history using libreadline

15 years agoesx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses
Matthias Bolte [Sat, 2 Jan 2010 22:58:24 +0000 (23:58 +0100)]
esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses

The MAC addresses with 00:50:56 prefix are split into several ranges:

  00:50:56:00:00:00 - 00:50:56:3f:ff:ff  'static' range (manually assigned)
  00:50:56:80:00:00 - 00:50:56:bf:ff:ff  'vpx' range (assigned by a VI Client)

Erroneously the 'vpx' range was assumed to be larger and to occupy the
remaining addresses of the 00:50:56 prefix that are not part of the 'static'
range.

00:50:56 was used as prefix for generated MAC addresses, this is not possible
anymore, because there are gaps in the allowed ranges. Therefore, change the
prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway.

Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option
to false in case the MAC address doesn't fall into any predefined range.

* docs/drvesx.html.in: update website accordingly
* src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29
* src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC
  addresses
* tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests

15 years agoesx: Fix deserialization for VI API calls CancelTask and UnregisterVM
Matthias Bolte [Sat, 2 Jan 2010 16:11:12 +0000 (17:11 +0100)]
esx: Fix deserialization for VI API calls CancelTask and UnregisterVM

15 years agoesx: Fix and improve the libcurl debug callback
Matthias Bolte [Sat, 2 Jan 2010 13:18:44 +0000 (14:18 +0100)]
esx: Fix and improve the libcurl debug callback

The data passed to the callback is not guaranteed to be zero terminated,
take care of that by coping the data and adding a zero terminator.

Also dump the data for other types than CURLINFO_TEXT.

Set CURLOPT_VERBOSE to 1 so the debug callback is called when enabled.

15 years agoesx: Don't warn about an empty URI path
Matthias Bolte [Sat, 2 Jan 2010 12:07:29 +0000 (13:07 +0100)]
esx: Don't warn about an empty URI path

15 years agoesx: Also allow virtualHW version 4 for ESX 4.0
Matthias Bolte [Wed, 23 Dec 2009 22:08:21 +0000 (23:08 +0100)]
esx: Also allow virtualHW version 4 for ESX 4.0

A domain with virtualHW version 4 is allowed on an ESX 4.0 server.
If a domain is migrated from an ESX 3.5 server to an ESX 4.0 server
then the virtualHW version stays the same. So a ESX 4.0 server can
host domains with virtualHW version 4.

15 years agoDon't free an uninitalized pointer in update_driver_name()
Matthias Bolte [Wed, 23 Dec 2009 21:18:04 +0000 (22:18 +0100)]
Don't free an uninitalized pointer in update_driver_name()

This invalid free results in heap corruption. Some symptoms I saw
because of this were libvirtd crashing and virt-manager hanging
while trying to enumerate devices.

15 years agoxend_internal: don't let invalid input provoke NULL dereference
Jim Meyering [Wed, 6 Jan 2010 11:59:21 +0000 (12:59 +0100)]
xend_internal: don't let invalid input provoke NULL dereference

* src/xen/xend_internal.c (xenDaemonOpen_unix): Do not dereference
a NULL "conn".  Move first deref to follow the "conn == NULL" test.

15 years agoqemu: Always enable the virtio balloon driver
Adam Litke [Wed, 6 Jan 2010 17:01:51 +0000 (18:01 +0100)]
qemu: Always enable the virtio balloon driver

The behavior for the qemu balloon device has changed.  Formerly, a virtio
balloon device was provided by default.  Now, '-balloon virtio' must be
specified on the command line to enable it.  This patch causes libvirt to
add '-balloon virtio' to the command line whenever the -balloon option is
available.
* src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
  add "-baloon vitio" to qemu command when needed
* tests/qemuhelptest.c: add the new flag for detection

15 years agoDon't update vol details after build
David Allan [Wed, 6 Jan 2010 16:53:15 +0000 (17:53 +0100)]
Don't update vol details after build

This patch removes the call to vol update after the volume build completes.
The update call is currently meaningless anyway because the vol build is passed
a copy of the definition, so the update result is thrown away.  More
importantly, if the user specified a selinux label for the volume, the update
call results in a double free of the label
* src/storage/storage_backend_fs.c: remove the update call

15 years agoDisable building of static Python module
Diego Elio Pettenò [Wed, 6 Jan 2010 16:33:41 +0000 (17:33 +0100)]
Disable building of static Python module

* python/Makefile.am: python modules are loaded at runtime so the static
  version is not needed, avoid building it

15 years agoFix parsing of 'info chardev' line endings
Matthew Booth [Wed, 6 Jan 2010 16:09:04 +0000 (17:09 +0100)]
Fix parsing of 'info chardev' line endings

This change makes the 'info chardev' parser ignore any trailing
whitespace on a line. This fixes a specific problem handling a '\r\n'
line ending.

* src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in
  'info chardev' output.

15 years agovbox_tmpl.c: don't leak a domain pointer upon failure to create
Jim Meyering [Tue, 5 Jan 2010 16:45:46 +0000 (17:45 +0100)]
vbox_tmpl.c: don't leak a domain pointer upon failure to create

* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): "Unref" the domain
upon failure.  Patch by Matthias Bolte.

15 years agovbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure
Jim Meyering [Wed, 16 Dec 2009 12:56:57 +0000 (13:56 +0100)]
vbox_tmpl.c: avoid NULL deref upon vboxDomainCreateXML failure

* src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Don't call
vboxDomainUndefine on a NULL "dom".

15 years agoqemu_driver.c: remove useless, warning-provoking test
Jim Meyering [Tue, 5 Jan 2010 15:32:11 +0000 (16:32 +0100)]
qemu_driver.c: remove useless, warning-provoking test

* src/qemu/qemu_driver.c (qemudDomainMigratePrepare2): Remove useless
test of always-non-NULL uri_out parameter.  Use ATTRIBUTE_NONNULL to
inform tools.

15 years agoqemu_driver.c: avoid NULL dereference upon disk-op failure
Jim Meyering [Wed, 16 Dec 2009 13:15:50 +0000 (14:15 +0100)]
qemu_driver.c: avoid NULL dereference upon disk-op failure

* src/qemu/qemu_driver.c (qemudDomainAttachDevice): Call
virCgroupDenyDevicePath only if cgroup is non-NULL.

15 years agoopenvz_conf.c: don't dereference NULL upon failure
Jim Meyering [Tue, 15 Dec 2009 15:16:57 +0000 (16:16 +0100)]
openvz_conf.c: don't dereference NULL upon failure

* src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref
of "dom".

15 years agoDistribute vmx2xml and xml2vmx test data files
Matthias Bolte [Wed, 23 Dec 2009 22:02:44 +0000 (23:02 +0100)]
Distribute vmx2xml and xml2vmx test data files

15 years agoRelease of libvirt-0.7.5
Daniel Veillard [Wed, 23 Dec 2009 16:00:22 +0000 (17:00 +0100)]
Release of libvirt-0.7.5

15 years agoUpdate and regenerate localizations
Daniel Veillard [Wed, 23 Dec 2009 14:53:32 +0000 (15:53 +0100)]
Update and regenerate localizations

upate of as.po bn_IN.po de.po es.po gu.po hi.po kn.po ml.po mr.po or.po
pa.po pl.po ru.po ta.po te.po zh_CN.po and regeneration

15 years agoThe secret driver is stateful, link it directly to libvirtd
Matthias Bolte [Tue, 22 Dec 2009 13:50:50 +0000 (14:50 +0100)]
The secret driver is stateful, link it directly to libvirtd

All other stateful drivers are linked directly to libvirtd
instead of libvirt.so. Link the secret driver to libvirtd too.

* daemon/Makefile.am: link the secret driver to libvirtd
* daemon/libvirtd.c: add #ifdef WITH_SECRETS blocks
* src/Makefile.am: don't link the secret driver to libvirt.so
* src/libvirt_private.syms: remove the secretRegister symbol

15 years agoRemove undefined symbols from libvirt_private.syms
Matthias Bolte [Wed, 23 Dec 2009 03:07:48 +0000 (04:07 +0100)]
Remove undefined symbols from libvirt_private.syms

MinGW's ld gives an error when trying to export undefined symbols.

15 years agoboolean shadows a typedef in rpcndr.h when compiled with MinGW
Matthias Bolte [Wed, 23 Dec 2009 03:02:26 +0000 (04:02 +0100)]
boolean shadows a typedef in rpcndr.h when compiled with MinGW

Alter the offending variable names to fix this.

15 years agoRename DATADIR to PKGDATADIR to fix win32 build
Jiri Denemark [Wed, 23 Dec 2009 13:29:57 +0000 (14:29 +0100)]
Rename DATADIR to PKGDATADIR to fix win32 build

* src/Makefile.am src/cpu/cpu_map.c: rename in Makefile and in the
  cpu map loading code

15 years agoMove cpu_map.xml to -client RPM
Jiri Denemark [Wed, 23 Dec 2009 13:28:42 +0000 (14:28 +0100)]
Move cpu_map.xml to -client RPM

All the cpu code is part of libvirt library and it might be used by
drivers which do not require libvirtd to be running.

15 years agoconvert missing server entry points into unsupported errors
Daniel Veillard [Tue, 22 Dec 2009 16:44:03 +0000 (17:44 +0100)]
convert missing server entry points into unsupported errors

If using a remote access, sometimes an RPC entry point is not
available, and currently we just end up with a raw:
    error: unknown procedure: xxx
error, while this should be more cleanly reported as an unsupported
entry point like for local access

* src/remote/remote_driver.c: convert missing remote entry points into
  the unsupported feature error

15 years agofix some error report when on remote access
Olivier Fourdan [Tue, 22 Dec 2009 15:49:06 +0000 (16:49 +0100)]
fix some error report when on remote access

When querying about a domain from 0.3.3 (or RHEL 5.3) domain located
on a 0.6.3 (RHEL-5) machine, the errors are not properly reported.
This patch from Olivier Fourdan <ofourdan@redhat.com> , slightly
modified to not change the semantic when the domain os details cannot
be provided

* src/xen/proxy_internal.c src/xen/xen_hypervisor.c: add some missing
  error reports

15 years agoFix undefined reference to 'close_used_without_including_unistd_h'
Matthias Bolte [Tue, 22 Dec 2009 02:06:57 +0000 (03:06 +0100)]
Fix undefined reference to 'close_used_without_including_unistd_h'

Found while trying to cross-compile libvirt on Fedora 12 for Windows.
gnulib redefines 'close' to 'close_used_without_including_unistd_h'
in sys/socket.h if winsock2.h is present and unistd.h has not been
included before sys/socket.h. Reorder some includes to fix this.

15 years agoFix argument type of virProcessInfoSetAffinity dummy function
Matthias Bolte [Tue, 22 Dec 2009 01:03:20 +0000 (02:03 +0100)]
Fix argument type of virProcessInfoSetAffinity dummy function

15 years agoDefine ATTRIBUTE_SENTINEL for GCC < 4.0 too
Matthias Bolte [Mon, 21 Dec 2009 21:21:15 +0000 (22:21 +0100)]
Define ATTRIBUTE_SENTINEL for GCC < 4.0 too

ATTRIBUTE_SENTINEL was defined for GCC >= 4.0 only, resulting in
compile errors when using GCC < 4.0.

15 years agoFix compilation with configure --disable-nls
Matthias Bolte [Mon, 21 Dec 2009 21:16:25 +0000 (22:16 +0100)]
Fix compilation  with configure --disable-nls

15 years agocpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad
Matthias Bolte [Mon, 21 Dec 2009 18:12:45 +0000 (19:12 +0100)]
cpu: Fix memory leaks in x86FeatureLoad and x86ModelLoad

Also backup and restore the original ctxt->node value in x86FeatureLoad.

15 years agoFix configure check for SASL
Matthias Bolte [Mon, 21 Dec 2009 17:58:09 +0000 (18:58 +0100)]
Fix configure check for SASL

The option --with-sasl defaults to 'check', but an inverted test logic
lets the SASL check fail with an error instead of disabling SASL.
Fix the test logic so SASL support gets disabled if SASL is missing and
--with-sasl is set to check.

15 years agoFix GnuTLS pkg-config check
Matthias Bolte [Mon, 21 Dec 2009 17:47:12 +0000 (18:47 +0100)]
Fix GnuTLS pkg-config check

The testlogic for $PKG_CONFIG was inverted, checking for an empty string
before using PKG_CHECK_MODULES. Use -x instead of -z and add an else branch
to the if checking for $GNUTLS_FOUND = no to add -lgcrypt in case the
GnuTLS libraries are detected by pkg-config.

15 years agoReport an error if no XDR library can be found
Matthias Bolte [Mon, 21 Dec 2009 17:37:15 +0000 (18:37 +0100)]
Report an error if no XDR library can be found

15 years agoDisable JSON mode monitor until QEMU is more mature
Daniel P. Berrange [Mon, 21 Dec 2009 20:49:43 +0000 (20:49 +0000)]
Disable JSON mode monitor until QEMU is more mature

* src/qemu/qemu_conf.h: Remove QEMU_CMD_FLAG_0_12 and just leave
  the lone JSON flag
* src/qemu/qemu_conf.c: Enable JSON on QEMU 0.13 or later, but
  leave it disabled for now

15 years agoOnly probe for CPU models if required
Jiri Denemark [Tue, 22 Dec 2009 11:23:56 +0000 (12:23 +0100)]
Only probe for CPU models if required

* src/qemu/qemu_conf.c: CPU models should be probed only if the
  a guest's XML contains CPU model, not each time a qemu command line
  is generated.

15 years agoAdd some people missing from the AUTHORS list
Daniel Veillard [Tue, 22 Dec 2009 11:16:57 +0000 (12:16 +0100)]
Add some people missing from the AUTHORS list

15 years agoAdd cpu_map.xml to libvirt.spec
Jiri Denemark [Tue, 22 Dec 2009 11:09:56 +0000 (12:09 +0100)]
Add cpu_map.xml to libvirt.spec

* libvirt.spec.in: embbed it in the main libvirt binary rpm

15 years agoInstall cpu_map.xml
Jiri Denemark [Tue, 22 Dec 2009 11:06:01 +0000 (12:06 +0100)]
Install cpu_map.xml

* src/Makefile.am: install it in $(pkgdatadir) i.e. /usr/share/libvirt/
  usually

15 years agoMake Xen VT-d PCI attach/detach work
Chris Lalancette [Tue, 22 Dec 2009 09:53:51 +0000 (10:53 +0100)]
Make Xen VT-d PCI attach/detach work

The Xen code for making HVM VT-d PCI passthrough attach and detach
wasn't working properly:

1)  In xenDaemonAttachDevice(), we were always trying to reconfigure
a PCI passthrough device, even the first time we added it.  This was
because the code in virDomainXMLDevID() was not checking xenstore for
the existence of the device, and always returning 0 (meaning that
the device already existed).

2)  In xenDaemonDetachDevice(), we were trying to use "device_destroy"
to detach a PCI device.  While you would think that is the right
method to call, it's actually wrong for PCI devices.  In particular,
in upstream Xen (and soon in RHEL-5 Xen), device_configure is actually
used to destroy a PCI device.

To fix the attach
problem I add a lookup into xenstore to see if the device we are
trying to attach already exists.  To fix the detach problem I change
it so that for PCI detach (only), we use device_configure with the
appropriate sxpr to do the detachment.

* src/xen/xend_internal.c: don't use device_destroy for PCI devices
  and fix the other issues.
* src/xen/xs_internal.c src/xen/xs_internal.h: add
  xenStoreDomainGetPCIID()

15 years agoFix detection of JSON when restarting libvirtd
Daniel P. Berrange [Wed, 9 Dec 2009 18:28:30 +0000 (18:28 +0000)]
Fix detection of JSON when restarting libvirtd

The XML XPath for detecting JSON in the running VM statefile was
wrong causing all VMs to get JSON mode enabled at libvirtd restart.

In addition if a VM was running a JSON enabled QEMU once, and then
altered to point to a non-JSON enabled QEMU later the 'monJSON'
flag would not get reset to 0.

* src/qemu/qemu_driver.c: Fix setting/detection of JSON mode

15 years agoDocument the dommemstat command in the virsh man page
Adam Litke [Mon, 21 Dec 2009 14:24:56 +0000 (15:24 +0100)]
Document the dommemstat command in the virsh man page

* tools/virsh.pod: Provide a basic mention of the dommemstat command in
  the virsh man page.