- 11 7月, 2012 1 次提交
-
-
由 Sascha Peilicke 提交于
Fix the virStorageBackendFileSystemVolDelete method to not use unlink() unconditionally. It must use rmdir() for volumes which are directories. It should also raise an error if given a volume which has the network/block type.
-
- 10 7月, 2012 1 次提交
-
-
由 Osier Yang 提交于
All the callers of virDirCreate are updated incidentally.
-
- 09 7月, 2012 3 次提交
-
-
由 Peter Krempa 提交于
Commit 122fa379 introduces option to store more than one host entry in a storage pool source definition. That commit causes a regression, where a check is added that only one host entry should be present (that actualy is not present as the source structure was just allocated and zeroed) instead of allocating memory for the host entry.
-
由 Peter Krempa 提交于
As the storage pool sources are stored in a list of structs, the pointer returned by virStoragePoolSourceListNewSource() shouldn't be freed as it points in the middle of a memory block. This combined with a regression that takes the error path every time on caused a double-free abort on the src struct in question.
-
由 Peter Krempa 提交于
-
- 28 6月, 2012 1 次提交
-
-
由 Osier Yang 提交于
mnt_fsname can not be the same, as we check the duplicate pool sources earlier before, means it can't be the same pool, moreover, a pool can't be started if it's already active anyway. So no reason to act as success.
-
- 21 6月, 2012 1 次提交
-
-
由 Osier Yang 提交于
The comment says: /* Now create the final dir in the path with the uid/gid/mode * requested in the config. If the dir already exists, just set * the perms. */ However, virDirCreate is only invoked if the target path doesn't exist yet (which is opposite with the comment), or the uid from the config is not -1 (I don't understand why, think it's just another mistake). And the result is the perms of the pool won't be changed if one tries to build the pool with different perms again. Besides these logic error fix, if no uid and gid are specified in the config, the practical used uid, gid are reflected.
-
- 30 4月, 2012 1 次提交
-
-
由 Wido den Hollander 提交于
The current storage pools for NFS and iSCSI only require one host to connect to. Future storage pools like RBD and Sheepdog will require multiple hosts. This patch allows multiple source hosts and rewrites the current storage drivers. Signed-off-by: NWido den Hollander <wido@widodh.nl>
-
- 01 2月, 2012 1 次提交
-
-
由 Zeeshan Ali (Khattak) 提交于
Currently only VIR_STORAGE_VOL_RESIZE_DELTA flag is supported.
-
- 04 12月, 2011 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a misuse of 'an' where 'a' is proper; that has since been fixed, but a search found other problems (some were a spelling error for 'and', while most were fixed by 'a'). * daemon/stream.c: Fix grammar. * src/conf/domain_conf.c: Likewise. * src/conf/domain_event.c: Likewise. * src/esx/esx_driver.c: Likewise. * src/esx/esx_vi.c: Likewise. * src/rpc/virnetclient.c: Likewise. * src/rpc/virnetserverprogram.c: Likewise. * src/storage/storage_backend_fs.c: Likewise. * src/util/conf.c: Likewise. * src/util/dnsmasq.c: Likewise. * src/util/iptables.c: Likewise. * src/xen/xen_hypervisor.c: Likewise. * src/xen/xend_internal.c: Likewise. * src/xen/xs_internal.c: Likewise. * tools/virsh.c: Likewise.
-
- 02 12月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Many of these were mentioned by Yuri Chornoivan in: https://bugzilla.redhat.com/show_bug.cgi?id=669506 * src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling. * src/conf/netdev_vport_profile_conf.c (virNetDevVPortProfileParse): Likewise. * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags): Likewise. * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise. * src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemBuild): Likewise. * daemon/libvirtd.conf: Likewise. * src/util/logging.c (virLogMessage): Likewise. * src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise. * src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
-
- 25 10月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Splitting into two functions allows the user to call the right function, rather than having to remember that a *Free function is an exception to the rule. * src/conf/storage_conf.h (virStoragePoolSourceClear): New function. * src/libvirt_private.syms (storage_conf.h): Export it. * src/conf/storage_conf.c (virStoragePoolSourceFree): Split... (virStoragePoolSourceClear): ...into new function. (virStoragePoolDefFree, virStoragePoolDefParseSourceString): Update callers. * src/test/test_driver.c (testStorageFindPoolSources): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemNetFindPoolSourcesFunc) (virStorageBackendFileSystemNetFindPoolSources): Likewise. * src/storage/storage_backend_iscsi.c (virStorageBackendISCSIFindPoolSources): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalFindPoolSources): Likewise.
-
- 01 10月, 2011 1 次提交
-
-
由 Serge E. Hallyn 提交于
If the regexes supported (?:pvs)?, then we could handle this by optionally matching but not returning the initial command name. But it doesn't. So add a new char* argument to virStorageBackendRunProgRegex(). If that argument is NULL then we act as usual. Otherwise, if the string at that argument is found at the start of a returned line, we drop that before running the regex. With this patch, virt-manager shows me lvs with command_names 1 or 0. The definitions of PVS_BASE etc may want to be moved into the configure scripts (though given how PVS is found, IIUC that could only happen if pvs was a link to pvs_real), but in any case no sense dealing with that until we're sure this is an ok way to handle it. Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com> Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 16 9月, 2011 1 次提交
-
-
由 Peter Krempa 提交于
Mac OS X 10.6. Snow Leopard and probably other do not provide a mkfs command to create filesystems. Macro MKFS then remained undefined and did not provide any substitute, so that build failed on a missing argument.
-
- 02 9月, 2011 1 次提交
-
-
由 Osier Yang 提交于
This patch adds the ability to make the filesystem for a filesystem pool during a pool build. The patch adds two new flags, no overwrite and overwrite, to control when mkfs gets executed. By default, the patch preserves the current behavior, i.e., if no flags are specified, pool build on a filesystem pool only makes the directory on which the filesystem will be mounted. If the no overwrite flag is specified, the target device is checked to determine if a filesystem of the type specified in the pool is present. If a filesystem of that type is already present, mkfs is not executed and the build call returns an error. Otherwise, mkfs is executed and any data present on the device is overwritten. If the overwrite flag is specified, mkfs is always executed, and any existing data on the target device is overwritten unconditionally.
-
- 01 9月, 2011 1 次提交
-
-
由 Osier Yang 提交于
Commit 0376f4a6 intended to fix incorrect use of VIR_ERR_NO_SUPPORT, but replacing it with VIR_ERR_OPERATION_INVALID is not proper either.
-
- 23 8月, 2011 1 次提交
-
-
由 Osier Yang 提交于
-
- 12 8月, 2011 1 次提交
-
-
由 Peter Krempa 提交于
Fix internals of libvirt for new storage volume type. Libvirt reported an invalid type of the volume. BZ #727088
-
- 22 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
In preparation for a future patch adding new virFile APIs. * src/util/files.h, src/util/files.c: Move... * src/util/virfile.h, src/util/virfile.c: ...here, and rename functions to virFile prefix. Macro names are intentionally left alone. * *.c: All '#include "files.h"' uses changed. * src/Makefile.am (UTIL_SOURCES): Reflect rename. * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise. * src/libvirt_private.syms: Likewise. * docs/hacking.html.in: Likewise. * HACKING: Regenerate.
-
- 21 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
* src/conf/domain_event.c (virDomainEventDispatch): Fix typo. * src/internal.h (ATTRIBUTE_FMT_PRINTF): Likewise. * src/libvirt.c (virStreamEventUpdateCallback): Likewise. * src/remote/remote_driver.c (doRemoteOpen): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. * src/util/virterror.c (virConnCopyLastError, virCopyLastError): Likewise. * src/xen/xend_internal.h (xend_wait_for_devices): Likewise.
-
- 14 7月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
Getting metadata on storage allocates a memory (path) which need to be freed after use otherwise it gets leaked. This means after use of virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one must call virStorageFileFreeMetadata to free it. This function frees structure internals and structure itself.
-
- 13 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
* src/storage/storage_backend.c (virStorageBackendCreateBlockFrom) (virStorageBackendCreateQemuImg) (virStorageBackendCreateQcowCreate): Reject unknown flags. * src/storage/storage_backend_disk.c (virStorageBackendDiskBuildPool) (virStorageBackendDiskDeleteVol): Likewise. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemNetFindPoolSources) (virStorageBackendFileSystemBuild) (virStorageBackendFileSystemDelete, createFileDir) (virStorageBackendFileSystemVolBuildFrom) (virStorageBackendFileSystemVolDelete): Likewise. * src/storage/storage_backend_iscsi.c (virStorageBackendISCSIFindPoolSources): Likewise. * src/storage/storage_backend_logical.c (virStorageBackendLogicalFindPoolSources) (virStorageBackendLogicalBuildPool) (virStorageBackendLogicalDeletePool) (virStorageBackendLogicalDeleteVol): Likewise. * src/storage/storage_driver.c (storageOpen, storagePoolCreate) (storagePoolDefine, storagePoolRefresh, storagePoolGetXMLDesc) (storageVolumeCreateXML, storageVolumeCreateXMLFrom) (storageVolumeGetXMLDesc): Likewise.
-
- 06 7月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
Some callers expected virFileMakePath to set errno, some expected it to return an errno value. Unify this to return 0 on success and -1 on error. Set errno to report detailed error information. Also optimize virFileMakePath if stat fails with an errno different from ENOENT.
-
- 08 6月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
Seems reasonable to have all command wrappers in the same place v2: Dont move SetInherit v3: Comment spelling fix Adjust WARN0 comment Remove spurious #include movement Don't include sys/types.h Combine virExec enums Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 03 6月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Coverity detected that options was being set by strdup but never freed. But why even bother with an options variable? The options parameter never changes! Leak present since commit 44948f5b (0.7.0). This function could probably be rewritten to take better advantage of virCommand, but that is more invasive. * src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Avoid wasted strdup, and guarantee proper cleanup on all paths.
-
- 01 6月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
Since directories can be used for <filesystem> passthrough, they are basically storage volumes. v2: Skip ., .., lost+found dirs v3: Use gnulib last_component v4: Use gnulib "dirname.h", not system <dirname.h> Don't skip lost+found
-
- 17 5月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
Some clients overwrite the error from the regex helper, or do half-baked error reporting with the exitstatus.
-
- 12 3月, 2011 1 次提交
-
-
由 Philipp Hahn 提交于
Currently a single storage volume with a broken backing file will disable the whole storage pool. This can happen when the backing file is on some unavailable network storage or if the backing volume is deleted, while the storage volumes using it remain. Since the storage pool can not be re-activated, re-creating the missing or deleting the now useless volumes using libvirt only is not possible. Fixing this is a little bit tricky: 1. virStorageBackendProbeTarget() only detects the missing backing file, if the backing file format is not explicitly specified. If the backing file is created using kvm-img create -f qcow2 -o backing_fmt=qcow2,backing_file=... ... no error is detected at this stage. The new return code -3 signals that the backing file could not be opened. 2. The backingStore.format must be >= 0, since values < 0 would break virStorageVolTargetDefFormat() when dumping the XML data such as <format type='...'/> Because of this the format is faked as VIR_STORAGE_FILE_RAW. 3. virStorageBackendUpdateVolTargetInfo() always opens the backing file and thus always detects a missing backing file. Since it "only" updates the capacity, allocation, owner, group, mode and SELinux label, just ignore errors at this stage, print an error message and continue. 4. Using vol-dump on a broken volume still doesn't work, but at least vol-destroy and pool-refresh do work now. To reproduce: dir=$(mktemp -d) virsh pool-create-as tmp dir '' '' '' '' "$dir" virsh vol-create-as --format qcow2 tmp back 1G virsh vol-create-as --format qcow2 --backing-vol-format qcow2 --backing-vol back tmp cow 1G virsh vol-delete --pool tmp back virsh pool-refresh tmp After the last step, the pool will be gone (because it was not persistent). As long as the now broken image stays in the directory, you will not be able to re-create or re-start the pool. Signed-off-by: NPhilipp Hahn <hahn@univention.de>
-
- 24 2月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Remove the <stdbool.h> header from all source files / headers and just put it into internal.h * src/internal.h: Add <stdbool.h>
-
- 21 12月, 2010 1 次提交
-
-
由 Osier Yang 提交于
If there is a dangling symbolic link in filesystem pool, the pool will fail to start or refresh, this patch is to fix it by ignoring it with a warning log.
-
- 23 11月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
When libvirt starts up all storage pools default to the inactive state, even if the underlying storage is already active on the host. This introduces a new API into the internal storage backend drivers that checks whether a storage pool is already active. If the pool is active at libvirtd startup, the volume list will be immediately populated. * src/storage/storage_backend.h: New internal API for checking storage pool state * src/storage/storage_driver.c: Check whether a pool is active upon driver startup * src/storage/storage_backend_fs.c, src/storage/storage_backend_iscsi.c, src/storage/storage_backend_logical.c, src/storage/storage_backend_mpath.c, src/storage/storage_backend_scsi.c: Add checks for pool state
-
- 17 11月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Also, fdopen() is replaced with VIR_FDOPEN(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write mode already had the fclose()< 0 check and I converted those to VIR_FCLOSE()< 0. I did not find occurrences of possible double-closed files on the way.
-
- 10 11月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
Using automated replacement with sed and editing I have now replaced all occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of course. Some replacements were straight forward, others I needed to pay attention. I hope I payed attention in all the right places... Please have a look. This should have at least solved one more double-close error.
-
- 31 7月, 2010 1 次提交
-
-
由 Eric Blake 提交于
Found by clang. Clang complained that virStorageBackendProbeTarget could dereference NULL if backingStoreFormat was NULL, but since all callers passed a valid pointer, I added attributes instead of null checks. * src/storage/storage_backend.c (virStorageBackendQEMUImgBackingFormat): Kill dead store. * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget): Likewise. Skip null checks, by adding attributes.
-
- 22 7月, 2010 1 次提交
-
-
由 Laine Stump 提交于
virDirCreate also previously returned 0 on success and errno on failure. This makes it fit the recommended convention of returning 0 on success, -errno (ie a negative number) on failure.
-
- 20 7月, 2010 2 次提交
-
-
由 Daniel P. Berrange 提交于
The storage volume lookup code was probing for the backing store format, instead of using the format extracted from the file itself. This meant it could report in accurate information. If a format is included in the file, then use that in preference, with probing as a fallback. * src/storage/storage_backend_fs.c: Use extracted backing store format
-
由 Daniel P. Berrange 提交于
Require the disk image to be passed into virStorageFileGetMetadata. If this is set to VIR_STORAGE_FILE_AUTO, then the format will be resolved using probing. This makes it easier to control when probing will be used * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c, src/security/security_selinux.c, src/security/virt-aa-helper.c: Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata. * src/storage/storage_backend_fs.c: Probe for disk format before calling virStorageFileGetMetadata. * src/util/storage_file.h, src/util/storage_file.c: Remove format from virStorageFileMeta struct & require it to be passed into method.
-
- 29 5月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
If a directory pool contains pipes or sockets, a pool start can fail or hang: https://bugzilla.redhat.com/show_bug.cgi?id=589577 We already try to avoid these special files, but only attempt after opening the path, which is where the problems lie. Unify volume opening into helper functions, which use the proper open() flags to avoid error, followed by fstat to validate storage mode. Previously, virStorageBackendUpdateVolTargetInfoFD attempted to enforce the storage mode check, but allowed callers to detect this case and silently continue. In practice, only the FS backend was using this feature, the rest were treating unknown mode as an error condition. Unfortunately the InfoFD function wasn't raising an error message here, so error reporting was busted. This patch adds 2 functions: virStorageBackendVolOpen, and virStorageBackendVolOpenModeSkip. The latter retains the original opt out semantics, the former now throws an explicit error. This patch maintains the previous volume mode checks: allowing specific modes for specific pool types requires a bit of surgery, since VolOpen is called through several different helper functions. v2: Use ATTRIBUTE_NONNULL. Drop stat check, just open with O_NONBLOCK|O_NOCTTY. v3: Move mode check logic back to VolOpen. Use 2 VolOpen functions with different error semantics. v4: Make second VolOpen function more extensible. Didn't opt to change FS backend defaults, this can just be to fix the original bug. v5: Prefix default flags with VIR_, use ATTRIBUTE_RETURN_CHECK
-
- 14 4月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Use virAsprintf only when needed. In this case, strdup works fine.
-
由 Jim Meyering 提交于
* src/storage/storage_backend_fs.c (virStorageBackendFileSystemMount): Clang was not smart enough, and mistakenly reported that "options" could be used uninitialized. Initialize it.
-