- 15 6月, 2012 15 次提交
-
-
由 Daniel P. Berrange 提交于
Instead of doing # example_config use #example_config so it is possible to programatically uncomment example config options, as distinct from their comment/descriptions Also delete rogue trailing comma not allowed by lens Signed-off-by: NDaniel P. Berrange <berrange@redhat.com> (cherry picked from commit c5c3278e) (crobinso: Fix spacing to appease tests/daemon-conf, which is still in -maint branch)
-
If vdsm is installed and configured in Fedora 17, we add the following items into qemu.conf: spice_tls=1 spice_tls_x509_cert_dir="/etc/pki/vdsm/libvirt-spice" However, after this changes, augtool cannot identify qemu.conf anymore. (cherry picked from commit cdd762e4)
-
由 Peter Krempa 提交于
The pciDevice structure corresponding to the device being hot-unplugged was freed after it was "stolen" from activeList. The pointer was still used for eg-inactive list. This patch removes the free of the structure and frees it only if reset fails on the device. (cherry picked from commit db19417f)
-
由 Daniel P. Berrange 提交于
When the last reference to a virConnectPtr is released by libvirtd, it was possible for a deadlock to occur in the virDomainEventState functions. The virDomainEventStatePtr holds a reference on virConnectPtr for each registered callback. When removing a callback, the virUnrefConnect function is run. If this causes the last reference on the virConnectPtr to be released, then virReleaseConnect can be run, which in turns calls qemudClose. This function has a call to virDomainEventStateDeregisterConn which is intended to remove all callbacks associated with the virConnectPtr instance. This will try to grab a lock on virDomainEventState but this lock is already held. Deadlock ensues Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)): Since each callback associated with a virConnectPtr holds a reference on virConnectPtr, it is impossible for the qemudClose method to be invoked while any callbacks are still registered. Thus the call to virDomainEventStateDeregisterConn must in fact be a no-op. Thus it is possible to just remove all trace of virDomainEventStateDeregisterConn and avoid the deadlock. * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c, src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove calls to virDomainEventStateDeregisterConn (cherry picked from commit 2cb0899e)
-
由 Michal Privoznik 提交于
If qemuPrepareHostdevUSBDevices fail it will roll back devices added to the driver list of used devices. However, if it may fail because the device is being used already. But then again - with roll back. Therefore don't try to remove a usb device manually if the function fail. Although, we want to remove the device if any operation performed afterwards fail. (cherry picked from commit 9c484e3d)
-
由 Michal Privoznik 提交于
One of our latest USB device handling patches 05abd150 introduced a regression. That is, we first create a temporary list of all USB devices that are to be used by domain just starting up. Then we iterate over and check if a device from the list is in the global list of currently assigned devices (activeUsbHostdevs). If not, we add it there and continue with next iteration then. But if a device from temporary list is either taken already or adding to the activeUsbHostdevs fails, we remove all devices in temp list from the activeUsbHostdevs list. Therefore, if a device is already taken we remove it from activeUsbHostdevs even if we should not. Thus, next time we allow the device to be assigned to another domain. (cherry picked from commit 2f5fdc88)
-
由 Daniel P. Berrange 提交于
Currently each USB2 companion controller gets put on a separate PCI slot. Not only is this wasteful of PCI slots, but it is not in compliance with the spec for USB2 controllers. The master echi1 and all companion controllers should be in the same slot, with echi1 in function 7, and uhci1-3 in functions 0-2 respectively. * src/qemu/qemu_command.c: Special case handling of USB2 controllers to apply correct pci slot assignment * tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args, tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand test to cover automatic slot assignment (cherry picked from commit 1ebd52cb) Conflicts: tests/qemuxml2xmltest.c
-
由 Osier Yang 提交于
On some of the NUMA platforms, the CPU index in each NUMA node grows non-consecutive. While on other platforms, it can be inconsecutive, E.g. % numactl --hardware available: 4 nodes (0-3) node 0 cpus: 0 4 8 12 16 20 24 28 node 0 size: 131058 MB node 0 free: 86531 MB node 1 cpus: 1 5 9 13 17 21 25 29 node 1 size: 131072 MB node 1 free: 127070 MB node 2 cpus: 2 6 10 14 18 22 26 30 node 2 size: 131072 MB node 2 free: 127758 MB node 3 cpus: 3 7 11 15 19 23 27 31 node 3 size: 131072 MB node 3 free: 127226 MB node distances: node 0 1 2 3 0: 10 20 20 20 1: 20 10 20 20 2: 20 20 10 20 3: 20 20 20 10 This patch is to fix the problem by using the CPU index in caps->host.numaCell[i]->cpus[i] to set the bitmask instead of assuming the CPU index of the NUMA nodes are always sequential. (cherry picked from commit d1bdeca8)
-
由 Li Zhang 提交于
For pseries guest, the default controller model is ibmvscsi controller, this controller only can work on spapr-vio address. This patch is to assign spapr-vio address type to ibmvscsi controller and correct vscsi test case. Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com> (cherry picked from commit bb725ac1)
-
由 Peter Krempa 提交于
This patch lifts the limit of calling thread detection code only on KVM guests. With upstream qemu the thread mappings are reported also on non-KVM machines. QEMU adopted the thread_id information from the kvm branch. To remain compatible with older upstream versions of qemu the check is attempted but the failure to detect threads (or even run the monitor command - on older versions without SMP support) is treated non-fatal and the code reports one vCPU with pid of the hypervisor (in same fashion this was done on non-KVM guests). (cherry picked from commit c8335269)
-
由 Peter Krempa 提交于
After a cpu hotplug the qemu driver did not refresh information about virtual processors used by qemu and their corresponding threads. This patch forces a re-detection as is done on start of QEMU. This ensures that correct information is reported by the virDomainGetVcpus API and "virsh vcpuinfo". A failure to obtain the thread<->vcpu mapping is treated non-fatal and the mapping is not updated in a case of failure as not all versions of QEMU report this in the info cpus command. (cherry picked from commit 3163682b)
-
由 Peter Krempa 提交于
This patch changes a switch statement into ifs when handling live vs. configuration modifications getting rid of redundant code in case when both live and persistent configuration gets changed. (cherry picked from commit e99ad93d)
-
由 Guannan Ren 提交于
when failing to attach another usb device to a domain for some reason which has one use device attached before, the libvirtd crashed. The crash is caused by null-pointer dereference error in invoking usbDeviceListSteal passed in NULL value usb variable. commit 05abd150 introduces the bug. (cherry picked from commit ab5fb8f3)
-
由 Eric Blake 提交于
Commit 97010eb1 forgot to change the other side of an #ifdef. * src/qemu/qemu_process.c (qemuProcessInitNumaMemoryPolicy): Add argument. (cherry picked from commit 5c650b98)
-
由 Eric Blake 提交于
It turns out that when cgroups are enabled, the use of a block device for a snapshot target was failing with EPERM due to libvirt failing to add the block device to the cgroup whitelist. See also https://bugzilla.redhat.com/show_bug.cgi?id=810200 * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateSingleDiskActive) (qemuDomainSnapshotUndoSingleDiskActive): Account for cgroup. (qemuDomainSnapshotCreateDiskActive): Update caller. (cherry picked from commit 8be304ec)
-
- 14 6月, 2012 7 次提交
-
-
由 Guannan Ren 提交于
src/qemu/qemu_hostdev.c: refactor qemuPrepareHostdevUSBDevices function, make it focus on adding usb device to activeUsbHostdevs after check. After that, the usb hotplug function qemuDomainAttachHostDevice also could use it. expand qemuPrepareHostUSBDevices to perform the usb search, rollback on failure. src/qemu/qemu_hotplug.c: If there are multiple usb devices available with same vendorID and productID, but with different value of "bus, device", we give an error to let user use <address> to specify the desired one. (cherry picked from commit 05abd150)
-
由 Guannan Ren 提交于
usbFindDevice():get usb device according to idVendor, idProduct, bus, device it is the exact match of the four parameters usbFindDeviceByBus():get usb device according to bus, device it returns only one usb device same as usbFindDevice usbFindDeviceByVendor():get usb device according to idVendor,idProduct it probably returns multiple usb devices. usbDeviceSearch(): a helper function to do the actual search (cherry picked from commit 9914477e)
-
由 Jiri Denemark 提交于
When we added the default USB controller into domain XML, we efficiently broke migration to older versions of libvirt that didn't support USB controllers at all (0.9.4 and earlier) even for domains that don't use anything that the older libvirt can't provide. We still want to present the default USB controller in any XML seen by a user/app but we can safely remove it from the domain XML used during migration. If we are migrating to a new enough libvirt, it will add the controller XML back, while older libvirt won't be confused with it although it will still tell qemu to create the controller. Similar approach can be used in the future whenever we find out we always enabled some kind of device without properly advertising it in domain XML. (cherry picked from commit 409b5f54)
-
由 Jiri Denemark 提交于
Always use appropriate qemuDomain{,Def}Format wrapper since it may do some additional magic based on the flags. (cherry picked from commit cd603008)
-
由 Eric Blake 提交于
Commit 4c82f09e added a capability check for qemu per-device io throttling, but only applied it to domain startup. As mentioned in the previous commit (98cec052), the user can still get an 'internal error' message during a hotplug attempt, when the monitor command doesn't exist. It is confusing to allow tuning on inactive domains only to then be rejected when starting the domain. * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Reject offline tuning if online can't match it. (cherry picked from commit 13f9a193)
-
由 Eric Blake 提交于
If you have a qemu build that lacks the blockio tune monitor command, then this command: $ virsh blkdeviotune rhel6u2 hda --total_bytes_sec 1000 error: Unable to change block I/O throttle error: internal error Unexpected error fails as expected (well, the error message is lousy), but the next dumpxml shows that the domain was modified anyway. Worse, that means if you save the domain then restore it, the restore will likely fail due to throttling being unsupported, even though no throttling should even be active because the monitor command failed in the first place. * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Check for error before making modification permanent. (cherry picked from commit 98cec052)
-
由 Stefan Berger 提交于
Error: RESOURCE_LEAK: /libvirt/src/qemu/qemu_driver.c:6968: alloc_fn: Calling allocation function "calloc". /libvirt/src/qemu/qemu_driver.c:6968: var_assign: Assigning: "nodeset" = storage returned from "calloc(1UL, 1UL)". /libvirt/src/qemu/qemu_driver.c:6977: noescape: Variable "nodeset" is not freed or pointed-to in function "virTypedParameterAssign". /libvirt/src/qemu/qemu_driver.c:6997: leaked_storage: Variable "nodeset" going out of scope leaks the storage it points to. (cherry picked from commit c0774482)
-
- 08 6月, 2012 6 次提交
-
-
由 Li Zhang 提交于
qemuDomainNetsRestart indents with 3 spaces. This patch is to correct it. Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com> (cherry picked from commit 0d631e91)
-
由 Josh Durgin 提交于
Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com> (cherry picked from commit b57e0153)
-
由 Josh Durgin 提交于
This works with newer qemu that doesn't allow escaping spaces. It's backwards compatible as well. Signed-off-by: NJosh Durgin <josh.durgin@dreamhost.com> (cherry picked from commit d50cae33)
-
由 Jiri Denemark 提交于
When libvirtd is started, we create "libvirt/qemu" directories under hugetlbfs mount point. Only the "qemu" subdirectory is chowned to qemu user and "libvirt" remains owned by root. If umask was too restrictive when libvirtd started, qemu user may lose access to "qemu" subdirectory. Let's explicitly grant search permissions to "libvirt" directory for all users. (cherry picked from commit 9d2ac545)
-
由 Michal Privoznik 提交于
Currently, qemu GA is not providing 'desc' field for errors like we are used to from qemu monitor. Therefore, we fall back to this general 'unknown error' string. However, GA is reporting 'class' which is not perfect, but much more helpful than generic error string. Thus we should fall back to class firstly and if even no class is presented, then we can fall back to that generic string. Before this patch: virsh # dompmsuspend --target mem f16 error: Domain f16 could not be suspended error: internal error unable to execute QEMU command 'guest-suspend-ram': unknown QEMU command error After this patch: virsh # dompmsuspend --target mem f16 error: Domain f16 could not be suspended error: internal error unable to execute QEMU command 'guest-suspend-ram': The command has not been found (cherry picked from commit 37803108)
-
由 Stefan Berger 提交于
More bug extermination in the category of: Error: CHECKED_RETURN: /libvirt/src/conf/network_conf.c:595: check_return: Calling function "virAsprintf" without checking return value (as is done elsewhere 515 out of 543 times). /libvirt/src/qemu/qemu_process.c:2780: unchecked_value: No check of the return value of "virAsprintf(&msg, "was paused (%s)", virDomainPausedReasonTypeToString(reason))". /libvirt/tests/commandtest.c:809: check_return: Calling function "setsid" without checking return value (as is done elsewhere 4 out of 5 times). /libvirt/tests/commandtest.c:830: unchecked_value: No check of the return value of "virTestGetDebug()". /libvirt/tests/commandtest.c:831: check_return: Calling function "virTestGetVerbose" without checking return value (as is done elsewhere 41 out of 42 times). /libvirt/tests/commandtest.c:833: check_return: Calling function "virInitialize" without checking return value (as is done elsewhere 18 out of 21 times). One note about the error in commandtest line 809: setsid() seems to fail when running the test -- could be removed ? (cherry picked from commit 59b935f5)
-
- 28 4月, 2012 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=816662 pointed out that attempting 'virsh blockpull' on an offline domain gave a misleading error message about qemu lacking support for the operation, even when qemu was specifically updated to support it. The real problem is that we have several capabilities that are only determined when starting a domain, and therefore are still clear when first working with an inactive domain (namely, any capability set by qemuMonitorJSONCheckCommands). While this patch was able to hoist an existing check in one of the three culprits, it had to add redundant checks in the other two places (because you always have to check for an active domain after obtaining a VM job lock, but the capability bits were being checked prior to obtaining the job lock). Someday it would be nice to patch libvirt to cache the set of capabilities per qemu binary (as determined by inode and timestamp), rather than re-probing the binary every time a domain is started, and to teach the cache how to query the monitor during the one time the probe is made rather than having to wait until a guest is started; then, a capability probe would succeed even for offline guests because it just refers to the cache, and the single check for an active domain after grabbing the job lock would be sufficient. But since that will involve a lot more coding, I'm happy to go with this simpler solution for an immediate solution. * src/qemu/qemu_driver.c (qemuDomainPMSuspendForDuration) (qemuDomainSnapshotCreateXML, qemuDomainBlockJobImpl): Check for offline state before checking an online-only cap. Conflicts: src/qemu/qemu_driver.c
-
- 27 4月, 2012 3 次提交
-
-
由 Jiri Denemark 提交于
Once qemu monitor reports migration has completed, we just closed our end of the pipe and let migration tunnel die. This generated bogus error in case we did so before the thread saw EOF on the pipe and migration was aborted even though it was in fact successful. With this patch we first wake up the tunnel thread and once it has read all data from the pipe and finished the stream we close the filedescriptor. A small additional bonus of this patch is that real errors reported inside qemuMigrationIOFunc are not overwritten by virStreamAbort any more.
-
由 Jiri Denemark 提交于
When QEMU reported failed or canceled migration, we correctly detected it but didn't really consider it as an error condition and migration protocol just went on. Luckily, some of the subsequent steps eventually failed end we reported an (unrelated and mostly random) error back to the caller.
-
由 Jiri Denemark 提交于
In some cases (spotted with broken connection during tunneled migration) we were overwriting the original error with worse or even misleading errors generated when we were cleaning up after failed migration.
-
- 26 4月, 2012 1 次提交
-
-
由 Jan Kiszka 提交于
If console[0] is an alias for serial[0], do not enforce the former to have a PTY source type. This breaks serial consoles on stdio and makes no sense. Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
-
- 16 4月, 2012 7 次提交
-
-
由 Osier Yang 提交于
Instead of returning a CPUs list, numad returns NUMA node list instead, this patch is to convert the node list to cpumap before affinity setting. Otherwise, the domain processes will be pinned only to CPU[$numa_cell_num], which will cause significiant performance losses. Also because numad will balance the affinity dynamically, reflecting the cpuset from numad back doesn't make much sense then, and it may just could produce confusion for the users. Thus the better way is not to reflect it back to XML. And in this case, it's better to ignore the cpuset when parsing XML. The codes to update the cpuset is removed in this patch incidentally, and there will be a follow up patch to ignore the manually specified "cpuset" if "placement" is "auto", and document will be updated too. (cherry picked from commit ccf80e36)
-
由 Michal Privoznik 提交于
If placement mode is AUTO, on some return paths char *cpumap or char *nodeset are leaked. (cherry picked from commit 354e6d4e)
-
由 D. Herrendoerfer 提交于
This patch adds a netlink callback when migrating a VEPA enabled virtual machine. It fixes a Bug where a VM would not request a port association when it was cleared by lldpad. This patch requires the latest git version of lldpad to work. Signed-off-by: ND. Herrendoerfer <d.herrendoerfer@herrendoerfer.name> (cherry picked from commit 997366ca)
-
由 Michal Privoznik 提交于
If dynamic_ownership is off and we are creating a file on NFS we force chown. This will fail as chown/chmod are not supported on NFS. However, with no dynamic_ownership we are not required to do any chown. (cherry picked from commit b1256816)
-
由 Peter Krempa 提交于
The new safe console handling introduced a possibility to deadlock the qemu driver when a new console connection forcibly disconnects a previous console stream that belongs to an already closed connection. The virStreamFree function calls subsequently a the virReleaseConnect function that tries to lock the driver while discarding the connection, but the driver was already locked in qemuDomainOpenConsole. Backtrace of the deadlocked thread: 0 0x00007f66e5aa7f14 in __lll_lock_wait () from /lib64/libpthread.so.0 1 0x00007f66e5aa3411 in _L_lock_500 () from /lib64/libpthread.so.0 2 0x00007f66e5aa322a in pthread_mutex_lock () from/lib64/libpthread.so.0 3 0x0000000000462bbd in qemudClose () 4 0x00007f66e6e178eb in virReleaseConnect () from/usr/lib64/libvirt.so.0 5 0x00007f66e6e19c8c in virUnrefStream () from /usr/lib64/libvirt.so.0 6 0x00007f66e6e3d1de in virStreamFree () from /usr/lib64/libvirt.so.0 7 0x00007f66e6e09a5d in virConsoleHashEntryFree () from/usr/lib64/libvirt.so.0 8 0x00007f66e6db7282 in virHashRemoveEntry () from/usr/lib64/libvirt.so.0 9 0x00007f66e6e09c4e in virConsoleOpen () from /usr/lib64/libvirt.so.0 10 0x00000000004526e9 in qemuDomainOpenConsole () 11 0x00007f66e6e421f1 in virDomainOpenConsole () from/usr/lib64/libvirt.so.0 12 0x00000000004361e4 in remoteDispatchDomainOpenConsoleHelper () 13 0x00007f66e6e80375 in virNetServerProgramDispatch () from/usr/lib64/libvirt.so.0 14 0x00007f66e6e7ae11 in virNetServerHandleJob () from/usr/lib64/libvirt.so.0 15 0x00007f66e6da897d in virThreadPoolWorker () from/usr/lib64/libvirt.so.0 16 0x00007f66e6da7ff6 in virThreadHelper () from/usr/lib64/libvirt.so.0 17 0x00007f66e5aa0c5c in start_thread () from /lib64/libpthread.so.0 18 0x00007f66e57e7fcd in clone () from /lib64/libc.so.6 * src/qemu/qemu_driver.c: qemuDomainOpenConsole() -- unlock the qemu driver right after acquiring the domain object (cherry picked from commit 3d3de46a)
-
由 Eric Blake 提交于
Leak introduced in commit 0436d328. If we allocate an actions array, but fail early enough to never consume it with the qemu monitor transaction call, we leaked memory. But our semantics of making the transaction command free the caller's memory is awkward; avoiding the memory leak requires making every intermediate function in the call chain check for error. It is much easier to fix things so that the function that allocates also frees, while the call chain leaves the caller's data intact. To do that, I had to hack our JSON data structure to make it easy to protect a portion of an arbitrary JSON tree from being freed. * src/util/json.h (virJSONType): Name the enum. (_virJSONValue): New field. * src/util/json.c (virJSONValueFree): Use it to protect a portion of an array. * src/qemu/qemu_monitor_json.c (qemuMonitorJSONTransaction): Avoid freeing caller's data. * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateDiskActive): Free actions array on failure. (cherry picked from commit 14135609)
-
由 Michal Privoznik 提交于
We can tell qemuDomainSnapshotFSThaw if we want it to report errors or not. However, if we don't want to and an error has been already set by previous qemuReportError() we must keep copy of that error not just a pointer to it. Otherwise, it get overwritten if FSThaw reports an error. (cherry picked from commit 650da0e9)
-