- 03 1月, 2020 11 次提交
-
-
由 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>
-
- 24 12月, 2019 7 次提交
-
-
由 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>
-
- 23 12月, 2019 1 次提交
-
-
由 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 11 次提交
-
-
由 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>
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Mind that virfirewall.c was not touched and still contains no_memory labels. The reason those are left behind, at least for now, is because the conversion seems to be slightly more complicated than the rest, as some other places are relying on firewall->err being set to ENOMEM. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
由 Cole Robinson 提交于
The phyp driver was added in 2009 and does not appear to have had any real feature change since 2011. There's virtually no evidence online of users actually using it. IMO it's time to kill it. This was discussed a bit in April 2016: https://www.redhat.com/archives/libvir-list/2016-April/msg01060.html Final discussion is here: https://www.redhat.com/archives/libvir-list/2019-December/msg01162.htmlReviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 20 12月, 2019 10 次提交
-
-
由 Pino Toscano 提交于
This way they are correctly represented: <source> <format type='vmfs'/> </source> ... instead of 'auto'. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Pino Toscano 提交于
It will be used to represent the type of a filesystem pool in ESXi. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Pino Toscano 提交于
Move the creation of a virNetworkPtr object from the esxVI_HostVirtualSwitch object of a virtual switch out of esxNetworkLookupByName in an own helper. This way it can be used also in other functions. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Pino Toscano 提交于
Move the creation of a virStoragePtr object from the esxVI_HostInternetScsiHbaStaticTarget object of a target out of esxStoragePoolLookupByName in an own helper. This way it can be used also in other functions. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Pino Toscano 提交于
Move the detection of the type of a vmfs pool out of esxLookupVMFSStoragePoolType in an own helper. This way it can be used also in other functions. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Pino Toscano 提交于
Move the creation of a virStoragePtr object from the esxVI_ObjectContent object of a datastore out of esxStoragePoolLookupByName in an own helper. This way it can be used also in other functions. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Fabiano Fidêncio 提交于
virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Fabiano Fidêncio 提交于
Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Fabiano Fidêncio 提交于
virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Fabiano Fidêncio 提交于
virGetUserRuntimeDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-