]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoMove QEMU monitor socket in /var/lib/libvirt/qemu
Daniel P. Berrange [Tue, 25 Aug 2009 15:49:09 +0000 (16:49 +0100)]
Move QEMU monitor socket in /var/lib/libvirt/qemu

Separate the guest created QEMU monitor socket location
from the libvirtd create XML / PID data files, to improve
security separation when running QEMU non-root

* libvirt.spec.in: Leave /var/run/libvirt/qemu as root:root
* src/qemu_conf.h: Add libDir and cacheDir directory paths
* src/qemu_driver.c: Move QEMU monitor socket from
  stateDir to libDir to avoid making security critical directory
  accessible to QEMU guests.
* src/util.c: Delay running hook till after damonizing to
  ensure pidfile is still written before changing UID/GID

15 years agoAvoid polling on FDs with no events enabled
Daniel P. Berrange [Mon, 24 Aug 2009 16:27:55 +0000 (17:27 +0100)]
Avoid polling on FDs with no events enabled

If a file descriptor with events=0 was added to the libvirtd
event loop, it would still be added to the poll() fds' array.
While it wouldn't see any POLLIN/OUT events, it'd still get
triggered for HANGUP/ERROR events which was not in compliance
with the libvirt events API contract.

* qemud/event.c: Don't poll on FDs with events=0
* tests/eventtest.c: Add test case to validate fix to event.c

15 years agoxen_internal.c: remove two unused local variables
Jim Meyering [Thu, 3 Sep 2009 15:11:14 +0000 (17:11 +0200)]
xen_internal.c: remove two unused local variables

* src/xen_internal.c (xenHypervisorSetSchedulerParameters): Remove
set-but-never-used local variables, cap_set and weight_set.

15 years agoesx_vi: return -1 upon failure, as intended
Matthias Bolte [Thu, 3 Sep 2009 14:35:47 +0000 (16:35 +0200)]
esx_vi: return -1 upon failure, as intended

* src/esx/esx_vi.c (esxVI_Enumeration_Deserialize): Fix
reversed goto and result=-1 statements.

15 years agopython: let libvirt_virConnectDomainEventCallback indicate success
Jim Meyering [Thu, 3 Sep 2009 12:09:49 +0000 (14:09 +0200)]
python: let libvirt_virConnectDomainEventCallback indicate success

* python/libvir.c (libvirt_virConnectDomainEventCallback): Return 0
when successful, rather than always returning -1.
clang flagged this function for its dead-store of "ret=0".
Once "ret" was set to 0, it was never used, and
the function would always return -1.

15 years agomdns.c: remove dead initialization
Jim Meyering [Thu, 3 Sep 2009 11:45:22 +0000 (13:45 +0200)]
mdns.c: remove dead initialization

* qemud/mdns.c (libvirtd_mdns_client_callback): Remove dead
initialization.

15 years agonode_device_conf.c: remove dead initialization
Jim Meyering [Thu, 3 Sep 2009 11:38:57 +0000 (13:38 +0200)]
node_device_conf.c: remove dead initialization

* src/node_device_conf.c (virNodeDeviceDefFormat): Remove dead
initialization.

15 years agoopenvz_conf.c: don't use undefined local, "net"
Jim Meyering [Thu, 3 Sep 2009 10:33:11 +0000 (12:33 +0200)]
openvz_conf.c: don't use undefined local, "net"

* src/openvz_conf.c (openvzReadNetworkConf): Initialize "net".
Otherwise, upon openvzRead... failure, we would "goto error;"
where an uninitialized "net" could be dereferenced.

15 years agotest.c: don't use undefined local, "def"
Jim Meyering [Thu, 3 Sep 2009 10:12:19 +0000 (12:12 +0200)]
test.c: don't use undefined local, "def"

* src/test.c (testOpenVolumesForPool): Upon early virAsprintf or
virXPathNodeSet failure, "goto error" would take us to
virStorageVolDefFree(def), but with "def" not defined.
Initialize it to NULL.

15 years agouml_conf.c: don't return an uninitialized pointer
Jim Meyering [Thu, 3 Sep 2009 10:05:52 +0000 (12:05 +0200)]
uml_conf.c: don't return an uninitialized pointer

* src/uml_conf.c (umlBuildCommandLineChr): Initialize "ret".

15 years agostorage_backend.c: assure clang that inputvol can't be NULL
Jim Meyering [Thu, 3 Sep 2009 08:22:57 +0000 (10:22 +0200)]
storage_backend.c: assure clang that inputvol can't be NULL

* src/storage_backend.c: Include "internal.h".
(virStorageBackendCopyToFD): Mark inputvol parameter as "nonnull".
Remove test for non-NULL inputvol.  Both callers ensure it's non-NULL.

15 years agolibvir.c: avoid NULL dereference in virStoragePoolSetAutostart
Jim Meyering [Wed, 2 Sep 2009 15:47:51 +0000 (17:47 +0200)]
libvir.c: avoid NULL dereference in virStoragePoolSetAutostart

* src/libvirt.c (virStoragePoolSetAutostart): Return -1 if the pool
argument is invalid, rather than "goto error" where we could dereference
that possibly-NULL "pool".
(virConnectFindStoragePoolSources): Likewise.
(virConnectNumOfDomains): Likewise.
Daniel P. Berrange spotted that the two latter functions
needed the same treatment.

15 years agoremote_internal.c: appease clang
Jim Meyering [Wed, 2 Sep 2009 10:22:14 +0000 (12:22 +0200)]
remote_internal.c: appease clang

* src/remote_internal.c (remoteNetworkOpen): Mark "conn" parameter
as non-NULL.  Remove now-unnecessary "conn == NULL" test.
(remoteDevMonOpen): Likewise.
(remoteSecretOpen): Likewise.
(remoteStorageOpen): Likewise.
(remoteInterfaceOpen): Likewise.

15 years agoinfra: define ATTRIBUTE_NONNULL to mark non-NULL parameters
Jim Meyering [Wed, 2 Sep 2009 10:20:32 +0000 (12:20 +0200)]
infra: define ATTRIBUTE_NONNULL to mark non-NULL parameters

* src/internal.h (ATTRIBUTE_NONNULL): Define.

15 years agolxc: don't unlink(NULL) in main
Jim Meyering [Wed, 2 Sep 2009 08:02:49 +0000 (10:02 +0200)]
lxc: don't unlink(NULL) in main

* src/lxc_controller.c (main): Unlink sockpath only if it's non-NULL.

15 years agolxc: avoid NULL dereference upon getmntent failure
Jim Meyering [Wed, 2 Sep 2009 07:58:50 +0000 (09:58 +0200)]
lxc: avoid NULL dereference upon getmntent failure

* src/lxc_container.c (lxcContainerUnmountOldFS): Don't pass
a NULL pointer to qsort.

15 years agostorage_conf.c: avoid overflow upon use of "z" or "Z" (zebi) suffix
Jim Meyering [Wed, 2 Sep 2009 07:58:28 +0000 (09:58 +0200)]
storage_conf.c: avoid overflow upon use of "z" or "Z" (zebi) suffix

* src/storage_conf.c (virStorageSize): Don't try to compute 1024^7,
since it's too large for a 64-bit type.

15 years agostorage_backend_fs: avoid NULL dereference on opendir failure
Jim Meyering [Wed, 2 Sep 2009 07:42:32 +0000 (09:42 +0200)]
storage_backend_fs: avoid NULL dereference on opendir failure

* src/storage_backend_fs.c (virStorageBackendFileSystemRefresh):
Don't call closedir on a NULL pointer.

15 years agoVBox cleanup and update of networking shutdown
Pritesh Kothari [Thu, 3 Sep 2009 15:08:52 +0000 (17:08 +0200)]
VBox cleanup and update of networking shutdown

* src/vbox/vbox_tmpl.c: merged vboxNetworkUndefine() and
  vboxNetworkDestroy() and added code to handle multiple hostonly
  interfaces.

15 years agoVBox cleanup and update of networking XML functions
Pritesh Kothari [Thu, 3 Sep 2009 15:06:03 +0000 (17:06 +0200)]
VBox cleanup and update of networking XML functions

* src/vbox/vbox_tmpl.c: merged vboxNetworkCreateXML() and
  vboxNetworkDefineXML() and added code to handle multiple hostonly
  interfaces.

15 years agoAdd support for setting disk drive serial numbers
Daniel P. Berrange [Fri, 14 Aug 2009 11:22:01 +0000 (12:22 +0100)]
Add support for setting disk drive serial numbers

* docs/schemas/domain.rng: Add <serial> element to disks
* src/domain_conf.h, src/domain_conf.c: XML parsing and
  formatting for disk serial numbers
* src/qemu_conf.c: Set serial number when launching guests
* tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
  tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
  serial number to XML test

15 years agoSupport configuration of huge pages in guests
Daniel P. Berrange [Tue, 25 Aug 2009 14:05:18 +0000 (15:05 +0100)]
Support configuration of huge pages in guests

Add option to domain XML for

     <memoryBacking>
        <hugepages/>
     </memoryBacking>

* configure.in: Add check for mntent.h
* qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
  Add 'hugetlbfs_mount' config parameter
* src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
  and pass it when hugepages are requested.
  Load hugetlbfs_mount config parameter, search for mount if not given.
* src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
  Create directory for QEMU hugepage usage, chowning if required.
* docs/formatdomain.html.in: Document memoryBacking/hugepages elements
* docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
* src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
  helper API
* tests/qemuhelptest.c: Add -mem-path constants
* tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
  handling
* tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
  tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
  hugepage tests

15 years agoFix misc OOM bugs
Daniel P. Berrange [Wed, 2 Sep 2009 14:09:04 +0000 (15:09 +0100)]
Fix misc OOM bugs

* tests/testutils.c: Run test function twice, once to prime it for
  static allocations, once to count the non-static allocations.
* tests/testutilsqemu.c: Initialize variable correctl
* src/capabilities.c: Don't free machines variable upon failure
  since caller must do that
* src/xm_internal.c: Add missing check for OOM in building VIF
  config param

15 years agoVBox support for defining/dumping video devices
Pritesh Kothari [Thu, 3 Sep 2009 08:36:44 +0000 (10:36 +0200)]
VBox support for defining/dumping video devices

* src/vbox/vbox_tmpl.c: add setting of video and acceleration in
  VBox driver, and the ability to save this back for serialization

15 years agoGeneric parsing support for video acceleration
Pritesh Kothari [Thu, 3 Sep 2009 08:26:41 +0000 (10:26 +0200)]
Generic parsing support for video acceleration

* docs/schemas/domain.rng: augment the video model with an optional
  acceleration element with optional accel2d and accel3d flags
* src/domain_conf.c src/domain_conf.h: exten the virDomainVideoDef
  structure with an optional accel field, virDomainVideoAccelDefParseXML
  and virDomainVideoAccelDefFormat functions to parse and serialize
  the structure.

15 years agoFix bugs in virDomainMigrate v2 code.
Chris Lalancette [Tue, 25 Aug 2009 15:23:12 +0000 (17:23 +0200)]
Fix bugs in virDomainMigrate v2 code.

Paolo Bonzini points out that in my refactoring of the code for
virDomainMigrate(), I added a check for the return value from
virDomainMigratePerform().  The problem is that we don't want to
exit if we fail, we actually want to go on and do
virDomainMigrateFinish2() with a non-0 return code to clean things
up.  Remove the check.

While reproducing this issue, I also noticed that we wouldn't
always properly propagate an error message.  In particular, I
found that if you blocked off the migration ports (with iptables)
and then tried the migration, it would actually fail but we would
get no failure output from Qemu.  Therefore, we would think we
succeeded, and leave a huge mess behind us.  Execute the monitor
command "info migrate", and look for a failure string in there
as well.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoVMware ESX: Don't warn on some query parameter
Matthias Bolte [Wed, 2 Sep 2009 14:32:30 +0000 (16:32 +0200)]
VMware ESX: Don't warn on some query parameter

* src/esx/esx_util.c: esxUtil_ParseQuery() warns if a known query
  parameter should be ignored due to the corresponding char/int pointer
  being NULL, instead of silently ignoring it. Fix the control flow.

15 years agoVMware ESX: Allow ethernet address type 'vpx'
Matthias Bolte [Wed, 2 Sep 2009 14:22:17 +0000 (16:22 +0200)]
VMware ESX: Allow ethernet address type 'vpx'

* src/esx/esx_vmx.c: add an extra type of addressType beside 'static'
  and 'generated', 'vpx' indicates that the MAC address was generated
  by a vCenter.

15 years agoDon't blindly reorder disk drives
Daniel P. Berrange [Fri, 14 Aug 2009 09:31:36 +0000 (10:31 +0100)]
Don't blindly reorder disk drives

Calling qsort() on the disks array causes disk to be
unneccessarily re-ordered, potentially breaking the
ability to boot if the boot disk gets moved later in
the list. The new algorithm will insert a new disk as
far to the end of the list as possible, while being
ordered correctly wrt other disks on the same bus.

* src/domain_conf.c, src/domain_conf.h: Remove disk sorting
  routines. Add API to insert a disk into existing list at
  the optimal position, without resorting disks
* src/libvirt_private.syms: Export virDomainDiskInsert
* src/xend_internal.c, src/xm_internal.c: Remove calls to
  qsort, use virDomainDiskInsert instead.
* src/qemu_driver.c: Remove calls to qsort, use virDoaminDiskInsert
  instead. Fix reordering bugs when hotunplugging disks and
  networks. Fix memory leak in disk/net unplug

15 years agoSupport for getting/setting number of cpus in VBox
Pritesh Kothari [Wed, 2 Sep 2009 14:08:14 +0000 (16:08 +0200)]
Support for getting/setting number of cpus in VBox

* src/vbox/vbox_tmpl.c: adds support for getting/setting number of cpus

15 years agoMisc fixes to secrets API code
Daniel P. Berrange [Tue, 1 Sep 2009 20:37:42 +0000 (21:37 +0100)]
Misc fixes to secrets API code

* proxy/Makefile.am: Build storage_encryption_conf.c since its a
  dependancy of domain_conf.c
* src/storage_encryption_conf.c: Disable XML parsing APis when
  build under proxy
* src/test.c: Add a dummy no-op secrets driver for test suite

15 years agoOnly add glusterfs dep for Fedora >= 11
Daniel P. Berrange [Tue, 1 Sep 2009 20:19:38 +0000 (21:19 +0100)]
Only add glusterfs dep for Fedora >= 11

* libvirt.spec.in: Conditionalize glusterfs requires line for
  Fedora >= 11, since other distros don't have it available

15 years agoRemove redundant base64 include file
Daniel P. Berrange [Tue, 1 Sep 2009 20:17:51 +0000 (21:17 +0100)]
Remove redundant base64 include file

* src/storage_encryption_conf.c: Remove base64.h

15 years agoAdd Miloslav Trmač to AUTHORS file
Daniel P. Berrange [Tue, 1 Sep 2009 17:37:38 +0000 (18:37 +0100)]
Add Miloslav Trmač to AUTHORS file

15 years agoMake handling of monitor prompts more general.
Miloslav Trmač [Tue, 21 Jul 2009 09:35:08 +0000 (11:35 +0200)]
Make handling of monitor prompts more general.

* src/qemu_driver.c: Support arbitrary callbacks for "secondary
  prompts".  Reimplement qemudMonitorCommandExtra using such a
  callback.

15 years agoDon't assume buffered output echoes the command.
Miloslav Trmač [Tue, 21 Jul 2009 09:33:24 +0000 (11:33 +0200)]
Don't assume buffered output echoes the command.

The if ((nlptr...)) implicitly assumes commptr != NULL (and that "buf"
starts with "cmd").  Make the assumption explicit, it will be broken in
a future patch.

* src/qemu_driver.c: Don't assume buffered monitor output echoes the
  command.

15 years agoAttach encryption information to virDomainDiskDef.
Miloslav Trmač [Tue, 21 Jul 2009 05:23:03 +0000 (07:23 +0200)]
Attach encryption information to virDomainDiskDef.

The XML allows <encryption format='unencrypted'/>, this implementation
canonicalizes the internal representation so that "disk->encryption" is
non-NULL iff encryption information is available.

A domain with partial encryption information can be defined,
completeness of the information is not verified.  The domain won't
start until the remaining information is added, of course.

* docs/formatdomain.html, docs/formatdomain.html.in: Document
  new encryption options for disks
* docs/schemas/domain.rng: Pull in storage encryption schema
  rules
* src/domain_conf.h, src/domain_conf.c: Wire up storage encryption
  XML parsing/formatting APIs

15 years agoAdd support for encrypted (qcow) volume creation.
Miloslav Trmač [Tue, 21 Jul 2009 02:40:50 +0000 (04:40 +0200)]
Add support for encrypted (qcow) volume creation.

Supports only virStorageVolCreateXML, not virStorageVolCreateXMLFrom.

Curiously, qemu-img does not need the passphrase for anything to create
an encrypted volume.  This implementation thus does not need to touch
any secrets to work with cooperating clients.  More generic passphrase
handling is added in the next patch.

* src/storage_backend.c: Request encryption when creating qcow/qcow2
  files
* src/storage_backend_disk.c, src/storage_backend_fs.c,
  src/storage_backend_logical.c: Refuse to create volumes with
  encryption params set.

15 years agoRecognize encryption format of qcow volumes.
Miloslav Trmač [Mon, 20 Jul 2009 23:26:09 +0000 (01:26 +0200)]
Recognize encryption format of qcow volumes.

(The implementation is not very generic, but that can be very
easily rectified if/when new encryption formats appear.)

* src/storage_backend_fs.c: Probe for qcow/qcow2 encryption
  algorithm field

15 years agoAttach encryption information to virStorageVolDef.
Miloslav Trmač [Mon, 20 Jul 2009 22:28:11 +0000 (00:28 +0200)]
Attach encryption information to virStorageVolDef.

The XML allows <encryption format='unencrypted'/>, this implementation
canonicalizes the internal representation so that "vol->encryption" is
non-NULL iff the volume is encrypted.

Note that partial encryption information (e.g. specifying an encryption
format, but not the key/passphrase) is valid, libvirt will automatically
choose value for the missing information during volume creation.  The
user can read the volume XML, and use the unmodified <encryption> tag in
future operations (without having to be able to understand) its contents.

* docs/formatstorage.html, docs/formatstorage.html.in: Document
  storage volume encryption options
* src/storage_conf.c, src/storage_conf.h: Hook up storage
  encryption XML handling
* tests/storagevolschemadata/vol-qcow2.xml: Test case for encryption
  schema changes

15 years agoAdd volume encryption information handling.
Miloslav Trmač [Wed, 19 Aug 2009 19:50:10 +0000 (21:50 +0200)]
Add volume encryption information handling.

Define an <encryption> tag specifying volume encryption format and
format-depenedent parameters (e.g. passphrase, cipher name, key
length, key).

Currently the only defined parameter is a reference to a "secret"
(passphrase/key) managed using the virSecret* API.

Only the qcow/qcow2 encryption format, and a "default" format used to
let libvirt choose the format during volume creation, is currently
supported.

This patch does not add any users; the <encryption> tag is added in
the following patches to both volumes (to support encrypted volume
creation) and domains.

* docs/*.html: Re-generate
* docs/formatstorageencryption.html.in, docs/sitemap.html.in:
  Add page describing storage encryption data format
* docs/schemas/Makefile.am, docs/schemas/storageencryption.rng:
  Add RNG schema for storage encryption format
* po/POTFILES.in: Add src/storage_encryption_conf.c
* src/libvirt_private.syms: Export virStorageEncryption* functions
* src/storage_encryption_conf.h, src/storage_encryption_conf.c: Internal
  helper APIs for dealing with storage encryption format
* libvirt.spec.in, mingw32-libvirt.spec.in: Add storageencryption.rng
  RNG schema

15 years agoSecret manipulation API docs refresh & wire up python generator
Miloslav Trmač [Tue, 4 Aug 2009 18:38:21 +0000 (20:38 +0200)]
Secret manipulation API docs refresh & wire up python generator

Sample session:

>>> import libvirt
>>> c = libvirt.open('qemu:///session')

>>> c.listSecrets()
['12247729-47d2-a783-88ce-b329d4781cd3', 'reee', 'abc']

>>> s = c.secretDefineXML("<secret ephemeral='no' private='no'>\n<description>Something for use</description>\n<volume>/foo/bar</volume>\n</secret>\n")

>>> s.UUIDString()
'340c2dfb-811b-eda8-da9e-25ccd7bfd650'

>>> s.XMLDesc()
"<secret ephemeral='no' private='no'>\n  <uuid>340c2dfb-811b-eda8-da9e-25ccd7bfd650</uuid>\n  <description>Something for use</description>\n  <volume>/foo/bar</volume>\n</secret>\n"

>>> s.setValue('abc\0xx\xffx')
0

>>> s.value()
'abc\x00xx\xffx'

>>> s.undefine()
0

* python/generator.py: Add rules for virSecret APIs
* python/libvir.c, python/libvirt-python-api.xml: Manual impl of
  virSecretSetValue, virSecretGetValue$ and virConnectListSecrets APIs
* python/libvirt_wrap.h, python/types.c: Wrapper for virSecret objects
* docs/libvirt-api.xml, docs/libvirt-refs.xml,
  docs/html/libvirt-virterror.html, docs/html/libvirt-libvirt.html,
  docs/devhelp/libvirt-virterror.html, docs/devhelp/libvirt-libvirt.html:
  Re-generate with 'make api'

15 years agoSecret manipulation remote client
Miloslav Trmač [Tue, 28 Jul 2009 02:46:01 +0000 (04:46 +0200)]
Secret manipulation remote client

* src/remote_internal.c: Implement client binding for new secrets
  APIs
* src/datatypes.h: Add 'void *secretPrivateData' to virConnectPtr
  struct

15 years agoSecret manipulation libvirtd wire protocol & remote dispatcher
Miloslav Trmač [Tue, 28 Jul 2009 02:01:00 +0000 (04:01 +0200)]
Secret manipulation libvirtd wire protocol & remote dispatcher

* qemud/remote_protocol.x: Define wire protocol for secrets public
  APIs
* qemud/remote_protocol.h, qemud/remote_protocol.c,
  qemud/remote_dispatch_table.h, qemud/remote_dispatch_ret.h,
  qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_args.h:
  Re-generate from updated protocol definition
* qemud/remote.c: Implement RPC dispatchers for new secrets APIs

15 years agoSecret manipulation public API implementation
Miloslav Trmač [Tue, 28 Jul 2009 01:25:39 +0000 (03:25 +0200)]
Secret manipulation public API implementation

* include/libvirt/virterror.h, src/virterror.c: Add VIR_ERR_INVALID_SECRET
  and VIR_FROM_SECRET
* src/libvirt.c: Define stubs for every new public API

15 years agoSecret manipulation internal API
Miloslav Trmač [Fri, 14 Aug 2009 19:42:19 +0000 (21:42 +0200)]
Secret manipulation internal API

* include/libvirt/virterror.h, src/virterror.c: Add VIR_WAR_NO_SECRET
* src/libvirt_private.syms, src/datatypes.h, src/datatypes.c: Type
  virSecret struct definition and helper APIs
* src/driver.h: Sub-driver API definitions for secrets
* src/libvirt.c: Define new sub-driver for secrets

15 years agoSecret manipulation public API
Miloslav Trmač [Tue, 28 Jul 2009 00:39:48 +0000 (02:39 +0200)]
Secret manipulation public API

This patch adds a "secret" as a separately managed object, using a
special-purpose API to transfer the secret values between nodes and
libvirt users.

* docs/schemas/secret.rng, docs/schemas/Makefilem.am: Add new
  schema for virSecret objects
* docs/*html: Re-generated
* docs/formatsecret.html.in, docs/sitemap.html.in: Add page
  describing the virSecret XML schema
* include/libvirt/libvirt.h.in: Define the new virSecret public
  API
* src/libvirt_public.syms: Export symbols for new public APIs
* mingw32-libvirt.spec.in, libvirt.spec.in: Add secret.rng to
  files list

15 years agoUpdate chinese, polish and spanish localizations
Daniel Veillard [Tue, 1 Sep 2009 13:09:21 +0000 (15:09 +0200)]
Update chinese, polish and spanish localizations

* po/*: and update the po set

15 years agosupport lzop save compression for qemu
Charles Duffy [Fri, 28 Aug 2009 18:13:47 +0000 (13:13 -0500)]
support lzop save compression for qemu

Per prior discussion -- this was, indeed, trivial.

I'm a little disappointed to be breaking the ordering characteristics of
the enum (as it had been ordered by increasing time requirements and
decreasing output size), but breaking any save files with the old
constants in the headers would of course be worse.

>From 2a9cdcfc88de091a8d34aa3fc3b1208d7681790e Mon Sep 17 00:00:00 2001
From: Charles Duffy <Charles_Duffy@dell.com>
Date: Fri, 28 Aug 2009 11:49:54 -0500
Subject: [PATCH] support lzop save compression for qemu

One of the larger disincentives towards use of compression for migrated-out save
files is performance impact. This patch adds support for lzop; CPU time for
compression is about 5x faster than gzip (the next most performant algorithm)
and decompression is about 3x faster.

Signed-off-by: Charles Duffy <Charles_Duffy@dell.com>
Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoOpenVZ: accept NULL as type for GetMaxVCPUs.
Chris Lalancette [Mon, 17 Aug 2009 12:24:27 +0000 (14:24 +0200)]
OpenVZ: accept NULL as type for GetMaxVCPUs.

All of the other drivers that support the getMaxVcpus callback
also accept a NULL value for type.  Make openvz also accept a
NULL value.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoRemove use of strncpy in qemudExtractMonitorPath.
Chris Lalancette [Mon, 3 Aug 2009 15:07:19 +0000 (17:07 +0200)]
Remove use of strncpy in qemudExtractMonitorPath.

qemudExtractMonitorPath() was doing a VIR_ALLOC_N followed by a
strncpy.  However, this isn't necessary; we can do the same thing
using strndup, which is much safer.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up virNodeGetCellsFreeMemory
Chris Lalancette [Fri, 21 Aug 2009 12:16:13 +0000 (14:16 +0200)]
Fix up virNodeGetCellsFreeMemory

The documentation for virNodeGetCellsFreeMemory claims the values
returned are in kilobytes, but that's actually wrong; the value
returned is actually in bytes.  Fix up the documentation to be
correct.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix sexpr2string() to handle empty list.
Jim Fehlig [Tue, 25 Aug 2009 21:54:18 +0000 (15:54 -0600)]
Fix sexpr2string() to handle empty list.

S-expression containing empty lists, e.g. (cpus (() () () ())),
was not being handled properly in sexpr2string() serialization.
Emit an empty list when encountering NIL sexpr kind.

15 years agoFix driver entry table for UML numa APIs
Daniel P. Berrange [Thu, 27 Aug 2009 18:13:11 +0000 (19:13 +0100)]
Fix driver entry table for UML numa APIs

* src/uml_driver.c: Fix numa API driver entries to avoid
  infinite loop

15 years agoFix crash in virsh vol-key command
Pritesh Kothari [Thu, 27 Aug 2009 17:47:41 +0000 (18:47 +0100)]
Fix crash in virsh vol-key command

* src/virsh.c: Pass in pool object to avoid crash in key lookup

15 years agoRefactor policycode auth code to avoid compiler warnings
Daniel P. Berrange [Tue, 25 Aug 2009 16:18:27 +0000 (17:18 +0100)]
Refactor policycode auth code to avoid compiler warnings

* src/remote_internal.c: Split remoteAuthPolkit into separate
  impls for v0 and v1 to avoid compile warnings due to unused
  variables/params
* qemud/remote.c: Remove accidental tabs

15 years agoSupport new PolicyKit 1.0 API
Daniel P. Berrange [Thu, 6 Aug 2009 12:54:08 +0000 (13:54 +0100)]
Support new PolicyKit 1.0 API

* configure.in: Check for pkcheck which indicates new policykit
* qemud/Makefile.am: Install different versions of policy
* qemud/libvirtd.policy: Rename to libvirtd.policy-0
* qemud/libvirtd.policy-1: new style policy
* qemud/qemud.c, qemud/qemud.h, qemud/remote.c: Support new
  policykit API via external pkcheck helper
* src/remote_internal.c: Don't prompt for polkit auth with new
  policykit API
* libvirt.spec.in: deal with new policy install locations & deps

15 years ago517157 fix selinux problem with images on NFS
Darryl L. Pierce [Fri, 21 Aug 2009 14:57:29 +0000 (16:57 +0200)]
517157 fix selinux problem with images on NFS

* src/security_selinux.c: ignores EOPNOTSUPP when attempting to access an
  NFS share

15 years agospec file: add URL to Source tag
Mark McLoughlin [Fri, 21 Aug 2009 10:10:37 +0000 (11:10 +0100)]
spec file: add URL to Source tag

See https://fedoraproject.org/wiki/Packaging:SourceURL

15 years agoFix phypOpen() escape_specialcharacters
Mattias Bolte [Thu, 20 Aug 2009 11:59:07 +0000 (13:59 +0200)]
Fix phypOpen() escape_specialcharacters

Matthias correctly points out that escape_specialcharaters() takes a
length, and since we are now malloc()'ing string in phypOpen instead of
making it a static array, we can't use sizeof(string) anymore.  Calculate
the proper strlen and then use that both to allocate the string and also
pass it to escape_specialcharacters().

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoPower Hypervisor: fix potential segfault
Mattias Bolte [Thu, 20 Aug 2009 10:32:19 +0000 (12:32 +0200)]
Power Hypervisor: fix potential segfault

I came across this line in the phypOpen function:

char string[strlen(conn->uri->path)];

Here the path part of the given URI is used without checking it for
NULL, this can cause a segfault as strlen expects a string != NULL.
Beside that uuid_db and connection_data leak in case of an error.

In this line

conn->uri->path = string;

the original path of the URI leaks. The patch adds a VIR_FREE call
before setting the new path.

The attached patch is compile-tested but I don't have a Power
Hypervisor installation at hand to test it for real.

Matthias

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoSmall fixes for qemu save compression.
Chris Lalancette [Mon, 17 Aug 2009 10:34:53 +0000 (12:34 +0200)]
Small fixes for qemu save compression.

Fix up a small memory leak pointed out by DanB; I was forgetting
to release memory allocated to driver->saveImageFormat.
Also add the "save_image_format" and "security" entries to
the augeas lens.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd test for recently fixed crash with latest XenD
Daniel P. Berrange [Tue, 18 Aug 2009 21:10:41 +0000 (22:10 +0100)]
Add test for recently fixed crash with latest XenD

Test case for the fix applied in

  commit 14435163a086c0bcdff04308077fa46a5fa08bb0
  Author: Daniel Veillard <veillard@redhat.com>
  Date:   Fri Jun 26 18:14:16 2009 +0000

* tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.sexpr,
  tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml: Data
  files exhibiting the crash
* tests/sexpr2xmltest.c: Process new data files

15 years agoFix some typos & remove unhelpful acronyms in QEMU docs
Daniel P. Berrange [Wed, 19 Aug 2009 16:02:45 +0000 (17:02 +0100)]
Fix some typos & remove unhelpful acronyms in QEMU docs

15 years agoAdd documentation about the QEMU driver security features
Daniel P. Berrange [Wed, 19 Aug 2009 13:17:17 +0000 (14:17 +0100)]
Add documentation about the QEMU driver security features

* docs/drvqemu.html.in: Document DAC usage, SELinux integration,
  Linux capabilities, and Cgroups device ACLs

15 years agoFix bridge/tap system error reporting
Mark McLoughlin [Tue, 18 Aug 2009 13:15:58 +0000 (14:15 +0100)]
Fix bridge/tap system error reporting

* src/qemu_conf.c, src/uml_conf.c: use virReportSystemError() to report
  system errors

15 years agoDon't expose 'vnet%d' to the user
Mark McLoughlin [Tue, 18 Aug 2009 12:32:42 +0000 (13:32 +0100)]
Don't expose 'vnet%d' to the user

https://bugzilla.redhat.com/517371

Matt Booth points out that if you use a non-existent bridge name when
start a guest you get a weird error message:

  Failed to add tap interface 'vnet%d' to bridge 'virbr0'

and dev='vnet%d' appears in the dumpxml output.

Fix that by not including 'vnet%d' in the error message and freeing the
'vnet%d' string if adding the tap device to the bridge fails.

* src/qemu_conf.c, src/uml_conf.c: fix qemudNetworkIfaceConnect()
  and umlConnectTapDevice() to not expose 'vnet%d' to the user

15 years agoMaintain a list of active PCI hostdevs and use it in pciResetDevice()
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Maintain a list of active PCI hostdevs and use it in pciResetDevice()

As we start/shutdown guests, or hotplug/hot-unplug devices, we can add
or delete devices as appropriate from a list of active devices.

Then, in pciReset(), we can use this to determine whether its safe to
reset a device as a side effect of resetting another device.

* src/qemu_conf.h: add activePciHostdevs to qemud_driver

* src/qemu_driver.c: maintain the activePciHostdevs list, and pass it
  to pciResetDevice()

* src/pci.[ch]: pass the activeDevs list to pciResetDevice() and use
  it to determine whether a Secondary Bus Reset is safe

15 years agoSimplify PCI hostdev prepare/re-attach using a pciDeviceList type
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Simplify PCI hostdev prepare/re-attach using a pciDeviceList type

The qemuPrepareHostDevices() and qemuDomainReAttachHostDevices()
functions are clutter with a bunch of calls to pciGetDevice() and
pciFreeDevice() obscuring the basic logic.

Add a pciDeviceList type and add a qemuGetPciHostDeviceList() function
to build a list from a domain definition. Use this in prepare/re-attach
fto simplify things and eliminate the multiple pciGetDevice calls.

This is especially useful because in the next patch we need to iterate
the hostdevs list a third time and we also need a list type for keeping
track of active devices.

* src/pci.[ch]: add pciDeviceList type and also a per-device 'managed'
  property

* src/libvirt_private.syms: export the new functions

* src/qemu_driver.c: add qemuGetPciHostDeviceList() and re-write
  qemuPrepareHostDevices() and qemuDomainReAttachHostDevices() to use it

15 years agoUse pci_addr=auto with QEMU's pci_add monitor command
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Use pci_addr=auto with QEMU's pci_add monitor command

Newer versions of QEMU accept 'pci_add auto', but older versions require
'pci_add pci_addr=auto'

* src/qemu_driver.c: use pci_addr= in qemudDomainAttachHostPciDevice()
  for older versions of QEMU

15 years agoFix thinko in PCI hostdev detach
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Fix thinko in PCI hostdev detach

* src/qemu_driver.c: Add missing break statement in
  qemudDomainDetachHostDevice()

15 years agoReset PCI host devices after hot-unplug
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Reset PCI host devices after hot-unplug

When we hot-unplug a PCI host device from a guest, we should reset it.

Both managed and unmanaged devices should be reset, but only managed
devices should be re-attached.

* src/qemu_driver.c: reset devices in qemudDomainDetachHostPciDevice()

15 years agoReset unmanaged PCI host devices before hotplug
Mark McLoughlin [Mon, 17 Aug 2009 14:05:23 +0000 (15:05 +0100)]
Reset unmanaged PCI host devices before hotplug

Right now we're only resetting managed devices before hotplug, but we
should reset them irrespective of whether they are managed.

* src/qemu_driver.c: reset all PCI hostdevs before hotplug

15 years agoRevert changes to allow pciResetDevice() reset multiple devices
Mark McLoughlin [Mon, 17 Aug 2009 14:05:22 +0000 (15:05 +0100)]
Revert changes to allow pciResetDevice() reset multiple devices

It turns out that the previous attempt at this doesn't work well
in the case of hotplug. We need qemuCheckPciHostDevice() to
disallow the reset affecting devices already attach to the guest,
but we still need to avoid double locking the virDomainObjPtr.

This is all getting messy, I've a better idea.

This reverts commit 6318808270dd7679cd5dc082dcf2c7d85a432bd6 and
c106c8a18c63d9e4f2547724a4a563706f8f6778.

* src/qemu_driver.c, src/pci.[ch], src/xen_unified.c,
  src/libvirt_private.syms: revert a bunch of stuff.

15 years agoFix list updating after disk/network/hostdev hot-unplug
Mark McLoughlin [Mon, 17 Aug 2009 14:05:22 +0000 (15:05 +0100)]
Fix list updating after disk/network/hostdev hot-unplug

The current code makes a poor effort at updating the device arrays after
hot-unplug. Fix that and combine the two code paths into one.

* src/qemu_driver.c: fix list updating in qemudDomainDetachNetDevice(),
  qemudDomainDetachPciDiskDevice() and qemudDomainDetachHostPciDevice()

15 years agoRe-name remote_internal.c:driver to remote_driver
Mark McLoughlin [Mon, 17 Aug 2009 14:05:22 +0000 (15:05 +0100)]
Re-name remote_internal.c:driver to remote_driver

Confused me when poking at another 'driver' variable in gdb which gcc
had optimized away

* src/remote_internal.c: rename driver to remote_driver

15 years agoCosmetic change to 'virsh nodedev-list --tree' output
Mark McLoughlin [Mon, 17 Aug 2009 14:05:22 +0000 (15:05 +0100)]
Cosmetic change to 'virsh nodedev-list --tree' output

Maybe it's just me, but I try to select an item from the tree using
double-click and get annoyed when "+-" gets included in the selection.

* src/virsh.c: add a space between "+-" and the node device name
  in 'virsh nodedev-list --tree'

15 years agoFix up connection reference counting.
Chris Lalancette [Tue, 11 Aug 2009 13:48:59 +0000 (15:48 +0200)]
Fix up connection reference counting.

Currently the reference counting for connections is busted.  I
first noticed it while trying to use virConnectRef; it would
eventually cause a crash in the remote_internal driver, although
that was really just a victim.  Really, we should only call the
close callbacks on the methods when the references drop to 0.  To
accomplish this, move all of the close callbacks into
virUnrefConnect (since there are lots of internal users of that
function), and arrange for virConnectClose to call that.

V2: Make sure to drop the connection lock before we call the close
    callbacks, otherwise we could deadlock the daemon
V3: Fix up a crash when we got an error from one of the drivers

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix LXC driver crash when kernel doesn't support clone
Daniel P. Berrange [Wed, 12 Aug 2009 10:07:41 +0000 (11:07 +0100)]
Fix LXC driver crash when kernel doesn't support clone

* src/domain_conf.c: Make virDomainObjListFree a no-op if list
  is NULL
* src/domain_event.c: make virDomainEventCallbackListFree a no-op
  if event list is NULL
* src/lxc_driver.c: Log a message if LXC driver does not startup
  due to lacking kernel support

15 years agoCompressed save image format for Qemu.
Chris Lalancette [Fri, 7 Aug 2009 11:34:05 +0000 (13:34 +0200)]
Compressed save image format for Qemu.

Implement a compressed save image format for qemu.  While ideally
we would have the choice between compressed/non-compressed
available to the libvirt API, unfortunately there is no "flags"
parameter to the virDomainSave() API.  Therefore, implement this
as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
it should be very easy to implement additional compression
methods.

One open question is if/how we should detect the compression
binaries.  One way to do it is to do compile-time setting of the
paths (via configure.in), but that doesn't seem like a great thing
to do.  My preferred solution is not to detect at all;
when we go to run the commands that need them, if they
aren't available, or aren't available in one of the standard paths,
then we'll fail.  That's also the solution implemented in this patch.

In the future, we'll have a more robust (managed) save/restore API,
at which time we can expose this functionality properly in the API.

V2: get rid of redundant dd command and just use >> to append data.
V3: Add back the missing pieces for the enum and bumping the save version.
V4: Make the compressed field in the save_header an int.
    Implement LZMA compression.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoRemove 'the the' typo in docs
Daniel P. Berrange [Fri, 14 Aug 2009 11:00:50 +0000 (12:00 +0100)]
Remove 'the the' typo in docs

15 years agoCheck active domain hostdevs before allowing PCI reset
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Check active domain hostdevs before allowing PCI reset

If a PCI device reset causes other devices to be reset, allow it so long
as those other devices are note assigned to another active domain.

Note, we need to take the driver lock qemudNodeDeviceReset() because the
check function will iterate over the domain list.

* src/qemu_conf.c: add qemuCheckPciHostDevice() to iterate over active
  domains checking whether the affected device is assigned

* src/pci.[ch]: add pciDeviceEquals() helper

15 years agoAllow pciResetDevice() to reset multiple devices
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Allow pciResetDevice() to reset multiple devices

When using a Secondary Bus Reset, all devices on the bus are reset.

Extend the pciResetDevice() API so that a 'check' callback can be
supplied which will verify that it is safe to reset the other devices
on the bus.

The virDomainObjPtr parameter is needed so that when the check function
iterates over the domain list, it can avoid double locking.

* src/pci.[ch]: add a 'check' callback to pciResetDevice(), re-work
  pciIterDevices() to pass the check function to the iter functions,
  use the check function in the bus iterator, return the first unsafe
  device from pciBusCheckOtherDevices() and include its details in
  the bus reset error message.

* src/qemu_driver.c, src/xen_uninified.c: just pass NULL as the
  check function for now

15 years agoImprove PCI host device reset error message
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Improve PCI host device reset error message

Currently, if we are unable to reset a PCI device we return a fairly
generic 'No PCI reset capability available' error message.

Fix that by returning an error from the individual reset messages and
using that error to construct the higher level error mesage.

* src/pci.c: set errors in pciTryPowerManagementReset() and
  pciTrySecondaryBusReset() on failure; use those error messages
  in pciResetDevice(), or explain that no reset support is available

15 years agoReset and re-attach PCI host devices on guest shutdown
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Reset and re-attach PCI host devices on guest shutdown

When the guest shuts down, we should attempt to restore all PCI host
devices to a sane state.

In the case of managed hostdevs, we should reset and re-attach the
devices. In the case of unmanaged hostdevs, we should just reset them.

Note, KVM will already reset assigned devices when the guest shuts
down using whatever means it can, so we are only doing it to cover the
cases the kernel can't handle.

* src/qemu_driver.c: add qemuDomainReAttachHostDevices() and call
  it from qemudShutdownVMDaemon()

15 years agoAllow PM reset on multi-function PCI devices
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Allow PM reset on multi-function PCI devices

It turns out that a PCI Power Management reset only affects individual
functions, and not the whole device.

The PCI Power Management spec talks about resetting the 'device' rather
than the 'function', but Intel's Dexuan Cui informs me that it is
actually a per-function reset.

Also, Yu Zhao has added pci_pm_reset() to the kernel, and it doesn't
reject multi-function devices, so it must be true! :-)

(A side issue is that we could defer the PM reset to the kernel if we
could detect that the kernel has PM reset support, but barring version
number checks we don't have a way to detect that support)

* src/pci.c: remove the pciDeviceContainsOtherFunctions() check from
  pciTryPowerManagementReset() and prefer PM reset over bus reset
  where both are available

Cc: Cui, Dexuan <dexuan.cui@intel.com>
Cc: Yu Zhao <yu.zhao@intel.com>
15 years agoDetect KVM's PCI device assignment support
Mark McLoughlin [Fri, 14 Aug 2009 07:31:11 +0000 (08:31 +0100)]
Detect KVM's PCI device assignment support

PCI device assignment is only supported in KVM's fork of qemu, so we
should really detect its availability and give a nice error if its
not supported.

* src/qemu_conf.[ch]: introduce QEMUD_CMD_FLAG_PCIDEVICE indicating
  that the -pcidevice command line option is available

* tests/*: update the tests

15 years agoAdd host PCI device hotplug support
Mark McLoughlin [Fri, 14 Aug 2009 07:31:10 +0000 (08:31 +0100)]
Add host PCI device hotplug support

Attaching a host PCI device to a qemu guest is done with a
straightforward 'pci_add auto host host=XX:XX.X' command.

Like with NIC and disk hotplug, we need to retain the guest PCI address
assigned by qemu so that we can use it for hot-unplug.

Identifying a device for detach is done using the host PCI address.

Managed mode is handled by detaching/resetting the device before
attaching it to the guest and re-attaching it after detaching it from
the guest.

* src/qemu_driver.c: add qemudDomainAttachHostPciDevice() and
  qemudDomainDetachHostPciDevice()

* src/domain_conf.h: add somewhere to store the guest PCI address

* src/domain_conf.c: handle formatting and parsing the guest PCI
  address

15 years agoRe-factor hostdev hotplug
Mark McLoughlin [Fri, 14 Aug 2009 07:31:10 +0000 (08:31 +0100)]
Re-factor hostdev hotplug

Re-factor the hostdev hotplug code so that we can easily add PCI
hostdev hotplug to qemudDomainAttachHostDevice().

* src/qemu_driver.c: rename qemudDomainAttachHostDevice() to
  qemudDomainAttachHostUsbDevice(); make qemudDomainAttachHostDevice()
  handle all hostdev types

* src/libvirt_private.syms: export a couple of hostdev related
  ToString() functions

15 years agoMake LXC / UML drivers robust against NUMA topology brokenness
Daniel P. Berrange [Thu, 13 Aug 2009 10:56:31 +0000 (11:56 +0100)]
Make LXC / UML drivers robust against NUMA topology brokenness

Some kernel versions expose broken NUMA topology for some machines.
This causes the LXC/UML drivers to fail to start. QEMU driver was
already fixed for this problem

* src/lxc_conf.c: Log and ignore failure to populate NUMA info
* src/uml_conf.c: Log and ignore failure to populate NUMA info
* src/capabilities.c: Reset nnumaCell to 0 after freeing

15 years agoFix some URLs in virsh manpage
Mark McLoughlin [Tue, 11 Aug 2009 14:37:33 +0000 (15:37 +0100)]
Fix some URLs in virsh manpage

* docs/virsh.pod: don't reference format.html anymore, reference
  the formatdomain.html etc. pages

* virsh.1: re-generate

15 years agoRemove a duplicated assignment in Xen PCI parsing.
Chris Lalancette [Mon, 3 Aug 2009 11:57:37 +0000 (13:57 +0200)]
Remove a duplicated assignment in Xen PCI parsing.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up a few minor indentation issues.
Chris Lalancette [Mon, 3 Aug 2009 11:57:23 +0000 (13:57 +0200)]
Fix up a few minor indentation issues.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix phyp escape_specialcharacters.
Chris Lalancette [Mon, 3 Aug 2009 11:53:26 +0000 (13:53 +0200)]
Fix phyp escape_specialcharacters.

A couple of minor fixes to phyp escape_specialcharacters.  Make it
a static function (since it's only used in phyp/phyp_driver.c), and
make it take a dstlen parameter.  This paves the way for removing
strncpy in the future.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoMake openvzGetVPSUUID take a len.
Chris Lalancette [Mon, 3 Aug 2009 11:50:27 +0000 (13:50 +0200)]
Make openvzGetVPSUUID take a len.

Minor fix to openvzGetVPSUUID to make it take a length parameter.
This ensures that it doesn't make assumptions about the length
of the UUID buffer, and paves the way for removal of strncpy in
the future.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoMinor cleanup of error path for c_oneVmInfo.
Chris Lalancette [Mon, 3 Aug 2009 11:48:16 +0000 (13:48 +0200)]
Minor cleanup of error path for c_oneVmInfo.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up a whitespace in comments in src/console.c
Chris Lalancette [Fri, 7 Aug 2009 08:56:38 +0000 (10:56 +0200)]
Fix up a whitespace in comments in src/console.c

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up a stray whitespace in virHashGrow.
Chris Lalancette [Wed, 5 Aug 2009 11:46:43 +0000 (13:46 +0200)]
Fix up a stray whitespace in virHashGrow.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoRun 'cont' on successful migration finish.
Chris Lalancette [Wed, 5 Aug 2009 11:42:07 +0000 (13:42 +0200)]
Run 'cont' on successful migration finish.

As of qemu 0.10.6, qemu now honors the -S flag on incoming migration.
That means that when the migration completes, we have to issue a
'cont' command to get the VM running again.  We do it unconditionally
since it won't hurt on older qemu.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoSplit virDomainMigrate into functions.
Chris Lalancette [Thu, 30 Jul 2009 14:52:02 +0000 (16:52 +0200)]
Split virDomainMigrate into functions.

Re-factor virDomainMigrate to split out the version 1 and version 2
protocols into their own functions.  In reality, the two versions share
very little in common, so forcing them together in the same function was
just confusing.  This will also make adding tunnelled migration easier.

Signed-off-by: Chris Lalancette <clalance@redhat.com>