- 26 8月, 2019 20 次提交
-
-
由 Jonathon Jongsma 提交于
This function fetches the list of logged-in users from the qemu agent and adds them to a list of typed parameters so that they can be used internally in libvirt. Also add some basic tests for the function. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Jonathon Jongsma 提交于
Add daemon and client code to serialize/deserialize virDomainGetGuestInfo(). Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Jonathon Jongsma 提交于
This API is intended to aggregate several guest agent information queries and is ispired by stats API virDomainListGetStats(). It is anticipated that this information will be provided by a guest agent running within the domain. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Peter Krempa 提交于
Move the internals into qemuDomainSnapshotDiskDataCollectOne to make it obvious what's happening after moving more code here. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Soon we'll allow more protocols and storage types with snapshots where we in some cases can't check whether the storage already exists. Restrict the sanity checks whether the destination images exist or not for local storage where it's easy. For any other case we will fail later. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Refactor the code to avoid having a cleanup label. This will simplify the change necessary when restricting this check in an upcoming patch. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
dd->src is always allocated in this function as it contains the new source for the snapshot which is meant to replace the disk source. The label handling code executed if that source was not present thus is dead code. Remove it. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
While the VM is running the persistent source of a disk might differ e.g. as the 'newDef' was redefined. Our snapshot code would blindly rewrite the source of such disk if it shared the 'target'. Fix this by checking whether the source is the same in the first place. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Using inline authentication for storage volumes will not work properly as libvirt requires use of the secret driver for the auth data and thus would not be able to represent the passwords stored in the backing store string. Make sure that the backing store parsers return 1 which is a sign for the caller to not use the file in certain cases. The test data include iscsi via a json pseudo-protocol string and URIs with the userinfo part being present. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
virStorageFileGetMetadataRecurse would include files in the backing chain which would not really be usable by libvirt directly e.g. when such file would be promoted to the top layer by an active block commit as for example inline authentication data can't be represented in the VM xml file. The idea is to use secrets for this. With the changes to the backing store string parsers we can report and propagate if such a thing is present in the configuration and thus start skipping those files in the backing chain traversal code. This approach still allows to report the appropriate backing store string in the storage driver which doesn't directly use the backing file. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
virStorageFileGetMetadata does not report error if we can't interrogate the file somehow. Clarify this in the description of the @report_broken flag as it implies we should report an error in that case. The problem is that we don't know whether there's a problem and unfortunately just offload it to qemu. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Introduce new semantics to virStorageSourceNewFromBacking and some of the helpers used by it which propagate the return value from the callers. The new return value introduced by this patch allows to notify the calller that the parsed virStorageSource correctly describes the source but contains data such as inline authentication which libvirt does not want to support directly. This means that such file would e.g. unusable as a storage source (e.g. when actively commiting the overlay to it) or would not work with blockdev. The caller will then be able to decide whether to consider this backing file as viable or just fall back to qemu dealing with it. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Return the parsed storage source via an pointer in arguments and return an integer from the function. Describe the semantics with a comment for the function and adjust callers to the new semantics. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
virStorageSourceParseBackingURI will report special return values in some cases. Preserve it in virStorageSourceParseBackingJSONUriStr. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Return the storage source definition via a pointer in the arguments and document the returned values. This will simplify the possibility to ignore certain backing store types which are not representable by libvirt. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Automatically free the 'root' temporary variable to get rid of some complexity. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Automatically clean the 'uri' variable and get rid of the 'cleanup' label. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
There is no cleanup code. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Automatically free the intermediate JSON data to get rid of the cleanup section. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Peter Krempa 提交于
Commit fb64e176 forgot to delete the check that short-circuits the disk alias creation if the alias is already present. The side effect of this is that the creation qomName which is necessary to be able to refer to disk frontends when -blockdev is used was skipped when user aliases are used. Fix it by deleting the check. Also prevent any potential memory leaks from calling this function repeatedly by creating the qomName only when it's not present. https://bugzilla.redhat.com/show_bug.cgi?id=1741838Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 23 8月, 2019 12 次提交
-
-
由 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>
-
由 Roman Bolshakov 提交于
>From ld(1): By default all references resolved to a dynamic library record the library to which they were resolved. At runtime, dyld uses that information to directly resolve symbols. The alternative is to use the -flat_namespace option. With flat namespace, the library is not recorded. At runtime, dyld will search each dynamic library in load order when resolving symbols. This is slower, but more like how other operating systems resolve symbols. That fixes the set of tests that preload a mock library to replace library symbols: qemublocktest qemumonitorjsontest viriscsitest virmacmaptest virnetserverclienttest Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
-
由 Michal Privoznik 提交于
After my previous patches we have virPCIDeviceBindToStub() and virPCIDeviceUnbindFromStub() which really do nothing but call virPCIDeviceBindToStubWithOverride() and virPCIDeviceUnbindFromStubWithOverride() respectively. Drop "WithOverride" from the names and drop the thin wrappers. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
As stated in 84f9358b all kernels that we are interested in have 'drivers_override'. Drop the other, older style of overriding PCI device driver - newid. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
This function is no longer used after previous commit. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Now that no one uses KVM style of PCI assignment we can safely remove 'pci-stub' backend. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
The KVM assignment is going to be removed shortly. Don't let the hostdev module configure it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
After previous commits, the function is not used anymore. Remove it. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
There are two places where we need to create virPCIDevice from given virDomainHostdevDef. In both places the code is duplicated. Move them into a single function and call it from those two places. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
KVM style of PCI devices assignment was dropped in kernel in favor of vfio pci (see kernel commit v4.12-rc1~68^2~65). Since vfio is around for quite some time now and is far superior discourage people in using KVM style. Ideally, I'd make QEMU_CAPS_VFIO_PCI implicitly assumed but turns out qemu-3.0.0 doesn't support vfio-pci device for RISC-V. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Tested-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1711789 Starting up or building some types of pools may take a very long time (e.g. a misconfigured NFS). Holding the pool object locked throughout the whole time hurts concurrency, e.g. if there's another thread that is listing all the pools. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@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 8 次提交
-
-
由 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 提交于
This flag can be used to denote that the definition we're trying to assign to a pool object is live definition and thus the inactive definition should be saved into ->newDef. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Michal Privoznik 提交于
Separate storage pool definition assignment into a function. 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 提交于
Turns out there's one callback that might remove a storage pool during its run: storagePoolUpdateAllState() call storagePoolUpdateStateCallback() which may call virStoragePoolUpdateInactive() which in turn may call virStoragePoolObjRemove(). Problem is that the UpdateStateCallback() sees a storage pool object with just two references: one for each hash table holding the object. If the function ends up calling ObjRemove() then upon removing the object from hash tables those references are gone and thus any subsequent call touching the object is invalid. The solution to this problem is to grab reference for the object we are running iterator with. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-