- 07 11月, 2013 7 次提交
-
-
由 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 提交于
We are calling fstat() at least twice per storage volume in a directory storage pool; this is rather wasteful. Refactoring this is also a step towards making code reusable for gluster, where gluster can provide struct stat but cannot use fstat(). * src/storage/storage_backend.h (virStorageBackendVolOpenCheckMode) (virStorageBackendUpdateVolTargetInfoFD): Update signature. * src/storage/storage_backend.c (virStorageBackendVolOpenCheckMode): Pass stat results back. (virStorageBackendUpdateVolTargetInfoFD): Use existing stats. (virStorageBackendVolOpen, virStorageBackendUpdateVolTargetInfo): Update callers. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. * src/storage/storage_backend_scsi.c (virStorageBackendSCSIUpdateVolTargetInfo): Likewise. * src/storage/storage_backend_mpath.c (virStorageBackendMpathUpdateVolTargetInfo): Likewise. 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>
-
由 Eric Blake 提交于
'unsigned char *' makes sense if you are doing math on bytes and don't want to worry about wraparound from a signed 'char'; but since all we are doing is memcmp() or virReadBufInt*[LB]E(), which are both safe on either type of char, and since read() prefers to operate on 'char *', it's simpler to avoid casts by just typing things as 'char *' from the get-go. [Technically, read can operate on an 'unsigned char *' thanks to the C rule that any pointer can be implicitly converted to 'char *' for legacy K&R compatibility; but where this patch saves us is if we try to use virfile.h functions that take 'char **' in order to allocate the buffer, where the compiler would barf on type mismatch.] * src/util/virstoragefile.c (FileTypeInfo): Avoid unsigned char. (cowGetBackingStore, qcow2GetBackingStoreFormat) (qcowXGetBackingStore, qcow1GetBackingStore) (qcow2GetBackingStore, vmdk4GetBackingStore, qedGetBackingStore) (virStorageFileMatchesMagic, virStorageFileMatchesVersion) (virStorageFileProbeFormatFromBuf, qcow2GetFeatures) (virStorageFileGetMetadataInternal) (virStorageFileProbeFormatFromFD): Simplify clients. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Giuseppe Scrivano 提交于
It uses the same functionalities of the qemu driver. Signed-off-by: NGiuseppe Scrivano <gscrivan@redhat.com>
-
由 Michal Privoznik 提交于
Since the 90139a62 commit the error is copied into mon->lastError but it's never freed from there. ==31989== 395 bytes in 1 blocks are definitely lost in loss record 877 of 978 ==31989== at 0x4A06C2B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==31989== by 0x7EAF129: strdup (in /lib64/libc-2.15.so) ==31989== by 0x50D586C: virStrdup (virstring.c:554) ==31989== by 0x50976C1: virCopyError (virerror.c:191) ==31989== by 0x5097A35: virCopyLastError (virerror.c:312) ==31989== by 0x114909A9: qemuMonitorIO (qemu_monitor.c:690) ==31989== by 0x509BEDE: virEventPollDispatchHandles (vireventpoll.c:501) ==31989== by 0x509C701: virEventPollRunOnce (vireventpoll.c:648) ==31989== by 0x509A620: virEventRunDefaultImpl (virevent.c:274) ==31989== by 0x520D21C: virNetServerRun (virnetserver.c:1112) ==31989== by 0x11F368: main (libvirtd.c:1513) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 11月, 2013 3 次提交
-
-
由 Zeng Junliang 提交于
If there's a migration cancelled, the bitmap of migration port should be cleaned up too. Signed-off-by: NZeng Junliang <zengjunliang@huawei.com> Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Laine Stump 提交于
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1020135 If networkAllocateActualDevice() had failed due to a pool of hostdev or direct devices being depleted, the calling function could still call networkReleaseActualDevice() as part of its cleanup, and that function would then unconditionally decrement the connections count for the network, even though it hadn't been incremented (due to failure of allocate). This *was* necessary because the .actual member of the netdef was allocated with a "lazy" algorithm, only being created if there was a need to store data there (e.g. if a device was allocated from a pool, or bandwidth was allocated for the device), so there was no simple way for networkReleaseActualDevice() to tell if something really had been allocated (i.e. if "connections++" had been executed). This patch changes networkAllocateDevice() to *always* allocate an actual device for any netdef of type='network', even if it isn't needed for any other reason. This has no ill effects anywhere else in the code (except for using a small amount of memory), and networkReleaseActualDevice() can then determine if there was a previous successful allocate by checking for .actual != NULL (if not, it skips the "connections--").
-
由 Guido Günther 提交于
Needed for architectures that don't use gcc atomic ops but pthread. This fixes the armel build that otherwise breaks like: CCLD virt-login-shell ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virClassNew': /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:150: undefined reference to `virAtomicLock' ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectNew': /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:202: undefined reference to `virAtomicLock' ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectUnref': /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:274: undefined reference to `virAtomicLock' ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectRef': /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:295: undefined reference to `virAtomicLock' collect2: error: ld returned 1 exit status See https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=armel&ver=1.1.4-1&stamp=1383588268
-
- 05 11月, 2013 10 次提交
-
-
由 Eric Blake 提交于
A qcow2 file with a backing file of 'gluster://host/vol/file' should not try to look for a directory named './gluster:/' in the file system. * src/util/virstoragefile.c (virBackingStoreIsFile): Broaden check to include all protocols. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Ján Tomko 提交于
Since qemu-kvm 1.1 [1] (since 1.3. in upstream QEMU [2]) '-no-kvm-pit-reinjection' has been deprecated. Use -global kvm-pit.lost_tick_policy=discard instead. https://bugzilla.redhat.com/show_bug.cgi?id=978719 [1] http://git.kernel.org/cgit/virt/kvm/qemu-kvm.git/commit/?id=4e4fa39 [2] http://git.qemu.org/?p=qemu.git;a=commitdiff;h=c21fb4f
-
由 John Ferlan 提交于
Coverity complains that the call to virPCIDeviceDetach() in qemuPrepareHostdevPCIDevices() doesn't check status return like other calls. Seems this just was lurking until a recent change to this module resulted in Coverity looking harder and finding the issue. Introduced by 'a4efb2e3' when function was called 'pciReAttachDevice()' Just added a ignore_value() since it doesn't appear to matter if the call fails since we're on a failure path already.
-
由 Daniel P. Berrange 提交于
Currently the LXC container tries to skip selinux/securityfs mounts if the directory does not exist in the filesystem, or if SELinux is disabled. The former check is flawed because the /sys/fs/selinux or /sys/kernel/securityfs directories may exist in sysfs even if the mount type is disabled. Instead of just doing an access() check, use an virFileIsMounted() to see if the FS is actually present in the host OS. This also avoids the need to check is_selinux_enabled(). Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Some mounts must be skipped if running inside a user namespace, since the kernel forbids their use. Instead of strcmp'ing the filesystem type in the body of the loop, set an explicit flag in the lxcBasicMounts table. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Currently the lxcBasicMounts array has separate entries for most mounts, to reflect that we must do a separate mount operation to make mounts read-only. Remove the duplicate entries and instead set the MS_RDONLY flag against the main entry. Then change lxcContainerMountBasicFS to look for the MS_RDONLY flag, mask it out & do a separate bind mount. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The 'srcpath' variable is initialized from 'mnt->src' and never changed thereafter. Some places continue to use 'mnt->src' and others use 'srcpath'. Remove the pointless 'srcpath' variable and use 'mnt->src' everywhere. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virLXCBasicMountInfo struct contains a 'char *opts' field passed onto the mount() syscall. Every entry in the list sets this to NULL though, so it can be removed to simplify life. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 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>
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1018897 If a PCI deivce is not binded to any driver (e.g. there's yet no PCI driver in the linux kernel) but still users want to passthru the device we fail the whole operation as we fail to resolve the 'driver' link under the PCI device sysfs tree. Obviously, this is not a fatal error and it shouldn't be error at all. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 04 11月, 2013 12 次提交
-
-
由 Peter Krempa 提交于
Until now the map was loaded from the XML definition file every time a operation on the flags was requested. With the introduciton of one shot initializers we can store the definition forever (as it will never change) instead of parsing it over and over again.
-
由 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 提交于
Now that all libnuma functions used by libvirt are wrapped in virNuma we can remove the dependancy from nodeinfo.
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
The function was called in a single place only and was reporting errors that were later ignored. Use the virNumaGetNodeMemory helper to get the size of the memory in the NUMA node and remove the helper
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Avoid necessary checks for the numa library with this helper.
-
由 Peter Krempa 提交于
linuxNodeGetCPUStats() and linuxNodeGetMemoryStats() are static and don't need a forward declaration.
-
由 Peter Krempa 提交于
All functions from libnuma must be protected with ifdefs. Avoid this by using our own wrapper.
-
由 Ryota Ozaki 提交于
aa0f0992 introduced a strict error checking for getsockopt and it revealed that getting a peer credential of a socket on FreeBSD didn't work. Libvirtd hits the error: error : virNetSocketGetUNIXIdentity:1198 : Failed to get valid client socket identity groups SOL_SOCKET (0xffff) was used as a level of getsockopt for LOCAL_PEERCRED, however, it was wrong. 0 is correct as well as Mac OS X. So for LOCAL_PEERCRED our options are SOL_LOCAL (if defined) or 0 on Mac OS X and FreeBSD. According to the fact, the patch simplifies the code by removing ifdef __APPLE__. I tested the patch on FreeBSD 8.4, 9.2 and 10.0-BETA1. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
-
- 03 11月, 2013 1 次提交
-
-
由 Doug Goldstein 提交于
With Mac OS X 10.9, xdrproc_t is no longer defined as: typedef bool_t (*xdrproc_t)(XDR *, ...); but instead as: typdef bool_t (*xdrproc_t)(XDR *, void *, unsigned int); For reference, Linux systems typically define it as: typedef bool_t (*xdrproc_t)(XDR *, void *, ...); The rationale explained in the header is that using a vararg is incorrect and has a potential to change the ABI slightly do to compiler optimizations taken and the undefined behavior. They decided to specify the exact number of parameters and for compatibility with old code decided to make the signature require 3 arguments. The third argument is ignored for cases that its not used and its recommended to supply a 0.
-
- 01 11月, 2013 7 次提交
-
-
由 Jeremy Fitzhardinge 提交于
Rather than casting the virBitmap pointer to uint8_t* and then using the structure contents as a byte array, use the virBitmap API to determine the bitmap size and test each bit. Signed-off-by: NJeremy Fitzhardinge <jeremy@goop.org>
-
由 Jim Fehlig 提交于
This reverts commit 394d6e0a. The real problem is accessing the virtBitmap structure as a byte array, which was correctly identified and fixed by Jeremy Fitzhardinge https://www.redhat.com/archives/libvir-list/2013-October/msg01257.html
-
由 Bamvor Jian Zhang 提交于
in recently xen commit: 7051d5c8, there is a api changes in libxl_domain_create_restore. Author: Andrew Cooper <andrew.cooper3@citrix.com> Date: Thu Oct 10 12:23:10 2013 +0100 tools/migrate: Fix regression when migrating from older version of Xen use the macro LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS in libxl.h in order to make libvirt could compile with old and new xen. the params checkpointed_stream is useful if libvirt libxl driver support migration. for new, set it as zero. Signed-off-by: NBamvor Jian Zhang <bjzhang@suse.com>
-
由 Daniel P. Berrange 提交于
When starting a transient VM the first thing done is to check for duplicates. The check looks if there are any running VMs with the matching name/uuid. It explicitly allows there to be inactive VMs, so that a persistent VM can be temporarily booted with a different config. There is a race condition, however, where 2 or more clients try to create the same transient VM. The first client will cause a virDomainObjPtr to be added to the domain list, and it is inactive at this stage. The second client may then come along and see this inactive VM, and mistake it for a persistent VM. If the first VM fails to start its transient guest for any reason, then it'll remove the virDomainObjPtr from the list. The second client now has a virDomainObjPtr that it can try to boot, which libvirt no longer has a record of. The result can be a running QEMU process that is orphaned. It was also, however, possible for the virDomainObjPtr to be completely free'd which will cause libvirtd to crash in some scenarios. The fix is to only allow an existing inactive VM if it is marked as persistent. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Ján Tomko 提交于
Instead of using a port from the remote display range. https://bugzilla.redhat.com/show_bug.cgi?id=1025699
-
由 Ryota Ozaki 提交于
Thie patch fixes the segfault: error : nodeStateInitialize:658 : DBus not available, disabling HAL driver: internal error: Unable to get DBus system bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory error : nodeStateInitialize:719 : ?: Caught Segmentation violation dumping internal log buffer: This segfault occurs at the below VIR_ERROR: failure: if (dbus_error_is_set(&err)) { VIR_ERROR(_("%s: %s"), err.name, err.message); When virDBusGetSystemBus fails, the code jumps to the above failure path. However, the err variable is not correctly initialized before calling virDBusGetSystemBus. As a result, dbus_error_is_set may pass over the uninitialized err variable whose name or message may point to somewhere unknown memory region, which causes a segfault on VIR_ERROR. The new code initializes the err variable before calling virDBusGetSystemBus. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
-
由 Daniel P. Berrange 提交于
Include reference of the VM object pointer and name in debug logs for QEMU start/stop functions. Also make sure we log the PID that we started, since it isn't available elsewhere in the logs. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-