- 31 1月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Add virRWLock backed up by a POSIX rwlock primitive Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 30 1月, 2014 3 次提交
-
-
由 Osier Yang 提交于
It doesn't make sense to fail if the SCSI host device is specified as "shareable" explicitly between domains (NB, it works if and only if the device is specified as "shareable" for *all* domains, otherwise it fails). To fix the problem, this patch introduces an array for virSCSIDevice struct, which records all the names of domain which are using the device (note that the recorded domains must specify the device as shareable). And the change on the data struct brings on many subsequent changes in the code. Prior to this patch, the "shareable" tag didn't work as expected, it actually work like "non-shareable". So this patch also added notes in formatdomain.html to declare the fact. * src/util/virscsi.h: - Remove virSCSIDeviceGetUsedBy - Change definition of virSCSIDeviceGetUsedBy and virSCSIDeviceListDel - Add virSCSIDeviceIsAvailable * src/util/virscsi.c: - struct virSCSIDevice: Change "used_by" to be an array; Add "n_used_by" as the array count - virSCSIDeviceGetUsedBy: Removed - virSCSIDeviceFree: frees the "used_by" array - virSCSIDeviceSetUsedBy: Copy the domain name to avoid potential memory corruption - virSCSIDeviceIsAvailable: New - virSCSIDeviceListDel: Change the logic, for device which is already in the list, just remove the corresponding entry in "used_by". And since it's only used in one place, we can safely removing the code to find out the dev in the list first. - Copyright updating * src/libvirt_private.sys: - virSCSIDeviceGetUsedBy: Remove - virSCSIDeviceIsAvailable: New * src/qemu/qemu_hostdev.c: - qemuUpdateActiveScsiHostdevs: Check if the device existing before adding it to the list; - qemuPrepareHostdevSCSIDevices: Error out if the not all domains use the device as "shareable"; Also don't try to add the device to the activeScsiHostdevs list if it already there; And make more sensible error w.r.t the current "shareable" value in driver->activeScsiHostdevs. - qemuDomainReAttachHostScsiDevices: Change the logic according to the changes on helpers. Signed-off-by: NOsier Yang <jyang@redhat.com>
-
由 Michal Privoznik 提交于
This reverts commit 2996e6be and some parts of 2636dc8c. The former one tried to implement QoS setting on bridgeless networks. However, as discussed upstream [1], the patch is far away from being useful in even a single case. The whole idea of network QoS is to have aggregated limits over several interfaces. This patch is doing completely the opposite when merging two QoS settings (from the network and the domain interface) into one which is then set at the domain interface itself, not the network. The latter one is the test for the previous one. Now none of them makes sense. 1: https://www.redhat.com/archives/libvir-list/2014-January/msg01441.html Conflicts: tests/virnetdevbandwidthtest.c: New test has been introduced since then.
-
由 Michal Privoznik 提交于
There are some units within libvirt that utilize virCommand API to run some commands and deserve own unit testing. These units are, however, not desired to be rewritten to dig virCommand API usage out. As a great example virNetDevBandwidth could be used. The problem with the bandwidth unit is: it uses virCommand API heavily. Therefore we need a mechanism to not really run a command, but rather see its string representation after which we can decide if the unit construct the correct sequence of commands or not. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 1月, 2014 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1055484 Currently, libvirt's XML schema of network allows QoS to be defined for every network even though it has no bridge. For instance: <network> <name>vdsm-no-bridge</name> <forward mode='passthrough'> <interface dev='em1.10'/> </forward> <bandwidth> <inbound average='1000' peak='5000' burst='1024'/> <outbound average='1000' burst='1024'/> </bandwidth> </network> The bandwidth limitations can be, however, applied even on such networks. In fact, they are going to be applied on the interface that will be connected to the network on a domain startup. This approach, however, has one limitation. With bridged networks, there are two points where QoS can be set: bridge and domain interface. The lower limit of the two is enforced then. For instance, if the interface has 10Mbps average, but the network only 1Mbps, there's no way for interface to transmit packets faster than the 1Mbps limit. With two points this is enforced by kernel. With only one point, we must combine both QoS settings into one which is set afterwards. Look at virNetDevBandwidthMinimal() and you'll understand immediately what I mean. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 23 1月, 2014 1 次提交
-
-
由 Osier Yang 提交于
Unlike the host devices of other types, SCSI host device XML supports "shareable" tag. This patch introduces it for the virSCSIDevice struct for a later patch use (to detect if the SCSI device is shareable when preparing the SCSI host device in QEMU driver).
-
- 21 1月, 2014 1 次提交
-
-
由 Francesco Romani 提交于
spice-server offers an API to disable file transfer messages on the agent channel between the client and the guest. This is supported in qemu through the disable-agent-file-xfer option. This patch exposes this option to libvirt. Adds a new element 'filetransfer', with one property, 'enable', which accepts a boolean. Default is enabled, for backward compatibility. Depends on the capability exported in the first patch of the series. Signed-off-by: NFrancesco Romani <fromani@redhat.com>
-
- 20 1月, 2014 2 次提交
-
-
由 Jiri Denemark 提交于
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Gao feng 提交于
This patch introduces virCgroupSetBlkioDeviceReadIops, virCgroupSetBlkioDeviceWriteIops, virCgroupSetBlkioDeviceReadBps and virCgroupSetBlkioDeviceWriteBps, we can use these interfaces to set up throttle blkio cgroup for domain. This patch also adds the new throttle blkio cgroup elements to the test xml. Signed-off-by: NGuan Qiang <hzguanqiang@corp.netease.com> Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
- 16 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
In order to mirror a server with per-object filtering, the client needs to track which server callbackID is servicing the client callback. This patch introduces the notion of a serverID, as well as the plumbing to use it for network events, although the actual complexity of using per-object filtering in the remote driver is deferred to a later patch. * src/conf/object_event.h (virObjectEventStateEventID): Add parameter. (virObjectEventStateQueueRemote, virObjectEventStateSetRemote): New prototypes. (virObjectEventStateRegisterID): Move... * src/conf/object_event_private.h: ...here, and add parameter. (_virObjectEvent): Add field. * src/conf/network_event.h (virNetworkEventStateRegisterClient): New prototype. * src/conf/object_event.c (_virObjectEventCallback): Add field. (virObjectEventStateSetRemote): New function. (virObjectEventStateQueue): Make wrapper around... (virObjectEventStateQueueRemote): New function. (virObjectEventCallbackListCount): Tweak return count when remote id matching is used. (virObjectEventCallbackLookup, virObjectEventStateRegisterID): Tweak registration when remote id matching will be used. (virObjectEventNew): Default to no remote id. (virObjectEventCallbackListAddID): Likewise, but set remote id when one is available. (virObjectEventCallbackListRemoveID) (virObjectEventCallbackListMarkDeleteID): Adjust return value when remote id was set. (virObjectEventStateEventID): Query existing id. (virObjectEventDispatchMatchCallback): Require matching event id. (virObjectEventStateCallbackID): Adjust caller. * src/conf/network_event.c (virNetworkEventStateRegisterClient): New function. (virNetworkEventStateRegisterID): Update caller. * src/conf/domain_event.c (virDomainEventStateRegister) (virDomainEventStateRegisterID): Update callers. * src/remote/remote_driver.c (remoteConnectNetworkEventRegisterAny) (remoteConnectNetworkEventDeregisterAny) (remoteConnectDomainEventDeregisterAny): Likewise. (remoteEventQueue): Hoist earlier to avoid forward declaration, and add parameter. Adjust all callers. * src/libvirt_private.syms (conf/object_event.h): Drop function. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 1月, 2014 1 次提交
-
-
由 Lénaïc Huard 提交于
When the host is configured with very restrictive firewall (default policy is DROP for all chains, including OUTPUT), the bridge driver for Linux adds netfilter entries to allow DHCP and DNS requests to go from the VM to the dnsmasq of the host. The issue that this commit fixes is the fact that a DROP policy on the OUTPUT chain blocks the DHCP replies from the host’s dnsmasq to the VM. As DHCP replies are sent in UDP, they are not caught by any --ctstate ESTABLISHED rule and so, need to be explicitly allowed. Signed-off-by: NLénaïc Huard <lenaic@lhuard.fr.eu.org>
-
- 04 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
While working on events, I found a number of minor issues; I'm hoisting these to the front rather than doing it piecemeal in the patches where I first noticed bad or missing documentation. * src/conf/object_event.c: Fix grammar, document all parameters of public functions, wrap some long lines. * src/conf/object_event.h: Likewise. * src/conf/network_event.c: Likewise. * src/conf/domain_event.c: Likewise (except for the large number of event creation functions). * src/libvirt_private.cyms (conf/object_event.h): Split... (conf/network_event.h): ...to account for new file. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 12月, 2013 1 次提交
-
-
由 Gao feng 提交于
Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
-
- 11 12月, 2013 1 次提交
-
-
由 Cédric Bosdonnat 提交于
Define the public API for (de-)registering network events and the callbacks for receiving lifecycle events. The lifecycle event includes a 'detail' parameter to match the domain lifecycle event data, but this is currently unused. The network events related code goes into its own set of internal files src/conf/network_event.[ch]
-
- 10 12月, 2013 5 次提交
-
-
由 Cédric Bosdonnat 提交于
-
由 Cédric Bosdonnat 提交于
This aims at providing some consistency with other domain events
-
由 Cédric Bosdonnat 提交于
Added a parent class virObjectEvent for future event types
-
由 Cédric Bosdonnat 提交于
Keep virDomainEventStateRegisterID as a convenience wrapper around this new function.
-
由 Cédric Bosdonnat 提交于
Leave virDomainEventRegister and its Deregister brother as these are legacy functions only for domain lifecycle events.
-
- 03 12月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Before this patch, the translation function still needs a second ugly helper function to actually format the command line for qemu. But if we do the right stuff in the translation function, we don't have to bother with the second function any more. This patch removes the messy qemuBuildVolumeString function and changes qemuTranslateDiskSourcePool to set stuff up correctly so that the regular code paths meant for volumes can be used to format the command line correctly. For this purpose a new helper "qemuDiskGetActualType()" is introduced to return the type of the volume in a pool. As a part of the refactor the qemuTranslateDiskSourcePool function is fixed to do decisions based on the pool type instead of the volume type. This allows to separate pool-type-specific stuff more clearly and will ease addition of other pool types that will require certain other operations to get the correct pool source. The previously fixed tests should make sure that we don't break stuff that was working before.
-
- 02 12月, 2013 2 次提交
-
-
由 Peter Krempa 提交于
Add virDomainDiskAuthClear to help cleaning out the struct in other places too.
-
由 Peter Krempa 提交于
To simplify operations on virDomainDiskHostDef arrays we will need deep copy and freeing functions. Add and properly export them.
-
- 28 11月, 2013 2 次提交
-
-
由 Daniel P. Berrange 提交于
Move the code for lxcContainerGetSubtree into the virfile module creating 2 new functions int virFileGetMountSubtree(const char *mtabpath, const char *prefix, char ***mountsret, size_t *nmountsret); int virFileGetMountReverseSubtree(const char *mtabpath, const char *prefix, char ***mountsret, size_t *nmountsret); Add a new virfiletest.c test case to validate the new code. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Add virStringSortCompare and virStringSortRevCompare as standard functions to use with qsort. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 27 11月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
Export string conversion from and to the virStorageVolType enum.
-
- 12 11月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
The function destroys only the contents not the object itself thus it should be called Clear.
-
- 07 11月, 2013 3 次提交
-
-
由 Eric Blake 提交于
This gets rid of another stat() per volume, as well as cutting bytes read in half, when populating the volumes of a directory pool during a pool refresh. Not to mention that it provides an interface that can let gluster pools also probe file types. * src/util/virstoragefile.h (virStorageFileProbeFormatFromFD): Delete. (virStorageFileProbeFormatFromBuf): New prototype. (VIR_STORAGE_MAX_HEADER): New constant, based on... * src/util/virstoragefile.c (STORAGE_MAX_HEAD): ...old name. (vmdk4GetBackingStore, virStorageFileGetMetadataInternal) (virStorageFileProbeFormat): Adjust clients. (virStorageFileProbeFormatFromFD): Delete. (virStorageFileProbeFormatFromBuf): Export. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Adjust client. * src/libvirt_private.syms (virstoragefile.h): Adjust exports. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Future patches will want to learn metadata about a file using a buffer that was already parsed in order to probe the file's format. Rather than reopening and re-reading the file, it makes sense to separate getting file contents from actually parsing those contents. * src/util/virstoragefile.c (virStorageFileGetMetadataFromBuf) (virStorageFileGetMetadataFromFDInternal): New functions. (virStorageFileGetMetadataInternal): Hoist fstat() and read() into callers. (virStorageFileGetMetadataFromFD) (virStorageFileGetMetadataRecurse): Rework clients. * src/util/virstoragefile.h (virStorageFileGetMetadataFromBuf): New prototype. * src/libvirt_private.syms (virstoragefile.h): Export it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Our backing file chain code was not very robust to an ill-timed EINTR, which could lead to a short read causing us to randomly treat metadata differently than usual. But the existing virFileReadLimFD forces an error if we don't read the entire file, even though we only care about the header of the file. So add a new virFile function that does what we want. * src/util/virfile.h (virFileReadHeaderFD): New prototype. * src/util/virfile.c (virFileReadHeaderFD): New function. * src/libvirt_private.syms (virfile.h): Export it. * src/util/virstoragefile.c (virStorageFileGetMetadataInternal) (virStorageFileProbeFormatFromFD): Use it. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 05 11月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Add a function for efficiently checking if a path is a filesystem mount point. NB will not work for bind mounts, only true filesystem mounts. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 04 11月, 2013 4 次提交
-
-
由 Jiri Denemark 提交于
This makes virCPUx86DataAddCPUID, virCPUx86DataFree, and virCPUx86MakeData available for direct usage outside of cpu driver in tests and the new qemu monitor that will request the actual CPU definition from a running qemu instance.
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Avoid necessary checks for the numa library with this helper.
-
由 Peter Krempa 提交于
All functions from libnuma must be protected with ifdefs. Avoid this by using our own wrapper.
-
- 29 10月, 2013 2 次提交
-
-
由 Giuseppe Scrivano 提交于
Expand the "secmodel" XML fragment of "host" with a sequence of baselabel's which describe the default security context used by libvirt with a specific security model and virtualization type: <secmodel> <model>selinux</model> <doi>0</doi> <baselabel type='kvm'>system_u:system_r:svirt_t:s0</baselabel> <baselabel type='qemu'>system_u:system_r:svirt_tcg_t:s0</baselabel> </secmodel> <secmodel> <model>dac</model> <doi>0</doi> <baselabel type='kvm'>107:107</baselabel> <baselabel type='qemu'>107:107</baselabel> </secmodel> "baselabel" is driver-specific information, e.g. in the DAC security model, it indicates USER_ID:GROUP_ID. Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Giuseppe Scrivano 提交于
virSecurityManagerGetBaseLabel queries the default settings used by a security model. Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
-
- 21 10月, 2013 2 次提交
-
-
由 Daniel P. Berrange 提交于
When running setuid, we must be careful about what env vars we allow commands to inherit from us. Replace the virCommandAddEnvPass function with two new ones which do filtering virCommandAddEnvPassAllowSUID virCommandAddEnvPassBlockSUID And make virCommandAddEnvPassCommon use the appropriate ones Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Care must be taken accessing env variables when running setuid. Introduce a virGetEnvAllowSUID for env vars which are safe to use in a setuid environment, and another virGetEnvBlockSUID for vars which are not safe. Also add a virIsSUID helper method for any other non-env var code to use. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 15 10月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
This patch adds cpuDataFormat and cpuDataParse APIs to be used in unit tests for testing APIs that deal with virCPUData. In the x86 world, this means we can now store/load arbitrary CPUID data in the test suite to check correctness of CPU related APIs that could not be tested before. Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
-
- 14 10月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
If the dbus system bus connection is marked as private, then allow it to be closed. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-