- 28 10月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
The 2nd and 3rd hunk show the only double-closed file descriptor code part that I found while trying to clean up close(). The first hunk seems a harmless cleanup in that same file.
-
- 20 8月, 2010 2 次提交
-
-
由 Eric Blake 提交于
* src/storage/storage_backend.c (virStorageBackendCreateQemuImg) (virStorageBackendCreateQcowCreate): Use virAsprintf instead. * src/storage/storage_backend_disk.c (virStorageBackendDiskCreateVol, virStorageBackendDiskPartFormat): Likewise.
-
由 Eric Blake 提交于
* src/storage/storage_backend_disk.c (virStorageBackendDiskPartFormat): Fix spacing.
-
- 03 8月, 2010 1 次提交
-
-
由 Aurelien ROUGEMONT 提交于
- a pure typo error and a wrong command referenced in an error message.
-
- 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 4 次提交
-
-
由 Laine Stump 提交于
One error exit in virStorageBackendCreateBlockFrom was setting the return value to errno. The convention for volume build functions is to return 0 on success or -1 on failure. Not only was it not necessary to set the return value (it defaults to -1, and is set to 0 when everything has been successfully completed), in the case that some caller were checking for < 0 rather than != 0, they would incorrectly believe that it completed successfully.
-
由 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.
-
由 Laine Stump 提交于
Previously virStorageBackendCopyToFD would simply return -1 on error. This made the error return from one of its callers inconsistent (createRawFileOpHook is supposed to return -errno, but if virStorageBackendCopyToFD failed, createRawFileOpHook would just return -1). Since there is a useful errno in every case of error return from virStorageBackendCopyToFD, and since the other uses of that function ignore the return code (beyond simply checking to see if it is < 0), this is a safe change.
-
由 Laine Stump 提交于
virFileOperation previously returned 0 on success, or the value of errno on failure. Although there are other functions in libvirt that use this convention, the preferred (and more common) convention is to return 0 on success and -errno (or simply -1 in some cases) on failure. This way the check for failure is always (ret < 0). * src/util/util.c - change virFileOperation and virFileOperationNoFork to return -errno on failure. * src/storage/storage_backend.c, src/qemu/qemu_driver.c - change the hook functions passed to virFileOperation to return -errno on failure.
-
- 20 7月, 2010 5 次提交
-
-
由 Laine Stump 提交于
Originally the storage volume files were opened with O_DSYNC to make sure they were flushed to disk immediately. It turned out that this was extremely slow in some cases, so the O_DSYNC was removed in favor of just calling fsync() after all the data had been written. However, this call to fsync was inside the block that is executed to zero-fill the end of the volume file. In cases where the new volume is copied from an old volume, and they are the same length, this fsync would never take place. Now the fsync is *always* done, unless there is an error (in which case it isn't important, and is most likely inappropriate.
-
由 Laine Stump 提交于
A missing set of braces around an error condition caused us to skip zero'ing out the remainder of a new volume file if the new volume was longer than the original (the goto was supposed to be taken only in the case of error, but was always being taken).
-
由 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 提交于
When creating qcow2 files with a backing store, it is important to set an explicit format to prevent QEMU probing. The storage backend was only doing this if it found a 'kvm-img' binary. This is wrong because plenty of kvm-img binaries don't support an explicit format, and plenty of 'qemu-img' binaries do support a format. The result was that most qcow2 files were not getting a backing store format. This patch runs 'qemu-img -h' to check for the two support argument formats '-o backing_format=raw' '-F raw' and use whichever option it finds * src/storage/storage_backend.c: Query binary to determine how to set the 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.
-
- 16 7月, 2010 1 次提交
-
-
由 David Allan 提交于
There are many naming conventions for partitions associated with a block device. Some of the major ones are: /dev/foo -> /dev/foo1 /dev/foo1 -> /dev/foo1p1 /dev/mapper/foo -> /dev/mapper/foop1 /dev/disk/by-path/foo -> /dev/disk/by-path/foo-part1 The universe of possible conventions isn't clear. Rather than trying to understand all possible conventions, this patch divides devices into two groups, device mapper devices and everything else. Device mapper devices seem always to follow the convention of device -> devicep1; everything else is canonicalized.
-
- 15 6月, 2010 2 次提交
-
-
由 Eric Blake 提交于
Daniel's patch works with gcc and CFLAGS containing -O (the autoconf default), but fails with non-gcc or with other CFLAGS (such as -g), since c-ctype.h declares c_isdigit as a macro only for certain compilation settings. * src/Makefile.am (libvirt_parthelper_LDFLAGS): Add gnulib library, for when c_isdigit is not a macro. * src/storage/parthelper.c (main): Avoid out-of-bounds dereference, noticed by Jim Meyering.
-
由 Daniel P. Berrange 提交于
Disks with a trailing digit in their path (eg /dev/loop0 or /dev/dm0) have an extra 'p' appended before the partition number (eg, to form /dev/loop0p1 not /dev/loop01). Fix the partition lookup to append this extra 'p' when required * src/storage/parthelper.c: Add a 'p' before partition number if required
-
- 08 6月, 2010 2 次提交
-
-
由 Daniel P. Berrange 提交于
The storage pool driver is mistakenly using the error code VIR_ERR_INVALID_STORAGE_POOL which is for diagnosing invalid pointers. This patch switches it to use VIR_ERR_NO_STORAGE_POOL which is the correct code for cases where the storage pool does not exist * src/storage/storage_driver.c: Replace VIR_ERR_INVALID_STORAGE_POOL with VIR_ERR_NO_STORAGE_POOL
-
由 Daniel P. Berrange 提交于
The storage pool driver is not doing correct checking for duplicate UUID/name values. This introduces a new method virStoragePoolObjIsDuplicate, based on the previously written virDomainObjIsDuplicate. * src/conf/storage_conf.c, src/conf/storage_conf.c, src/libvirt_private.syms: Add virStoragePoolObjIsDuplicate, * src/storage/storage_driver.c: Call virStoragePoolObjIsDuplicate for checking uniqueness of uuid/names
-
- 29 5月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
* src/storage/storage_backend.h (VIR_STORAGE_VOL_OPEN_DEFAULT): Adjust s/#define/# define/, and align continued lines.
-
由 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
-
- 26 5月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
Spurious / in a pool target path makes life difficult for apps using the GetVolByPath, and doing other path based comparisons with pools. This has caused a few issues for virt-manager users: https://bugzilla.redhat.com/show_bug.cgi?id=494005 https://bugzilla.redhat.com/show_bug.cgi?id=593565 Add a new util API which removes spurious /, virFileSanitizePath. Sanitize target paths when parsing pool XML, and for paths passed to GetVolByPath. v2: Leading // must be preserved, properly sanitize path=/, sanitize away /./ -> / v3: Properly handle starting ./ and ending /. v4: Drop all '.' handling, just sanitize / for now.
-
- 25 5月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
-
- 24 5月, 2010 2 次提交
-
-
由 Cole Robinson 提交于
Volume detection in the scsi backend was duplicating code already present in storage_backend.c. Let's drop the duplicate code. Also, change the shared function name to be less generic, and remove some error squashing in the other call site.
-
由 Cole Robinson 提交于
We were squashing error messages in a few cases. Recode to follow common ret = -1 convention. v2: Handle more error squashing issues further up in MakeNewVol and CreateVols. Use ret = -1 convention in MakeVols.
-
- 21 5月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
Run this command: git grep -l VIR_DEBUG|xargs perl -pi -e \ 's/(VIR_DEBUG0?)\s*\(_\((".*?")\)/$1($2/'
-
由 Jim Meyering 提交于
Run this: git grep -l 'VIR_ERROR\s*("'|xargs perl -pi -e \ 's/(VIR_ERROR)\s*\((".*?"),/$1(_($2),/'
-
- 18 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
virFileResolveLink was returning a positive value on error, thus confusing callers that assumed failure was < 0. The confusion is further evidenced by callers that would have ended up calling virReportSystemError with a negative value instead of a valid errno. Fixes Red Hat BZ #591363. * src/util/util.c (virFileResolveLink): Live up to documentation. * src/qemu/qemu_security_dac.c (qemuSecurityDACRestoreSecurityFileLabel): Adjust callers. * src/security/security_selinux.c (SELinuxRestoreSecurityFileLabel): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskDeleteVol): Likewise.
-
- 07 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* configure.ac: Drop sys/wait.h check. * src/libvirt.c (includes): Use header unconditionally. * src/remote/remote_driver.c (includes): Likewise. * src/storage/storage_backend.c (includes): Likewise. * src/util/ebtables.c (includes): Likewise. * src/util/hooks.c (includes): Likewise. * src/util/iptables.c (includes): Likewise. * src/util/util.c (includes): Likewise.
-
- 04 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
WIN32 is always defined when __MINGW32__ is defined, but the converse is not true. WIN32 is more generic, if someone were to ever attempt porting to a microsoft compiler. This does not affect Cygwin, which intentionally does not define WIN32. * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Use more generic flag macro. * src/storage/storage_backend.c (virStorageBackendUpdateVolTargetInfoFD) (virStorageBackendRunProgRegex): Likewise. * tools/console.h (vshRunConsole): Likewise.
-
- 30 4月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
* src/qemu/qemu_driver.c: Implementation of virDomainGetBlockInfo * src/util/storage_file.h: Add DEV_BSIZE * src/storage/storage_backend.c: Remove DEV_BSIZE
-
- 16 4月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
-
- 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.
-
- 08 4月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/storage/storage_backend.c (createRawFileOpHook): Remove dead stores and declaration of each stored-to variable.
-
- 06 4月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
-
- 20 3月, 2010 1 次提交
-
-
由 David Allan 提交于
-
- 16 3月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
Instead of opening storage file with O_DSYNC, make sure data are written to a disk only before we claim allocation has finished.
-
- 10 3月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
-
- 05 3月, 2010 1 次提交
-
-
由 Laine Stump 提交于
This allows the config to have a setting that means "leave it alone", eg when building a pool where the directory already exists the user may want the current uid/gid of the directory left intact. This actually gets us back to older behavior - before recent changes to the pool building code, we weren't as insistent about honoring the uid/gid settings in the XML, and virt-manager was taking advantage of this behavior. As a side benefit, removing calls to getuid/getgid from the XML parsing functions also seems like a good idea. And having a default that is different from a common/useful value (0 == root) is a good thing in general, as it removes ambiguity from decisions (at least one place in the code was checking for (perms.uid == 0) to see if a special uid was requested). Note that this will only affect newly created pools and volumes. Due to the way that the XML is parsed, then formatted for newly created volumes, all existing pools/volumes already have an explicit uid and gid set. src/conf/storage_conf.c: Remove calls to setuid/setgid for default values of uid/gid, and set them to -1 instead src/storage/storage_backend.c: src/storage/storage_backend_fs.c: Make account for the new default values of perms.uid and perms.gid.
-