- 14 3月, 2020 1 次提交
-
-
由 Ján Tomko 提交于
Remove lots of stack-allocated buffers. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 05 3月, 2020 1 次提交
-
-
由 Daniel P. Berrangé 提交于
Historically threads are given a name based on the C function, and this name is just used inside libvirt. With OS level thread naming this name is now visible to debuggers, but also has to fit in 15 characters on Linux, so function names are too long in some cases. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 25 2月, 2020 1 次提交
-
-
由 Ján Tomko 提交于
Include virutil.h in all files that use it, instead of relying on it being pulled in somehow. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 27 1月, 2020 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The intent here is to allow the virt drivers to be run directly embedded in an arbitrary process without interfering with libvirtd. To achieve this they need to store all their configuration & state in a separate directory tree from the main system or session libvirtd instances. This can be useful for doing testing of the virt drivers in "make check" without interfering with the user's own libvirtd instances. It can also be used for applications using KVM/QEMU as a piece of infrastructure to build an service, rather than for general purpose OS hosting. A long standing example is libguestfs, which would prefer if its temporary VMs did show up in the main libvirtd VM list, because this confuses apps such as OpenStack Nova. A more recent example would be Kata which is using KVM as a technology to build containers. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 1月, 2020 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 03 1月, 2020 1 次提交
-
-
由 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>
-
- 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>
-
- 20 12月, 2019 2 次提交
-
-
由 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 提交于
virGetUserConfigDirectory() *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>
-
- 26 11月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
There are two daemons that wait for acquiring their pid files: virtnetworkd and virtstoraged. This is undesirable as the idea is to quit early if unable to acquire the pid file. Fixes: v5.6.0-rc1~207. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 15 11月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
With g_mkstemp_full, there is no need to distinguish between mkostemp and mkostemps (no suffix vs. a suffix of a fixed length), because the GLib function looks for the XXXXXX pattern everywhere in the string. Use S_IRUSR | S_IWUSR for the permissions and do not pass O_RDWR in flags since it's implied. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 13 11月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 11月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 21 10月, 2019 2 次提交
-
-
由 Ján Tomko 提交于
Replace all occurrences of if (VIR_STRDUP(a, b) < 0) /* effectively dead code */ with: a = g_strdup(b); Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Replace all the occurrences of ignore_value(VIR_STRDUP(a, b)); with a = g_strdup(b); Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 10月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Provide some consistency over error message variable name and usage when saving error messages across possible other errors or possibility of resetting of the last error. Instead of virSaveLastError paired up with virSetError and virFreeError, we should use the newer virErrorPreserveLast and virRestoreError. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 16 10月, 2019 3 次提交
-
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOPTR aliases to g_autoptr. Replace all of its use by the GLib macro version. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOFREE is just an alias for g_autofree. Use the GLib macros directly instead of our custom aliases. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 10月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Use G_GNUC_UNUSED from GLib instead of ATTRIBUTE_UNUSED. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 08 10月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1755303 With the recent work in daemon split and socket activation daemons can come and go. They can and will be started many times during a session which results in objects being autostarted multiple times. This is not optimal. Use virDriverShouldAutostart() to determine if autostart should be done or not. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 27 9月, 2019 1 次提交
-
-
由 Daniel Henrique Barboza 提交于
Reviewed-by: NCole Robinson <crobinso@redhat.com> Suggested-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 27 8月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
All code using LOCALSTATEDIR "/run" is updated to use RUNSTATEDIR instead. The exception is the remote driver client which still uses LOCALSTATEDIR "/run". The client needs to connect to remote machines which may not be using /run, so /var/run is more portable due to the /var/run -> /run symlink. Some duplicate paths in the apparmor code are also purged. There's no functional change by default yet since both expressions expand to the same value. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 23 8月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
In my recent patches I've introduced virStoragePoolObjIsStarting() which is then used to protect storage pool definition when the pool object is locked and unlocked during long running jobs. Well, my patches did not anticipate that @obj can be NULL under 'cleanup' label in storagePoolCreateXML() (for instance when parsing XML fails). This imperfection is causing libvirtd to crash then. Fixes: 13284a6b storage_driver: Protect pool def during startup and build Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Michal Privoznik 提交于
In near future the storage pool object lock will be released during startPool and buildPool callback (in some backends). But this means that another thread may acquire the pool object lock and change its definition rendering the former thread access not only stale definition but also access freed memory (virStoragePoolObjAssignDef() will free old def when setting a new one). One way out of this would be to have the pool appear as active because our code deals with obj->def and obj->newdef just fine. But we can't declare a pool as active if it's not started or still building up. Therefore, have a boolean flag that is very similar and forces virStoragePoolObjAssignDef() to store new definition in obj->newdef even for an inactive pool. In turn, we have to move the definition to correct place when unsetting the flag. But that's as easy as calling virStoragePoolUpdateInactive(). Technically speaking, change made to storageDriverAutostartCallback() is not needed because until storage driver is initialized no storage API can run therefore there can't be anyone wanting to change the pool's definition. But I'm doing the change there for consistency anyways. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 22 8月, 2019 6 次提交
-
-
由 Michal Privoznik 提交于
If there's a persistent storage and user tries to start a new one with the same name and UUID (e.g. to test new configuration) it may happen that upon failure we lose the persistent defintion. Fortunately, we don't remove it from the disk only from the internal list of the pools. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
There will be more boolean information that we want to pass to this function. Instead of having them in separate arguments per each one, use @flags. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
This function is doing much more than plain assigning pool definition to a pool object. Rename it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
There is no need for this function to call virStoragePoolObjEndAPI(). The object is perfectly usable after return from this function. In fact, all callers will call virStoragePoolObjEndAPI() eventually. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
The function comment mistakenly refers to 'poolptr' when in fact the variable is named 'objptr'. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
The fact that we're removing a pool object from the list of pools doesn't mean we want to unlock it. It violates locking policy too as object locking and unlocking is not done on the same level. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 09 8月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
When running in libvirtd, we are happy for any of the drivers to simply skip their initialization in virStateInitialize, as other drivers are still potentially useful. When running in per-driver daemons though, we want the daemon to abort startup if the driver cannot initialize itself, as the daemon will be useless without it. Reviewed-by: NAndrea Bolognani <abologna@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 11 7月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
When we allow multiple instances of the driver for the same user account, using a separate root directory, we need to ensure mutual exclusion. Use a pidfile to guarantee this. In privileged libvirtd this ends up locking /var/run/libvirt/storage/driver.pid In unprivileged libvirtd this ends up locking /run/user/$UID/libvirt/storage/run/driver.pid NB, the latter can vary depending on $XDG_RUNTIME_DIR Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 18 3月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
In d16f803d we've tried to solve an issue that after wiping an image its format might have changed (e.g. from qcow2 to raw) but libvirt wasn't probing the image format. We fixed this by calling virStorageBackendRefreshVolTargetUpdate() which is what refreshPool() would end up calling. But this shortcut is not good enough because the function is called only for local types of volumes (like dir, fs, netfs). But now that more backends support volume wiping we have to call the function with more caution. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
- 16 3月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
If pool refresh failed, then the internal table of volumes is probably left in inconsistent or incomplete state anyways. Clear it out then. This has an advantage that we can move the virStoragePoolObjClearVols() from those very few backends that do call it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Michal Privoznik 提交于
This is a wrapper over refreshPool() call as at all places we are doing basically the same. Might as well have a single function to call. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
- 07 3月, 2019 2 次提交
-
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1581670 Create the storage driver code to generate the output for the storage pool capabilities XML. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 John Ferlan 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1581670 During storage driver backend initialization, let's save which backends are available in the storage pool capabilities. In order to format those, we need add a connectGetCapabilities processor to the storageHypervisorDriver. This allows a storage connection, such as "storage:///system" to find the API and format the results, such as: virsh -c storage:///system capabilities <capabilities> <pool> <enum name='type'> <value>dir</value> <value>fs</value> <value>netfs</value> <value>logical</value> <value>iscsi</value> <value>iscsi-direct</value> <value>scsi</value> <value>mpath</value> <value>disk</value> <value>rbd</value> <value>sheepdog</value> <value>gluster</value> <value>zfs</value> </enum> </pool> </capabilities> Signed-off-by: NJohn Ferlan <jferlan@redhat.com> ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 3月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1685151 This reverts commit cefb97fb. The stateAutoStart callback will be removed in the next commit. Therefore move autostarting of domains, networks and storage pools back into stateInitialize callbacks. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 12 2月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Let's make use of the auto __cleanup capabilities cleaning up any now unnecessary goto paths. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-