- 27 3月, 2017 1 次提交
-
-
由 Martin Kletzander 提交于
These helpers are doing just a read and covert the value, but they properly size the read limit, handle additional whitespace characters, and unify error reporting. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 24 2月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
Arguably though, function returning only on success is a very interesting, although quite impractical concept. Also, the errno isn't and shouldn't be preserved in this case, since the errno can be directly fed to the virReportSystemError. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 11 2月, 2017 1 次提交
-
-
由 Erik Skultety 提交于
So rather than comparing 2 paths (strings) as they are, which can very easily lead to unnecessary errors (e.g. in storage driver) that the paths are not the same when in fact they'd be e.g. just symlinks to the same location, we should put our best effort into resolving any symlinks and canonicalizing the path and only then compare the 2 paths for equality. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
- 07 2月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
We will need to traverse the symlinks one step at the time. Therefore we need to see where a symlink is pointing to. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 1月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
This is a simple wrapper over mount(). However, not every system out there is capable of moving a mount point. Therefore, instead of having to deal with this fact in all the places of our code we can have a simple wrapper and deal with this fact at just one place. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 05 1月, 2017 1 次提交
-
-
由 Martin Kletzander 提交于
The resulting function virFileGetMountSubtreeImpl() just uses virStringSortRevCompare or virStringSortCompare which uses strcmp(). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 16 12月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Other systems (despite having sys/mount.h) do not support bind mounts. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 12月, 2016 2 次提交
-
-
由 Michal Privoznik 提交于
Namely, virFileGetACLs, virFileSetACLs, virFileFreeACLs and virFileCopyACLs. These functions are going to be required when we are creating /dev for qemu. We have copy anything that's in host's /dev exactly as is. Including ACLs. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
This part of code that LXC currently uses will be reused so move to a generic function. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 12月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
There are couple of places where we have a string and want to save it to a file. Atomically. In all those places we use virFileRewrite() but also implement the very same callback which takes the string and write it into temp file. This makes no sense. Unify the callbacks and move them to one place. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 01 12月, 2016 1 次提交
-
-
由 Laine Stump 提交于
This new function just calls fstat() (if provided with a valid fd) or stat() (if fd is -1) and returns st_size (or -1 if there is an error). We may decide we want this function to be more complex, and handle things like block devices - this is a placeholder (that works) for any more complicated function.
-
- 25 11月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We have couple of functions that operate over NULL terminated lits of strings. However, our naming sucks: virStringJoin virStringFreeList virStringFreeListCount virStringArrayHasString virStringGetFirstWithPrefix We can do better: virStringListJoin virStringListFree virStringListFreeCount virStringListHasString virStringListGetFirstWithPrefix Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 11月, 2016 1 次提交
-
-
由 Marc Hartmayer 提交于
Only generate a warning if there is something to report. Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
-
- 24 6月, 2016 8 次提交
-
-
由 Ján Tomko 提交于
Prefer virDirOpen.
-
由 Ján Tomko 提交于
A helper function that does not report any errors.
-
由 Ján Tomko 提交于
Just like virDirOpen, but it returns 0 without reporting an error on ENOENT.
-
由 Ján Tomko 提交于
Switch from opendir to virDirOpen everywhere we need to report an error.
-
由 Ján Tomko 提交于
A helper that calls opendir and reports an error if it fails.
-
由 Ján Tomko 提交于
It skips those directory entries.
-
由 Ján Tomko 提交于
All of the callers either skip these explicitly, skip all entries starting with a dot or match the entry name against stricter patterns.
-
由 Ján Tomko 提交于
Introduce a helper that only calls closedir if DIR* is non-NULL and sets it to NULL afterwards.
-
- 20 6月, 2016 1 次提交
-
-
由 Chen Hanxiao 提交于
s/succcess/success Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
-
- 13 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Move some parts of virStorageFileRemoveLastPathComponent into a separate function so they can be reused. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 5月, 2016 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
-
- 20 4月, 2016 1 次提交
-
-
由 Cole Robinson 提交于
This an ubuntu/debian packaging convention. At one point it may have been an actually different binary, but at least as of ubuntu precise (the oldest supported ubuntu distro, released april 2012) kvm-img is just a symlink to qemu-img for back compat. I think it's safe to drop support for it
-
- 19 3月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
The implementation is pretty straightforward. Moreover, because of the nature of things, gethostbyname_r and gethostbyname2_r can be implemented at the same time too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 10 3月, 2016 2 次提交
-
-
由 Cole Robinson 提交于
NFS with root-squash is the only reason we need to do setuid/setgid crazyness in virFileRemove, so limit that behavior to the NFS case.
-
由 Cole Robinson 提交于
Break these checks out into their own function, and clearly document each one. This shouldn't change behavior
-
- 04 11月, 2015 1 次提交
-
-
由 Jiri Denemark 提交于
VIR_DEBUG and VIR_WARN will automatically add a new line to the message, having "\n" at the end or at the beginning of the message results in empty lines. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 21 10月, 2015 1 次提交
-
-
由 Ishmanpreet Kaur Khera 提交于
We have macros for both positive and negative string matching. Therefore there is no need to use !STREQ or !STRNEQ. At the same time as we are dropping this, new syntax-check rule is introduced to make sure we won't introduce it again. Signed-off-by: NIshmanpreet Kaur Khera <khera.ishman@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 14 10月, 2015 2 次提交
-
-
由 John Ferlan 提交于
After a successful creation of a directory, if some other call results in returning a failure, let's remove the directory we created to prevent another round trip or confusion in the caller. In particular, this function can be called during a storage backend buildVol, so in order to ensure that caller doesn't need to distinguish between failed create or some other failure after create, just remove the directory we created. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
After a successful creation of a file, if some other call results in returning a failure, let's unlink the file we created to prevent another round trip or confusion in the caller. In particular, this function can be called during a storage backend buildVol, so in order to ensure that caller doesn't need to distinguish between failed create or some other failure after create, just remove the volume we created. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 05 10月, 2015 2 次提交
-
-
由 John Ferlan 提交于
As it turns out the caller in this case expects a return < 0 for failure and to get/use "errno" rather than using the negative of returned status. Again different than the create path. If someone "deleted" a file from the pool without using virsh vol-delete, then the unlink/rmdir would return an error (-1) and set errno to ENOENT. The caller checks errno for ENOENT when determining whether to throw an error message indicating the failure. Without the change, the error message is: error: Failed to delete vol $vol error: cannot unlink file '/$pathto/$vol': Success This patch thus allows the fork path to follow the non-fork path where unlink/rmdir return -1 and errno.
-
由 John Ferlan 提交于
Unlike create options, if the file to be removed is already in the pool, then the uid/gid will come from the pool. If it's the same as the currently running process, then just do the unlink/rmdir directly rather than going through the fork processing unnecessarily
-
- 21 9月, 2015 4 次提交
-
-
由 John Ferlan 提交于
Rather than inlining the code, use the common API.
-
由 John Ferlan 提交于
Rather than inlining the code, use the common API.
-
由 John Ferlan 提交于
Rather than inlining the code, use the common API
-
由 John Ferlan 提交于
Similar to commit id '35847860', it's possible to attempt to create a 'netfs' directory in an NFS root-squash environment which will cause the 'vol-delete' command to fail. It's also possible error paths from the 'vol-create' would result in an error to remove a created directory if the permissions were incorrect (and disallowed root access). Thus rename the virFileUnlink to be virFileRemove to match the C API functionality, adjust the code to following using rmdir or unlink depending on the path type, and then use/call it for the VIR_STORAGE_VOL_DIR
-
- 16 9月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Commit id 'f1f68ca3' added code to remove the directory paths for auto-generated sockets, but that code could be called before the paths were created resulting in generating error messages from virFileDeleteTree indicating that the file doesn't exist. Rather than "enforce" all callers to make the non-NULL and existence checks, modify the virFileDeleteTree API to silently ignore NULL on input and non-existent directory trees.
-
- 08 9月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
Commit 35847860 Added the virFileUnlink function, but failed to add a version for mingw build, causing the following error: Cannot export virFileUnlink: symbol not defined Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-