]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
15 years agoAdd esx and tcp migration uri transports to capabilities schema
Mark McLoughlin [Thu, 10 Sep 2009 08:45:38 +0000 (09:45 +0100)]
Add esx and tcp migration uri transports to capabilities schema

* docs/schemas/capabilities.rng: include esx and tcp uri_transport

15 years agoFix regression from "Avoid polling on FDs with no events"
Chris Lalancette [Thu, 10 Sep 2009 09:36:35 +0000 (11:36 +0200)]
Fix regression from "Avoid polling on FDs with no events"

After the mentioned patch was applied, I noticed that
shutting down a kvm guest from inside (i.e. poweroff) caused
the guest to shutdown, but not removed from the list of
active guests.  DanB pointed out that the problem is that
the virEventAddHandle() call in the qemu driver was asking
to watch for 0 events, not HANGUP | ERROR as it should.  Add
these events so that shutdown works again.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoqemu_driver.c: factor out more duplication
Jim Meyering [Thu, 10 Sep 2009 09:26:00 +0000 (11:26 +0200)]
qemu_driver.c: factor out more duplication

* src/qemu_driver.c (qemudDomainRestore): Use the new ...TypeToString
function here, too.

15 years agoClose logfile fd after spawning qemu
Ryota Ozaki [Thu, 10 Sep 2009 09:34:14 +0000 (11:34 +0200)]
Close logfile fd after spawning qemu

* src/qemu_driver.c: avoid a leak of file descriptor when exec'ing qemu

15 years agoReintroduce support for lzop compression
Charles Duffy [Thu, 10 Sep 2009 09:13:33 +0000 (11:13 +0200)]
Reintroduce support for lzop compression

lzop was removed due to some confusion over whether it provided functional
advantages distinct from xz. This has been addressed in the mailing list post
archived at http://permalink.gmane.org/gmane.comp.emulators.libvirt/16487, and
support for lzop is re-added here.

* libvirt.spec.in: add dependancy on lzop
* src/qemu.conf: update documentation of save_image_format
* src/qemu_driver.c: re-add lzop compression option

15 years agoDeprecate lzma and lzop in favor of xz, add dep
Daniel Veillard [Wed, 9 Sep 2009 14:44:44 +0000 (16:44 +0200)]
Deprecate lzma and lzop in favor of xz, add dep

* src/qemu_driver.c: drop lzma and lzop images compression options
  as they are deprecated by xz
* libvirt.spec.in: add requires for xz/bzip2/gzip as they are needed
  to implement the compression options

15 years agoCheck for libssh2 >= 1.0 for phy driver
Maximilian Wilhelm [Wed, 9 Sep 2009 14:21:38 +0000 (16:21 +0200)]
Check for libssh2 >= 1.0 for phy driver

* configure.in: phyp driver uses libssh2_session_block_directions()
  which is only available in libssh2 >= 1.0, so check for this symbol
  too when configuring

15 years agoqemu_driver.c: factor out duplication in compression-type handling
Jim Meyering [Wed, 9 Sep 2009 08:10:38 +0000 (10:10 +0200)]
qemu_driver.c: factor out duplication in compression-type handling

* src/qemu_driver.c (QEMUD_SAVE_FORMAT_LAST): Define.
(qemudSaveCompressionTypeFromString): Declare.
(qemudSaveCompressionTypeToString): Declare.
(qemudDomainSave): Use those functions rather than open-coding them.
Use "cat >> '%s' ..." in place of equivalent
"dd of='%s' oflag=append conv=notrunc ...".

15 years agoalso allow use of XZ for Qemu image compression
Jim Meyering [Tue, 8 Sep 2009 18:52:37 +0000 (20:52 +0200)]
also allow use of XZ for Qemu image compression

* src/qemu_driver.c (enum qemud_save_formats) [QEMUD_SAVE_FORMAT_XZ]:
New member.
[QEMUD_SAVE_FORMAT_LZMA]: Mark as deprecated.
Use an explicit value for each member.
(qemudDomainSave, qemudDomainRestore): Handle the new member.
* src/qemu.conf: Mention xz, too.

15 years agoopenvz_conf.c: remove dead store to "p"; use strchrnul
Jim Meyering [Tue, 8 Sep 2009 09:07:32 +0000 (11:07 +0200)]
openvz_conf.c: remove dead store to "p"; use strchrnul

* src/openvz_conf.c (openvzReadNetworkConf): Replace open-coded
while loop with equivalent use of strchrnul.
* bootstrap (modules): Add strchrnul.

15 years agobuild: update gnulib submodule to latest
Jim Meyering [Tue, 8 Sep 2009 12:28:40 +0000 (14:28 +0200)]
build: update gnulib submodule to latest

15 years agoRemove some tabs used for indent
Daniel Veillard [Tue, 8 Sep 2009 15:32:57 +0000 (17:32 +0200)]
Remove some tabs used for indent

15 years agoAvoid another leak in src/xend_internal.c
Matthias Bolte [Tue, 8 Sep 2009 14:48:20 +0000 (16:48 +0200)]
Avoid another leak in src/xend_internal.c

* src/xend_internal.c: in xenDaemonLookupByID() if virGetDomain fails
  free up the name

15 years agoUpdated a number of localizations and regenerated
Daniel Veillard [Tue, 8 Sep 2009 14:14:08 +0000 (16:14 +0200)]
Updated a number of localizations and regenerated

15 years agoAdd flags and requires for Multipath storage
Daniel Veillard [Tue, 8 Sep 2009 14:07:54 +0000 (16:07 +0200)]
Add flags and requires for Multipath storage

* libvirt.spec.in: the new multipath module requires device-mapper
  and device-mapper-devel for build

15 years agoMultipath storage support module
Dave Allan [Tue, 8 Sep 2009 13:47:45 +0000 (15:47 +0200)]
Multipath storage support module

* configure.in src/Makefile.am src/storage_backend.[ch]
  src/storage_conf.[ch] src/storage_backend_mpath.[ch] po/POTFILES.in:
  add a new module for storage multipath, it requires device-mapper

15 years agoAvoid a leak in xenDaemonLookupByID
Matthias Bolte [Tue, 8 Sep 2009 12:42:10 +0000 (14:42 +0200)]
Avoid a leak in xenDaemonLookupByID

* src/xend_internal.c: free name in xenDaemonLookupByID() if
  virGetDomain() fails

15 years agoAdd a missing comment
Miloslav Trmač [Tue, 8 Sep 2009 11:33:35 +0000 (13:33 +0200)]
Add a missing comment

* src/libvirt_private.syms: Add a missing comment for
  storage_encryption_conf.h entries

15 years agoFix a pasto in storage_encryption_conf.c
Miloslav Trmač [Tue, 8 Sep 2009 11:30:45 +0000 (13:30 +0200)]
Fix a pasto in storage_encryption_conf.c

* src/storage_encryption_conf.c: small typo fix in top comment

15 years agoxm_internal.c: remove four useless comparisons after strchr
Jim Meyering [Mon, 7 Sep 2009 08:09:20 +0000 (10:09 +0200)]
xm_internal.c: remove four useless comparisons after strchr

* src/xm_internal.c (xenXMDomainConfigParse): After t=strchr...
don't test *t; it's known.  This was *not* detected by clang,
but I spotted it since once instance was in the vicinity of the
dead increment of "data".

15 years agoxm_internal.c: remove dead increment of "data"
Jim Meyering [Mon, 7 Sep 2009 08:03:22 +0000 (10:03 +0200)]
xm_internal.c: remove dead increment of "data"

* src/xm_internal.c (xenXMDomainConfigParse): Don't increment it.

15 years agonetwork_driver.c: remove dead store to "err"
Jim Meyering [Fri, 4 Sep 2009 17:37:37 +0000 (19:37 +0200)]
network_driver.c: remove dead store to "err"

* src/network_driver.c (networkSetAutostart): ...and its decl.

15 years agoiptables.c: remove dead store to "s"
Jim Meyering [Fri, 4 Sep 2009 17:36:17 +0000 (19:36 +0200)]
iptables.c: remove dead store to "s"

* src/iptables.c (iptablesAddRemoveRule): Remove dead store.

15 years agoutil.c: avoid dead store to "flag"
Jim Meyering [Fri, 4 Sep 2009 16:53:20 +0000 (18:53 +0200)]
util.c: avoid dead store to "flag"

* src/util.c (virExecDaemonize): Change flag |= VAR to "flag | VAR".

15 years agodomain_conf.c: remove two dead stores
Jim Meyering [Fri, 4 Sep 2009 15:27:34 +0000 (17:27 +0200)]
domain_conf.c: remove two dead stores

* src/domain_conf.c (virDomainSaveXML): Remove use and decl of "err".
(virDomainDefParseXML): Likewise.

15 years agoxm_internal.c: remove two ret=... dead stores
Jim Meyering [Fri, 4 Sep 2009 15:22:19 +0000 (17:22 +0200)]
xm_internal.c: remove two ret=... dead stores

* src/xm_internal.c (xenXMDomainCreate): Remove dead stores.

15 years agoxm_internal.c: remove dead stores of local, "type"
Jim Meyering [Fri, 4 Sep 2009 14:49:37 +0000 (16:49 +0200)]
xm_internal.c: remove dead stores of local, "type"

* src/xm_internal.c (xenXMDomainConfigParse): Remove declaration
and useless containing if-block, too.

15 years agoVBox fix minor bugs in display and added OOM checks
Pritesh Kothari [Mon, 7 Sep 2009 15:44:12 +0000 (17:44 +0200)]
VBox fix minor bugs in display and added OOM checks

* src/vbox/vbox_tmpl.c: minor bug in selecting the graphics type. if the
  graphics type was desktop it was assumed that display is set for it,
  and thus crashed on strdup. Also adds a number of missing OOM checks.

15 years agonetwork_conf.c: remove dead store to "err"
Jim Meyering [Fri, 4 Sep 2009 17:15:51 +0000 (19:15 +0200)]
network_conf.c: remove dead store to "err"

* src/network_conf.c (virNetworkDefParseXML): ...and its decl.

15 years agoopenvz_driver.c: avoid dead store to "err"
Jim Meyering [Fri, 4 Sep 2009 17:11:31 +0000 (19:11 +0200)]
openvz_driver.c: avoid dead store to "err"

* src/openvz_driver.c (openvzGenerateContainerVethName): Remove use
and decl of "err".

15 years agoxend_internal.c: Remove two dead stores to "ret"
Jim Meyering [Fri, 4 Sep 2009 17:14:09 +0000 (19:14 +0200)]
xend_internal.c: Remove two dead stores to "ret"

* src/xend_internal.c (xenDaemonCreateXML): Don't set "ret" after
last use.

15 years agostorage_driver.c: remove two dead stores to "backend"
Jim Meyering [Fri, 4 Sep 2009 15:18:29 +0000 (17:18 +0200)]
storage_driver.c: remove two dead stores to "backend"

* src/storage_driver.c (storagePoolGetInfo, storagePoolDefine):
Remove variable, backend, since its value was never used.

15 years agoMerge branch 'tmp'
Daniel Veillard [Mon, 7 Sep 2009 14:48:03 +0000 (16:48 +0200)]
Merge branch 'tmp'

15 years agoSome close/fclose/closedir calls are missing
Matthias Bolte [Mon, 7 Sep 2009 14:47:13 +0000 (16:47 +0200)]
Some close/fclose/closedir calls are missing

* src/openvz_conf.c src/qemu_driver.c src/storage_backend_scsi.c
  src/xen_inotify.c: closes various file descriptors leaks

15 years agolxc_container.c: avoid a leak on error paths
Jim Meyering [Fri, 4 Sep 2009 14:12:35 +0000 (16:12 +0200)]
lxc_container.c: avoid a leak on error paths

* src/lxc_container.c (lxcContainerMountBasicFS): Don't leak upon failure.
Add "cleanup:" label and change each post-allocation failure to
use "goto cleanup" rather than returning immediately.

15 years agoqemu_conf.c: add a comment suggesting why we leave a dead-store
Jim Meyering [Fri, 4 Sep 2009 09:20:23 +0000 (11:20 +0200)]
qemu_conf.c: add a comment suggesting why we leave a dead-store

* src/qemu_conf.c (qemuBuildHostNetStr): Do not remove the type_sep=','
dead store, since not having it would be a problem if we ever add a
new attribute=VAL option.

15 years agohash.c: remove a dead store
Jim Meyering [Fri, 4 Sep 2009 09:01:00 +0000 (11:01 +0200)]
hash.c: remove a dead store

* src/hash.c (virHashFree): Remove useless assignment to inside_table.

15 years agointerface_conf.c: remove a dead-store and declaration
Jim Meyering [Fri, 4 Sep 2009 08:55:55 +0000 (10:55 +0200)]
interface_conf.c: remove a dead-store and declaration

* src/interface_conf.c (virInterfaceDefParseDhcp): Remove unused "old".

15 years agoeventtest.c: detect write failure and avoid dead stores
Jim Meyering [Thu, 3 Sep 2009 16:25:03 +0000 (18:25 +0200)]
eventtest.c: detect write failure and avoid dead stores

* tests/eventtest.c (mymain): Exit nonzero upon write failure.
This also avoids several dead stores of the form ret = safewrite...

15 years agoopenvz_conf.c: Remove dead store to copy_fd
Jim Meyering [Thu, 3 Sep 2009 16:23:51 +0000 (18:23 +0200)]
openvz_conf.c: Remove dead store to copy_fd

* src/openvz_conf.c (openvz_copyfile): Remove unused assignment.

15 years agostorage_backend_logical.c: appease clang: remove useless increment
Jim Meyering [Thu, 3 Sep 2009 16:14:48 +0000 (18:14 +0200)]
storage_backend_logical.c: appease clang: remove useless increment

* src/storage_backend_logical.c (virStorageBackendLogicalBuildPool):
Don't increment "n" when we won't use the result.

15 years agoESX raise error if UUID parse failed
Matthias Bolte [Fri, 4 Sep 2009 16:32:44 +0000 (18:32 +0200)]
ESX raise error if UUID parse failed

* src/esx/esx_util.c: let esxUtil_GetConfigUUID() report an error if
  virUUIDParse() fails

15 years agoESX add domain undefine based on esxVI_UnregisterVM
Matthias Bolte [Fri, 4 Sep 2009 16:30:10 +0000 (18:30 +0200)]
ESX add domain undefine based on esxVI_UnregisterVM

* src/esx/esx_driver.c: add esxDomainUndefine() based on
  esxVI_UnregisterVM()
* src/esx/esx_vi_methods.[ch]: add esxVI_UnregisterVM()

15 years agoESX add esxGetCapabilities() with basic defaults
Matthias Bolte [Fri, 4 Sep 2009 16:25:27 +0000 (18:25 +0200)]
ESX add esxGetCapabilities() with basic defaults

* src/esx/esx_driver.c: add esxCapsInit() with default caps and add
  esxGetCapabilities()

15 years agoESX simplify SOAP request and response handling
Matthias Bolte [Fri, 4 Sep 2009 16:24:25 +0000 (18:24 +0200)]
ESX simplify SOAP request and response handling

* src/esx/esx_vi.[ch]: convert esxVI_RemoteRequest_Execute() to a
  simpler esxVI_Context_Execute() version, remove esxVI_RemoteRequest
  and convert esxVI_RemoteResponse to esxVI_Response
* src/esx/esx_vi_methods.c: update and simplify callers to use
  esxVI_Context_Execute() instead of esxVI_RemoteRequest_Execute()

15 years agoESX use virXPathNode*() to simplify XPath handling
Matthias Bolte [Fri, 4 Sep 2009 16:08:52 +0000 (18:08 +0200)]
ESX use virXPathNode*() to simplify XPath handling

* src/esx/esx_vi.[ch]: use virXPathNode*() in
  esxVI_RemoteRequest_Execute() and remove
  esxVI_RemoteResponse_DeserializeXPathObject*()
* src/esx/esx_vi_methods.c: update callers to use the new syntax of
  esxVI_RemoteRequest_Execute()

15 years agoESX: make esxVI_GetVirtualMachineIdentity() robust
Matthias Bolte [Fri, 4 Sep 2009 16:03:22 +0000 (18:03 +0200)]
ESX: make esxVI_GetVirtualMachineIdentity() robust

* src/esx/esx_driver.c: add configStatus to the requested properties
  to check it in esxVI_GetVirtualMachineIdentity()
* src/esx/esx_vi.[ch]: add esxVI_GetManagedEntityStatus()
  and use it in esxVI_GetVirtualMachineIdentity()
* src/esx/esx_vi_types.[ch]: add VI type esxVI_ManagedEntityStatus

15 years agoESX: Fix VMX path parsing and URL encoding
Matthias Bolte [Fri, 4 Sep 2009 15:55:55 +0000 (17:55 +0200)]
ESX: Fix VMX path parsing and URL encoding

* src/esx/esx_driver.c: handle spaces in VMX file path and use a
  virBuffer to encode spaces correctly in the resulting URL
* src/esx/esx_vi.c: include the URL in the error message in case
  of a download error

15 years agoVBox add Storage Volume support
Pritesh Kothari [Fri, 4 Sep 2009 14:28:52 +0000 (16:28 +0200)]
VBox add Storage Volume support

* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: adds the driver for
  storage volumes

15 years agoFix several memory leaks
Ryota Ozaki [Fri, 4 Sep 2009 13:56:32 +0000 (15:56 +0200)]
Fix several memory leaks

* src/domain_conf.c src/network_conf.c src/qemu_conf.c
  src/storage_backend_fs.c: various problems spotted by valgrind
  through libvirt code

15 years agoVBox driver cleanups
Pritesh Kothari [Fri, 4 Sep 2009 13:44:59 +0000 (15:44 +0200)]
VBox driver cleanups

* src/vbox/vbox_tmpl.c: a bit of cleanup

15 years agoMinor comment changes
Laine Stump [Fri, 4 Sep 2009 13:40:52 +0000 (15:40 +0200)]
Minor comment changes

* src/libvirt.c: fix some minor grammer (and one other) nits in comments
  that end up in generated API reference documentation

15 years agoFix a memory leak in virsh
Laine Stump [Fri, 4 Sep 2009 13:38:15 +0000 (15:38 +0200)]
Fix a memory leak in virsh

* src/virsh.c: cmdNodeDeviceDumpXML wasn't freeing
  virNodeDeviceGetXMLDesc() return string

15 years agoFix ID field in virDomainPtr after starting Xen VM
Daniel P. Berrange [Fri, 4 Sep 2009 12:10:44 +0000 (14:10 +0200)]
Fix ID field in virDomainPtr after starting Xen VM

* src/xend_internal.c: Lookup guest after starting persistent
  config in order to refresh the domain ID field

15 years agoPHYP driver cleanups
Daniel Veillard [Fri, 4 Sep 2009 12:03:45 +0000 (14:03 +0200)]
PHYP driver cleanups

* libvirt.spec.in: activate phyp and fix the BuildDep to libssh2-devel
* src/phyp/phyp_driver.c: fix a debug macro to use the normal logging API

15 years agoSwitch Power Hypervisor to libssh2
Eduardo Otubo [Fri, 4 Sep 2009 10:08:47 +0000 (12:08 +0200)]
Switch Power Hypervisor to libssh2

* configure.in src/Makefile.am: change detection and flags
* src/phyp/phyp_driver.c src/phyp/phyp_driver.h: connection now
  need to be done as part of the driver code, cleaned up by DV

15 years agoAllow libvirtd to RPC to external libvirtd
Chris Lalancette [Fri, 4 Sep 2009 08:28:27 +0000 (10:28 +0200)]
Allow libvirtd to RPC to external libvirtd

* src/remote_internal.c: in remoteOpen() allow the daemon itself to make
  RPCs to an external libvirtd, but only if the URI is fully specified.

15 years agoFix memory leak of monitor character device
Daniel P. Berrange [Wed, 26 Aug 2009 14:38:32 +0000 (15:38 +0100)]
Fix memory leak of monitor character device

* src/qemu_driver.c: Free the vm->monitor_chr field at VM shutdown.
  Unlink the UNIX domain socket at VM shutdown to avoid littering
  FS with old sockets

15 years agoAutomatically set correct ownership of QEMU state directories
Daniel P. Berrange [Wed, 26 Aug 2009 14:42:31 +0000 (15:42 +0100)]
Automatically set correct ownership of QEMU state directories

* src/qemu_driver.c: Change ownership of /var/{lib,cache}/libvirt/qemu
  to match user/group that QEMU VMs are configured to run as.

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