- 15 12月, 2015 6 次提交
-
-
由 Laine Stump 提交于
when appropriate, of course. If the config for a domain specifies boot order with <boot dev='blah'/> elements, e.g.: <os> ... <boot dev='hd'/> <boot dev='network'/> </os> Then the first disk device in the config will have ",bootindex=1" appended to its qemu commandline -device options, and the first (and *only* the first) network interface device will get ",bootindex=2". However, if the first network interface device is a "hostdev" device (an SRIOV Virtual Function (VF) being assigned to the domain with vfio), then the bootindex option will *not* be appended. This happens because the bootindex=n option corresponding to the order of "<boot dev='network'/>" is added to the -device for the first network device when network device commandline args are constructed, but if it's a hostdev network device, its commandline arg is instead constructed in the loop for hostdevs. This patch fixes that omission by noticing (in bootHostdevNet) if the first network device was a hostdev, and if so passing on the proper bootindex to the commandline generator for hostdev devices - the result is that ",bootindex=2" will be properly appended to the first "network" device in the config even if it is really a hostdev (including if it is assigned from a libvirt network pool). (note that this is only the case if there is no <bootmenu enabled='yes'/> element in the config ("-boot menu-on" in qemu) , since the two are mutually exclusive - when the bootmenu is enabled, the individual per-device bootindex options can't be used by qemu, and we revert to using "-boot order=xyz" instead). If a greater level of control over boot order is desired (e.g., more than one network device should be tried, or a network device other than the first one encountered in the config), then <boot dev='network'/> in the <os> element should not be used; instead, the individual device elements in the config should be given a "<boot order='n'/> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1278421
-
由 Pavel Hrdina 提交于
Commit 256496e1 introduced a detection if "is locked" in error replay from qemu monitor. Commit c4073657 fixed a memory leak, but it was pointed out by Peter, that this could be done cleaner without stringifing the replay. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Michal Privoznik 提交于
The return value of virJSONValueToString() should be freed when no longer needed. This is not the case after 256496e1. ==26902== 138 bytes in 2 blocks are definitely lost in loss record 1,051 of 1,239 ==26902== at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==26902== by 0xAA5F599: strdup (in /lib64/libc-2.21.so) ==26902== by 0x552BAD9: virStrdup (virstring.c:726) ==26902== by 0x54F60A7: virJSONValueToString (virjson.c:1790) ==26902== by 0x1DF6EBB9: qemuMonitorJSONEjectMedia (qemu_monitor_json.c:2225) ==26902== by 0x1DF57A4C: qemuMonitorEjectMedia (qemu_monitor.c:1985) ==26902== by 0x1DF1EF2D: qemuDomainChangeEjectableMedia (qemu_hotplug.c:199) ==26902== by 0x1DF90314: qemuDomainChangeDiskLive (qemu_driver.c:7985) ==26902== by 0x1DF90476: qemuDomainUpdateDeviceLive (qemu_driver.c:8030) ==26902== by 0x1DF91ED7: qemuDomainUpdateDeviceFlags (qemu_driver.c:8677) ==26902== by 0x561785F: virDomainUpdateDeviceFlags (libvirt-domain.c:8559) ==26902== by 0x134210: remoteDispatchDomainUpdateDeviceFlags (remote_dispatch.h:10966) ==26902== 106 bytes in 1 blocks are definitely lost in loss record 1,033 of 1,239 ==26902== at 0x4C29F80: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==26902== by 0xAA5F599: strdup (in /lib64/libc-2.21.so) ==26902== by 0x552BAD9: virStrdup (virstring.c:726) ==26902== by 0x54F60A7: virJSONValueToString (virjson.c:1790) ==26902== by 0x1DF6EC0C: qemuMonitorJSONEjectMedia (qemu_monitor_json.c:2227) ==26902== by 0x1DF57A4C: qemuMonitorEjectMedia (qemu_monitor.c:1985) ==26902== by 0x1DF1EF2D: qemuDomainChangeEjectableMedia (qemu_hotplug.c:199) ==26902== by 0x1DF90314: qemuDomainChangeDiskLive (qemu_driver.c:7985) ==26902== by 0x1DF90476: qemuDomainUpdateDeviceLive (qemu_driver.c:8030) ==26902== by 0x1DF91ED7: qemuDomainUpdateDeviceFlags (qemu_driver.c:8677) ==26902== by 0x561785F: virDomainUpdateDeviceFlags (libvirt-domain.c:8559) ==26902== by 0x134210: remoteDispatchDomainUpdateDeviceFlags (remote_dispatch.h:10966) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Henning Schild 提交于
Moving tasks to cgroups implied sched_setaffinity. Changing the cpus in a set implies the same for all tasks in the group. The old code put the the thread into the cpuset inherited from the machine cgroup, which allowed it to run outside of vcpupin for a short while. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
由 Henning Schild 提交于
The machine cgroup is a superset, a parent to the emulator and vcpuX cgroups. The parent cgroup should never have any tasks directly in it. In fact the parent cpuset might contain way more cpus than the sum of emulatorpin and vcpupins. So putting tasks in the superset will allow them to run outside of <cputune>. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
由 Henning Schild 提交于
virCgroupNewMachine used to add the pidleader to the newly created machine cgroup. Do not do this implicit anymore. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
- 14 12月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
When user configures vhost-user interface and forgets to also configure any shared memory, the search for the root cause of non-operational interface might take unpleasantly long time. Let's enhance user experience by emitting a warning in the logs. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1266982Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 11 12月, 2015 3 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1240439 Ta-da! Now that we know how to open a macvtap device multiple times, we can finally enable the multiqueue feature. Everything else is already prepared (e.g. command line generation) from the previous iteration where the feature was implemented for TUN/TAP devices. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
For the multiqueue on macvtaps we are going to need to open the device multiple times. Currently, this is not supported. Rework the function, so that upper layers can be reworked too. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Michal Privoznik 提交于
So yet again one of integer arguments that we use as a boolean. Since the argument count of the function is unbearably long enough, lets turn those booleans into flags. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 09 12月, 2015 21 次提交
-
-
由 Peter Krempa 提交于
Use the proper data structures for the iteration since ncpupids will be made private later.
-
由 Peter Krempa 提交于
Change some of the control structures and switch to using the new vcpu structure.
-
由 Peter Krempa 提交于
Instead of directly accessing the array add a helper to do this.
-
由 Peter Krempa 提交于
Add qemuDomainHasVCpuPids to do the checking and replace in place checks with it. We no longer need checking whether the thread contains fake data (vcpupids[0] == vm->pid) as in b07f3d82 and 65686e5a this was removed.
-
由 Peter Krempa 提交于
The vCPU threads make sense in the counterparts that set the vCPU bandwidth/quota, not in the emulator one. The emulator tunables are set all the time anyways. Drop the extra check and remove the now unneeded vm argument.
-
由 Peter Krempa 提交于
Since commit 0c04906f the check for priv->cgroup doesn't make sense as the calls to virCgroupHasController return the same information. Remove it and move it's comment partially to the new check. The already spurious check was also later copied to the iothreads code.
-
由 Peter Krempa 提交于
Refactor the code flow so that 'exit_monitor:' can be removed. This patch moves the auditing functions into places where it's certain that hotunplug was or was not successful and reports errors from qemuMonitorGetCPUInfo properly.
-
由 Peter Krempa 提交于
Refactor the code flow so that 'exit_monitor:' can be removed. This patch also moves the auditing and setting of the new vCPU count right to the place where the hotplug happens, since it's possible that the hotplug succeeds and adds a cpu while other stuff fails. Lastly, failures of qemuMonitorGetCPUInfo are now reported rather than ignored. The function retuns 0 if it "successfully" detected 0 threads.
-
由 Peter Krempa 提交于
qemuDomainHotplugVcpus/qemuDomainHotunplugVcpus are complex enough in regards of adding one CPU. Additionally it will be desired to reuse those functions later with specific vCPU hotplug. Move the loops for adding vCPUs into qemuDomainSetVcpusFlags so that the helpers can be made simpler and more straightforward.
-
由 Peter Krempa 提交于
Let the function report errors internally and change it to return standard return codes.
-
由 Peter Krempa 提交于
The cpu hotplug helper functions used negative error handling in a part of them, although some code that was added later didn't properly set the error codes in some cases. This would cause improper error messages in cases where we couldn't modify the numa cpu mask and a few other cases. Fix the logic by converting it to the regularly used pattern.
-
由 Peter Krempa 提交于
There's only very little common code among the two operations. Split the functions so that the internals are easier to understand and refactor later.
-
由 Peter Krempa 提交于
With a very unfortunate timing, the agent might vanish before we do the second call while the locks were down. Re-check that the agent is available before attempting it again.
-
由 Peter Krempa 提交于
Separate the code so that qemuDomainSetVcpusFlags contains only code relevant to hardware hotplug/unplug.
-
由 Peter Krempa 提交于
As in commit 88dc7e0c, the helper can be used in cases where the function actually does not access anyting in the private data besides the agent.
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
-
由 Peter Krempa 提交于
Finalize the refactor by adding the 'virDomainDefGetVCpusMax' getter and reusing it accross libvirt.
-
由 Peter Krempa 提交于
The new helper will simplify checking whether the domain config contains inactive vCPUs.
-
由 Peter Krempa 提交于
The code can be unified into the new accessor rather than being scattered accross the drivers.
-
由 Peter Krempa 提交于
To support further refactors replace all write access to def->maxvcpus with a accessor function.
-
- 08 12月, 2015 2 次提交
-
-
由 Daniel P. Berrange 提交于
The current virtlogd RPC protocol provides the ability to handle log files associated with QEMU stdout/err. The log protocol messages take the virt driver, domain name and use that to form a log file path. This is quite restrictive as it prevents us re-using the same RPC protocol messages for logging to char device backends where the filename can be arbitrarily user specified. It is also bad because it means we have 2 separate locations which have to decide on logfile name. This change alters the RPC protocol so that we pass the desired log file path along when opening the log file initially. Now the virt driver is exclusively in charge of deciding the log filename Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The qemuDomainLogContextNew method leaks the "logfile" path on the non-virtlogd code path. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 05 12月, 2015 2 次提交
-
-
由 Boris Fiuczynski 提交于
When a SCSI disk is hotplugged to a domain that does not have the required SCSI controller already defined and loaded the following internal error occurs error: Failed to attach device from scsi_disk.xml error: internal error: Could not find scsi controller with index 0 required for device Commit 0260506c added in method qemuBuildDriveDevStr a lookup of the controller alias. The internal error occurs because in method qemuDomainAttachSCSIDisk the automatic creation of the potentially missing SCSI controller occurs after calling qemuBuildDriveDevStr. This patch reverses the calling sequence. Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.vnet.ibm.com> Reviewed-by: NStefan Zimmermann <stzi@linux.vnet.ibm.com>
-
由 Daniel P. Berrange 提交于
Often when debugging bug reports one is given a copy of the file from /var/log/libvirt/qemu/$NAME.log along with other supporting files. In a number of cases I've been given sets of files which were from different machines. Including the hostname in the QEMU log file will help identify when the bug reporter is providing bad information. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 04 12月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Since libvirt for dubious historical reasons stores memory size as kibibytes, it's possible that the alignments done in the qemu code overflow the the maximum representable size in bytes. The XML parser code handles them in bytes in some stages. Prevent this by doing overflow checks when alinging the size and add a test case. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1260576
-
- 01 12月, 2015 1 次提交
-
-
由 Wang Yufei 提交于
If VM A is shutdown a by qemu agent at appoximately the same time an agent EOF of VM A happened, there's a chance that deadlock may occur: qemuProcessHandleAgentEOF in main thread A) priv->agent = NULL; //A happened before B //deadlock when we get agent lock which's held by worker thread qemuAgentClose(agent); qemuDomainObjExitAgent called by qemuDomainShutdownFlags in worker thread B) hasRefs = virObjectUnref(priv->agent); // priv->agent is NULL, // return false if (hasRefs) virObjectUnlock(priv->agent); //agent lock will not be released here In order to resolve, during EOF close the agent first, then set priv->agent to NULL to fix the deadlock. This essentially reverts commit id '1020a504'. It's also of note that commit id '362d0477' notes a possible/rare deadlock similar to what was seen in the monitor in commit id '25f582e3'. However, it seems interceding changes including commit id 'd960d06f' should remove the deadlock issue. With this change, if EOF is called: Get VM lock Check if !priv->agent || priv->beingDestroyed, then unlock VM Call qemuAgentClose Unlock VM When qemuAgentClose is called Get Agent lock If Agent->fd open, close it Unlock Agent Unref Agent qemuDomainObjEnterAgent Enter with VM lock Get Agent lock Increase Agent refcnt Unlock VM After running agent command, calling qemuDomainObjExitAgent Enter with Agent lock Unref Agent If not last reference, unlock Agent Get VM lock If we were in the middle of an EnterAgent, call Agent command, and ExitAgent sequence and the EOF code is triggered, then the EOF code can get the VM lock, make it's checks against !priv->agent || priv->beingDestroyed, and call qemuAgentClose. The CloseAgent would wait to get agent lock. The other thread then will eventually call ExitAgent, release the Agent lock and unref the Agent. Once ExitAgent releases the Agent lock, AgentClose will get the Agent Agent lock, close the fd, unlock the agent, and unref the agent. The final unref would cause deletion of the agent. Signed-off-by: NWang Yufei <james.wangyufei@huawei.com> Reviewed-by: NRen Guannan <renguannan@huawei.com>
-
- 30 11月, 2015 3 次提交
-
-
由 Ján Tomko 提交于
<input type='passthrough' bus='virtio'> <source evdev='/dev/input/event1234'/> </input> results in: -device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234 https://bugzilla.redhat.com/show_bug.cgi?id=1231114
-
-
由 Ján Tomko 提交于
Add xml for the new virtio-input-host-pci device: <input type='passthrough' bus='virtio'> <source evdev='/dev/input/event1234'/> </input> https://bugzilla.redhat.com/show_bug.cgi?id=1231114
-