Commit Graph

3266 Commits

Author SHA1 Message Date
Jim Meyering
130634dd7c network_driver.c: remove dead store to "err"
* src/network_driver.c (networkSetAutostart): ...and its decl.
2009-09-07 18:13:43 +02:00
Jim Meyering
1fcaae34e1 iptables.c: remove dead store to "s"
* src/iptables.c (iptablesAddRemoveRule): Remove dead store.
2009-09-07 18:13:43 +02:00
Jim Meyering
94f0c4abd9 util.c: avoid dead store to "flag"
* src/util.c (virExecDaemonize): Change flag |= VAR to "flag | VAR".
2009-09-07 18:13:43 +02:00
Jim Meyering
1ad59dd152 domain_conf.c: remove two dead stores
* src/domain_conf.c (virDomainSaveXML): Remove use and decl of "err".
(virDomainDefParseXML): Likewise.
2009-09-07 18:13:42 +02:00
Jim Meyering
bc8bcdcb24 xm_internal.c: remove two ret=... dead stores
* src/xm_internal.c (xenXMDomainCreate): Remove dead stores.
2009-09-07 18:13:42 +02:00
Jim Meyering
577ab7bae0 xm_internal.c: remove dead stores of local, "type"
* src/xm_internal.c (xenXMDomainConfigParse): Remove declaration
and useless containing if-block, too.
2009-09-07 18:13:42 +02:00
Pritesh Kothari
089ef25a85 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.
2009-09-07 17:44:12 +02:00
Jim Meyering
9323717b47 network_conf.c: remove dead store to "err"
* src/network_conf.c (virNetworkDefParseXML): ...and its decl.
2009-09-07 17:23:10 +02:00
Jim Meyering
a7848c4502 openvz_driver.c: avoid dead store to "err"
* src/openvz_driver.c (openvzGenerateContainerVethName): Remove use
and decl of "err".
2009-09-07 17:21:29 +02:00
Jim Meyering
e2cd26ee70 xend_internal.c: Remove two dead stores to "ret"
* src/xend_internal.c (xenDaemonCreateXML): Don't set "ret" after
last use.
2009-09-07 17:21:23 +02:00
Jim Meyering
6f91c5b5ea storage_driver.c: remove two dead stores to "backend"
* src/storage_driver.c (storagePoolGetInfo, storagePoolDefine):
Remove variable, backend, since its value was never used.
2009-09-07 17:17:46 +02:00
Daniel Veillard
46b80ce25e Merge branch 'tmp' 2009-09-07 16:48:03 +02:00
Matthias Bolte
166c03f31b 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
2009-09-07 16:47:13 +02:00
Jim Meyering
3ef2e05c4d 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.
2009-09-04 18:59:29 +02:00
Jim Meyering
1469bcf6c5 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.
2009-09-04 18:59:29 +02:00
Jim Meyering
767c5bbe01 hash.c: remove a dead store
* src/hash.c (virHashFree): Remove useless assignment to inside_table.
2009-09-04 18:59:29 +02:00
Jim Meyering
f2a46c848c interface_conf.c: remove a dead-store and declaration
* src/interface_conf.c (virInterfaceDefParseDhcp): Remove unused "old".
2009-09-04 18:59:29 +02:00
Jim Meyering
25b20b7103 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...
2009-09-04 18:59:29 +02:00
Jim Meyering
198bd0516a openvz_conf.c: Remove dead store to copy_fd
* src/openvz_conf.c (openvz_copyfile): Remove unused assignment.
2009-09-04 18:59:29 +02:00
Jim Meyering
f4d881649a 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.
2009-09-04 18:59:29 +02:00
Matthias Bolte
d5df676938 ESX raise error if UUID parse failed
* src/esx/esx_util.c: let esxUtil_GetConfigUUID() report an error if
  virUUIDParse() fails
2009-09-04 18:32:44 +02:00
Matthias Bolte
ad866fd196 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()
2009-09-04 18:30:10 +02:00
Matthias Bolte
3e8cb46076 ESX add esxGetCapabilities() with basic defaults
* src/esx/esx_driver.c: add esxCapsInit() with default caps and add
  esxGetCapabilities()
2009-09-04 18:25:27 +02:00
Matthias Bolte
46e76e8b2b 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()
2009-09-04 18:24:25 +02:00
Matthias Bolte
03d28d7355 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()
2009-09-04 18:08:52 +02:00
Matthias Bolte
1f8988b580 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
2009-09-04 18:03:22 +02:00
Matthias Bolte
902aaabb11 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
2009-09-04 17:55:55 +02:00
Pritesh Kothari
6b50bbea00 VBox add Storage Volume support
* src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c: adds the driver for
  storage volumes
2009-09-04 16:28:52 +02:00
Ryota Ozaki
0cf672fa91 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
2009-09-04 15:56:32 +02:00
Pritesh Kothari
c8376c91f6 VBox driver cleanups
* src/vbox/vbox_tmpl.c: a bit of cleanup
2009-09-04 15:44:59 +02:00
Laine Stump
28c3243e77 Minor comment changes
* src/libvirt.c: fix some minor grammer (and one other) nits in comments
  that end up in generated API reference documentation
2009-09-04 15:40:52 +02:00
Laine Stump
3ced80b54a Fix a memory leak in virsh
* src/virsh.c: cmdNodeDeviceDumpXML wasn't freeing
  virNodeDeviceGetXMLDesc() return string
2009-09-04 15:38:15 +02:00
Daniel P. Berrange
96f0ee85d2 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
2009-09-04 14:10:44 +02:00
Daniel Veillard
91c7bf659b 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
2009-09-04 14:03:45 +02:00
Eduardo Otubo
191053b53d 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
2009-09-04 12:08:47 +02:00
Chris Lalancette
02d9cef356 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.
2009-09-04 10:28:27 +02:00
Daniel P. Berrange
e1424a97a9 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
2009-09-03 18:10:16 +01:00
Daniel P. Berrange
2a6825c393 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.
2009-09-03 18:10:16 +01:00
Daniel P. Berrange
182a80b922 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
2009-09-03 18:10:16 +01:00
Daniel P. Berrange
34d22c1ed5 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
2009-09-03 18:06:16 +01:00
Jim Meyering
77a1f418c8 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.
2009-09-03 18:04:24 +02:00
Matthias Bolte
8ed3088441 esx_vi: return -1 upon failure, as intended
* src/esx/esx_vi.c (esxVI_Enumeration_Deserialize): Fix
reversed goto and result=-1 statements.
2009-09-03 18:04:24 +02:00
Jim Meyering
0fa4d62986 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.
2009-09-03 18:04:24 +02:00
Jim Meyering
f4592a8df5 mdns.c: remove dead initialization
* qemud/mdns.c (libvirtd_mdns_client_callback): Remove dead
initialization.
2009-09-03 18:04:23 +02:00
Jim Meyering
3468628a22 node_device_conf.c: remove dead initialization
* src/node_device_conf.c (virNodeDeviceDefFormat): Remove dead
initialization.
2009-09-03 18:04:23 +02:00
Jim Meyering
1e813ceb3e 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.
2009-09-03 18:04:23 +02:00
Jim Meyering
20f1f714ba 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.
2009-09-03 18:04:23 +02:00
Jim Meyering
f435a3002b uml_conf.c: don't return an uninitialized pointer
* src/uml_conf.c (umlBuildCommandLineChr): Initialize "ret".
2009-09-03 18:04:23 +02:00
Jim Meyering
5cb74dadaf 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.
2009-09-03 18:04:23 +02:00
Jim Meyering
d9b4538469 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.
2009-09-03 18:04:23 +02:00