- 22 3月, 2018 8 次提交
-
-
由 Michal Privoznik 提交于
The flags passed to virCommandPassFD() are unnamed and documentation to this function doesn't list them either. Give them name and mention it in documentation to functions using them. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NLaine Stump <laine@laine.org>
-
由 Jim Fehlig 提交于
Long ago in commit dfa1e1dd the scheduler weight was accidentally hardcoded to 1000. Weight is a setting with no unit since it is relative to the weight of other domains. If no weight is specified, libxl defaults to 256. Instead of hardcoding the weight to 1000, honor any <shares> specified in <cputune>. libvirt's notion of shares is synonomous to libxl's scheduler weight setting. If shares is unspecified, defer default weight setting to libxl. Removing the hardcoded weight required some test fixup. While at it, add an explicit test for <shares> conversion to scheduler weight. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
Inspired by commit ffb7954f to improve readability of the libxl migration APIs. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jim Fehlig 提交于
Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
In libxlDomainMigrationPrepare it is possible to dereference a NULL libxlDomainObjPrivatePtr in early error paths. Check for a valid 'priv' before using it. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
Similar to other uses of virDomainObjListAdd, on success add a ref to the virDomainObj so that virDomainObjEndAPI can be called as usual. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
If starting the domain fails in libxlDomainCreateXML, we mistakenly jumped to cleanup without calling libxlDomainObjEndJob. Remove the jump to 'cleanup'. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
Most libxl driver API use the pattern of lock and add a ref to virDomainObj, perform API, then decrement ref and unlock in virDomainEndAPI. In some cases the API may call virDomainObjListRemove, which unlocks the virDomainObj. Relock the object in such cases so EndAPI is called with a locked object. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 21 3月, 2018 1 次提交
-
-
由 Han Han 提交于
Fix comments for virConnectListAllNodeDevices and virConnectListAllSecrets. Signed-off-by: NHan Han <hhan@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 20 3月, 2018 10 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1556828 When defining a domain that has <interface type='hostdev'/> our parser creates two entries in virDomainDef: one for <interface/> and one for <hostdev/>. However, some info is shared between the two which makes user alias validation fail because alias belongs to the set of shared info. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Cole Robinson 提交于
Yet another dependency on dict() hash ordering Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Radostin Stoyanov 提交于
Lists in Python are mutable and when used as a default value of a parameter for class constructor, its value will be shared between all class instances. Example: class Test: def __init__(self, mylist=[]): self.mylist = mylist A = Test() B = Test() A.mylist.append("mylist from instance A") print(B.mylist) # Will print ['mylist from instance A'] Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
PEP8 recommends not having spaces around = in a keyword argument or a default parameter value. https://www.python.org/dev/peps/pep-0008/#other-recommendationsReviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
Generate whitespace using the standard function ljust() that is available in both Py3 [1] and Py2 [2]. 1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust 2: https://docs.python.org/2.7/library/string.html#string.ljustReviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
Reduce the number of if-statements and use a single return. Utilise a dictionary to map between occurrences and values. Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
The function generate_helper_header() only returns a formatted string. This could be achieved without performing string concatenation. Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
The generate_helper_source() function returns a formatted string. This could be achieved without the use of a local variable "source" and string concatenation. Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Radostin Stoyanov 提交于
PEP8 recommends removing whitespace immediately before a comma, semicolon, or colon [1]. In addition remove multiple spaces after keyword (PEP8 - E271). 1: https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statementsReviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NRadostin Stoyanov <rstoyanov1@gmail.com>
-
由 Jiri Denemark 提交于
<memballoon model='none'/> is the only way to disable balloon driver since libvirt will add one automatically if the memballoon element is missing. In other words, there's no balloon device if model is 'none' and generating an alias for it makes no sense. The alias will be ignored when parsing the XML and it will disappear once libvirtd is restarted. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 19 3月, 2018 5 次提交
-
-
由 Christian Ehrhardt 提交于
In a recent change b932ed69: "virt-aa-helper: resolve yet to be created paths" several cases with symlinks in paths were fixed, but it regressed cases where the file being last element of the path was the actual link. In the case of the last element being the symlink realpath can (and shall) be called on the full path that was passed. Examples would be zfs/lvm block devices like: <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/mapper/testlvm-testvol1'/> <target dev='vdd' bus='virtio'/> </disk> With the target being: /dev/mapper/testlvm-testvol1 -> ../dm-0 That currently is rendered as "/dev/mapper/testlvm-testvol1" rwk, but instead should be (and is with the fix): "/dev/dm-0" rwk, Fixes: b932ed69: "virt-aa-helper: resolve yet to be created paths" Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1756394Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
由 Andrea Bolognani 提交于
Some of our scripts are known to work both with Python 2 and Python 3, so for them we shouldn't be forcing any specific version of the interpreter when they're called directly; we always use $(PYTHON) explicitly in our build rules anyway. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Erik Skultety 提交于
Commit b4c2ac8d made a false assumption that IOMMU support necessary for an mdev device to be assigned to a VM. Unlike direct PCI assignment, IOMMU support is not needed for mediated devices, as the physical parent device provides the isolation, therefore, simply checking for VFIO presence is enough to successfully start a VM. Luckily, this issue is not serious, since as of yet, libvirt mandates mdevs to be pre-created prior to a domain's launch - if it is, everything does work smoothly even with IOMMU disabled, because the parent device will ensure the iommu groups we try to access exist. However, if there are *no* IOMMU groups yet, thus no mdev exists yet, one would see the following error: "unsupported configuration: Mediated host device assignment requires VFIO support" The error msg above is simply wrong and doesn't even reflect the IOMMU reality, so after applying this patch one would rather see the following error in such case instead: "device not found: mediated device '<UUID>' not found" Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Erik Skultety 提交于
What one currently gets is: failed to read '/sys/bus/mdev/devices/<UUID>/mdev_type/device_api': No such file or directory This indicates that something is missing within the device's sysfs tree which likely might be not be the case here because the device simply doesn't exist yet. So, when creating our internal mdev obj, let's check whether the device exists first prior to trying to verify the user-provided model within domain XML. Signed-off-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
==16451== 32,768 bytes in 2 blocks are definitely lost in loss record 1,007 of 1,013 ==16451== at 0x4C2AF0F: malloc (vg_replace_malloc.c:299) ==16451== by 0x7CADB40: nl_recv (in /usr/lib64/libnl-3.so.200.23.0) ==16451== by 0x532DFAC: virNetlinkDumpCommand (virnetlink.c:363) ==16451== by 0x53236AE: virNetDevIPCheckIPv6Forwarding (virnetdevip.c:641) ==16451== by 0xE3E4A1A: networkStartNetworkVirtual (bridge_driver.c:2490) ==16451== by 0xE3E55F5: networkStartNetwork (bridge_driver.c:2832) ==16451== by 0xE3DFFE5: networkAutostartConfig (bridge_driver.c:531) ==16451== by 0x53F47E0: virNetworkObjListForEachHelper (virnetworkobj.c:1412) ==16451== by 0x52FE69F: virHashForEach (virhash.c:606) ==16451== by 0x53F4857: virNetworkObjListForEach (virnetworkobj.c:1439) ==16451== by 0xE3E0BF4: networkStateAutoStart (bridge_driver.c:808) ==16451== by 0x55689CE: virStateInitialize (libvirt.c:758) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 18 3月, 2018 1 次提交
-
-
由 Chen Hanxiao 提交于
fix a mem leak Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 17 3月, 2018 7 次提交
-
-
由 Chen Hanxiao 提交于
fix some leaks and format issue Also support virArpTableFree to get NULL. Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
-
由 Jim Fehlig 提交于
libxlDomainMigrationPrepare adds the incoming domain def to the list of domains via virDomainObjListAdd, but never adds its own ref to the returned virDomainObj as other callers of virDomainObjListAdd do. libxlDomainMigrationPrepareTunnel3 suffers the same discrepancy. Change both to add a ref to the virDomainObj after a successful virDomainObjListAdd, similar to other callers. This ensures a consistent pattern throughout the drivers and allows using the virDomainObjEndAPI function for cleanup. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
For libxlDomainLookupByID and libxlDomainLookupByUUID let's return a locked and referenced @vm object so that callers can then use the common and more consistent virDomainObjEndAPI in order to handle cleanup rather than needing to know that the returned object is locked and calling virObjectUnlock. The LookupByName already returns the ref counted and locked object, so this will make things more consistent. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
由 John Ferlan 提交于
Commit id '9ac94507' altered libxlDomObjFromDomain to return a locked *and* ref counted object for some specific purposes; however, it neglected to alter all the consumers of the helper to use virDomainObjEndAPI thus leaving many objects with extra ref counts. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NJim Fehlig <jfehlig@suse.com>
-
由 Jim Fehlig 提交于
libxlDomObjFromDomain to returns locked and ref counted virDomainObj but libxlDomainMigratePerform3Params only unlocks the object on exit. Convert it to use the virDomainObjEndAPI function for cleanup. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
The libxlDomainMigrateConfirm3Params API locks and ref counts the associated virDomainObj but relies on the helper function libxlDomainMigrationConfirm to unlock the object. Unref'ing the object is not done in either function. libxlDomainMigrationConfirm is also used by libxlDomainMigratePerform3Params for p2p migration, but in that case the lock/ref and unref/unlock are properly handled in the API entry point. Remove the unlock from libxlDomainMigrationConfirm and adjust libxlDomainMigrateConfirm3Params to properly unref/unlock the virDomainObj on success and error paths. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Jim Fehlig 提交于
The libxlDomainMigrateBegin3Params API locks and ref counts the associated virDomainObj but relies on the helper function libxlDomainMigrationBegin to unref/unlock the object. libxlDomainMigrationBegin is also used by libxlDomainMigratePerform3Params for p2p migration, but in that case the lock/ref and unref/unlock are properly handled in the API entry point. So p2p migrations suffer a double unref/unlock in the Perform API. Remove the unref/unlock (virDomainObjEndAPI) from libxlDomainMigrationBegin and adjust libxlDomainMigrateBegin3Params to properly unref/unlock the virDomainObj on success and error paths. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 16 3月, 2018 8 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1552127 When building command line for USB controllers we have to do more than just put controller's alias onto the command line. QEMU has concept of these joined USB controllers. For instance ehci and uhci controllers need to create the same USB bus. To achieve that the slave controller needs to refer the master controller. This worked until we've introduced user aliases because both master and slave had the same alias. With user aliases slave can have different alias than master. Therefore, when generating command line for slave we need to look up the master's alias. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Farhan Ali 提交于
commit 7210cef4 'qemu: build command line for virtio input devices' introduced an error, by checking if input bus type is VIR_DOMAIN_DISK_BUS_VIRTIO. Fix it by using the correct bus type for input devices. Signed-off-by: NFarhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Farhan Ali 提交于
Commit id '177db487' renamed 'qemuValidateDevicePCISlotsChipsets' to 'qemuDomainValidateDevicePCISlotsChipsets', but didn't adjust comment. Signed-off-by: NFarhan Ali <alifm@linux.vnet.ibm.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
This function is exported and therefore we have to have implementation for all platforms. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
We have to use VIR_WARNINGS_NO_CAST_ALIGN to avoid clang warning about increased required alignment caused by some netlink macros. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Marc Hartmayer 提交于
Set the eventID for remoteRelayDomainQemuMonitorEvent explicitly to an invalid value. Although the value is not used by remoteRelayDomainQemuMonitorEvent, but it might be less prone to errors for further refactorings. 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> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Marc Hartmayer 提交于
Use stream->prog instead of a hard-coded "remoteProgram" since at stream creation in daemonCreateClientStream "remoteProgram" is used so we should use that especially since these functions are intended as generic helpers for streams. 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> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Marc Hartmayer 提交于
Remove unneeded global variables and convert them into local variables where they're needed. 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> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-