- 03 1月, 2020 22 次提交
-
-
由 Daniel P. Berrangé 提交于
All places where we use strptime/timegm()/mktime() are handling conversion of dates in a format compatible with ISO 8601, so we can use the GDateTime APIs to simplify code. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
g_networking_init() does the same as our custom code. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Note the glib function returns a const string because it caches the hostname using a one time thread initializer function. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The canonicalize_file_name(path) is equivalent to calling realpath(path, NULL). Passing NULL for the second arg of realpath is not standardized behaviour, however, Linux, FreeBSD > 6.4 and macOS > 10.5 all support this critical extension. This leaves Windows which doesn't provide realpath at all. The g_canonicalize_filename() function doesn't expand symlinks, so is not strictly equivalent to realpath() but is close enough for our Windows portability needs right now. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
commandhelper.c is not converted since this is a standalone program only run on UNIX, so can rely on getcwd(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
A few places were importing dirname.h without actually using it. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The last_component() method is a GNULIB custom function that returns a pointer to the base name in the path. This is similar to g_path_get_basename() but without the malloc. The extra malloc is no trouble for libvirt's needs so we can use g_path_get_basename(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
g_get_real_time() returns the time since epoch in microseconds. It uses gettimeofday() internally while libvirt used clock_gettime because it is declared async signal safe. In practice gettimeofday is also async signal safe *provided* the timezone parameter is NULL. This is indeed the case in g_get_real_time(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The g_pattern_match function_simple is an acceptably close approximation of fnmatch for libvirt's needs. In contrast to fnmatch(), the '/' character can be matched by the wildcards, there are no '[...]' character ranges and '*' and '?' can not be escaped to include them literally in a pattern. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The GLib g_lstat() function provides a portable impl for Win32. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
A wrapper that calls g_fsync on Win32/macOS and fdatasync elsewhere. g_fsync is a stronger flush than we need but it satisfies the caller's requirements & matches the approach gnulib takes. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The g_fsync() API provides the same Windows portability as GNULIB does for fsync(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
g_fsync isn't available until 2.63 so we need a compat wrapper temporarily. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Eliminate direct use of normal setenv/unsetenv calls in favour of GLib's wrapper. This eliminates two gnulib modules Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The gstdio.h header defines some low level wrappers for things like fsync, stat, lstat, etc. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
When using GNULIB with Winsock, libvirt will never see the normal HANDLE objects, instead GNULIB guarantees that libvirt gets a C runtime file descriptor. The GNULIB poll impl also expects to get C runtime file descriptors rather than HANDLE objects. Document this behaviour so that it is clear to applications providing event loop implementations if they need Windows portability. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Ideally we would test macOS 10.15 as the newest release, however, that is not available in Travis yet. We can at least test newer XCode versions though to get toolchain validation. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
We initially claimed to only support the most recent macOS release, which is currently 10.15. Our Travis CI, however, is validating 10.14.4 / XCode 10.3. For almost all of our other platforms, we support multiple releases to some degree. This change brings macOS in line with other long life distros, covering the most recent & most recent but one for a 2 year overlap. With this docs change our CI is now actually testing our minimum version. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
We have a strong check for GCC >= 4.8, but don't validate any version number for CLang historically. This defines the min CLang to be 3.4 which is what is available for RHEL-7. macOS uses a different versioning scheme for CLang, based off XCode versions. There is a mapping recorded at https://en.wikipedia.org/wiki/Xcode#Toolchain_versions Here we see upstream CLang 3.4 corresponds to XCode 5.1 XCode 5.1 is available for macOS 10.8.4 or later which trivially satisfies our platform support matrix requirements. All these versions match what QEMU declares for its min GCC and CLang checks. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Julio Faracco 提交于
The command `domifaddr` can use three different sources to grab IP address of a Virtual Machine: lease, agent and arp. This parameter does not have a completer function to return source options. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 02 1月, 2020 2 次提交
-
-
由 Daniel P. Berrangé 提交于
The Python3 package has started failing to install from HomeBrew with the following: Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink Frameworks/Python.framework/Headers Target /usr/local/Frameworks/Python.framework/Headers is a symlink belonging to python@2. You can unlink it: brew unlink python@2 To force the link and overwrite all conflicting files: brew link --overwrite python The result is that libvirt fails to find python3: checking for python3... no configure: error: 'python3' binary is required to build libvirt It is unclear what changed in Travis/HomeBrew to break our previously working setup, but running the suggested command fixes it well enough for libvirt's CI needs. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
Update to: commit 7d069378921bfa0d7c7198ea177aac0a2440016f Author: Pádraig Brady <P@draigBrady.com> CommitDate: 2020-01-01 22:00:28 +0000 md5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compat Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 25 12月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
While command line arguments are sort of positional (because you have to have two entries, one for "-arg" the other for "value"), it doesn't really matter whether env variables come before or after command line arguments. And it matters even less when playing with qemu capabilities. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 24 12月, 2019 8 次提交
-
-
由 Nikolay Shirokovskiy 提交于
If we use fake reboot then domain goes thru running->shutdown->running state changes with shutdown state only for short period of time. At least this is implementation details leaking into API. And also there is one real case when this is not convinient. I'm doing a backup with the help of temporary block snapshot (with the help of qemu's API which is used in the newly created libvirt's backup API). If guest is shutdowned I want to continue to backup so I don't kill the process and domain is in shutdown state. Later when backup is finished I want to destroy qemu process. So I check if it is in shutdowned state and destroy it if it is. Now if instead of shutdown domain got fake reboot then I can destroy process in the middle of fake reboot process. After shutdown event we also get stop event and now as domain state is running it will be transitioned to paused state and back to running later. Though this is not critical for the described case I guess it is better not to leak these details to user too. So let's leave domain in running state on stop event if fake reboot is in process. Reconnection code handles this patch without modification. It detects that qemu is not running due to shutdown and then calls qemuProcessShutdownOrReboot which reboots as fake reboot flag is set. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Yi Li 提交于
Use errno parameter in virReportSystemError. Remove hold function return values if don't need. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NYi Li <yili@winhong.com>
-
由 Yi Li 提交于
Fix the return value status comparison checking for call to volStorageBackendRBDRefreshVolInfo introduced by commit id f46d137e. we only should fail when the return is < 0. -ENOENT, -ETIMEDOUT will ignore according commit id f46d137e. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NYi Li <yili@winhong.com>
-
由 Yi Li 提交于
most libvirt code uses 'int rc' to hold intermediate function return values. consistent with the rest of libvirt. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NYi Li <yili@winhong.com>
-
由 Daniel P. Berrangé 提交于
We don't need this for any functional purpose, but when debugging hosts it is useful to know what binary a given capabilities XML document is associated with. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Simplify repeated code patterns by providing a new constructor taking the QEMU binary name. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Currently if the binary path is NULL in the qemu capabilities object, cache invalidation is skipped. A future patch will ensure that the binary path is always non-NULL, so a way to explicitly skip invalidation is required. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
This avoids leaving a zero length or partially generated output file on errors. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 23 12月, 2019 2 次提交
-
-
由 Andrew Miloradovsky 提交于
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NAndrew Miloradovsky <andrew@interpretmath.pw>
-
由 Yi Li 提交于
Causing a crash when storagePoolLookupByTargetPath beacuse of Some types of storage pool have no target elements. Use STREQ_NULLABLE instead of STREQ Avoids segfaults when using NULL arguments. Core was generated by `/usr/sbin/libvirtd'. Program terminated with signal 11, Segmentation fault. (gdb) bt 0 0x0000ffff9e951388 in strcmp () from /lib64/libc.so.6 1 0x0000ffff92103e9c in storagePoolLookupByTargetPathCallback ( obj=0xffff7009aab0, opaque=0xffff801058b0) at storage/storage_driver.c:1649 2 0x0000ffff9f2c52a4 in virStoragePoolObjListSearchCb ( payload=0xffff801058b0, name=<optimized out>, opaque=<optimized out>) at conf/virstorageobj.c:476 3 0x0000ffff9f1f2f7c in virHashSearch (ctable=0xffff800f4f60, iter=iter@entry=0xffff9f2c5278 <virStoragePoolObjListSearchCb>, data=data@entry=0xffff95af7488, name=name@entry=0x0) at util/virhash.c:696 4 0x0000ffff9f2c64f0 in virStoragePoolObjListSearch (pools=0xffff800f2ce0, searcher=searcher@entry=0xffff92103e68 <storagePoolLookupByTargetPathCallback>, opaque=<optimized out>) at conf/virstorageobj.c:505 5 0x0000ffff92101f54 in storagePoolLookupByTargetPath (conn=0xffff5c0009f0, path=0xffff7009a850 "/vms/images") at storage/storage_driver.c:1672 Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NYi Li <yili@winhong.com>
-
- 21 12月, 2019 5 次提交
-
-
由 Daniel Henrique Barboza 提交于
The 'cleanup' flag is doing no cleaup in this function. We can remove it and return NULL on error or qemuBuildCommandLine(). Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Daniel Henrique Barboza 提交于
The g_auto*() changes made by the previous patches made a lot of 'cleanup' labels obsolete. Let's remove them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Daniel Henrique Barboza 提交于
Change all feasible pointers to use g_autoptr(). Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Daniel Henrique Barboza 提交于
This will allow us to g_autoptr qemuDomainLogContext pointers in the following patch. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Daniel Henrique Barboza 提交于
Change all feasible strings and scalar pointers to use g_autofree. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-