- 29 1月, 2020 1 次提交
-
-
由 Nikolay Shirokovskiy 提交于
And introduce virDomainBlockIoTuneInfoHasAny. Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 1月, 2020 3 次提交
-
-
由 Ján Tomko 提交于
It is used by the user-alias handling code. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Ján Tomko 提交于
Some *ParseXML functions have comments stating what kind of device they parse with an outdated list of parameters, with the exception of virDomainFSDefParseXML which claims to parse a disk. Remove them, assuming the function names are descriptive enough. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Ján Tomko 提交于
Use the virXMLFormatElement helper to format the driver element to simplify adding further sub-elements. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 25 1月, 2020 1 次提交
-
-
由 Han Han 提交于
The 'builtin' rng backend model can be used as following: <rng model='virtio'> <backend model='builtin'/> </rng> Signed-off-by: NHan Han <hhan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 1月, 2020 2 次提交
-
-
由 Peter Krempa 提交于
If we get a user reporting this error message being shown it's pretty useless in terms of actually debugging it since we don't know which hash and which key are actually subject to the error. This patch adds a new hash table callback which formats the user-readable version of the hash key and reports it in the new message which will look like: "Duplicate hash table key 'blah'" That way we will at least have an anchor point where to start the search. There are two special implementations of keys which are numeric so we add specific printer functions for them. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
If users wish to use different name for exported disks or bitmaps the new fields allow to do so. Additionally they also document the current settings. Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
- 23 1月, 2020 2 次提交
-
-
由 Julio Faracco 提交于
QEMU driver has two functions: qemuGetDHCPInterfaces() and qemuARPGetInterfaces() that are being used inside only one single function. They can be turned into generic functions that other drivers can use. This commit move both from QEMU driver tree to domain conf tree. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
Simplify function logic by using g_autofree to free local variables so that we can remove some goto statements that are used for cleanup. Introduce a g_autoptr cleanup function for virNodeDeviceDef. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 17 1月, 2020 3 次提交
-
-
由 Daniel P. Berrangé 提交于
gmtime_r/localtime_r are mostly used in combination with strftime to format timestamps in libvirt. This can all be replaced with GDateTime resulting in simpler code that is also more portable. There is some boundary condition problem in parsing POSIX timezone offsets in GLib which tickles our test suite. The test suite is hacked to avoid the problem. The upsteam GLib bug report is https://gitlab.gnome.org/GNOME/glib/issues/1999Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
G_STATIC_ASSERT() is a drop-in functional equivalent of the GNULIB verify() macro. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
We don't need all the platforms gnulib deals with, so this is a cut down version of GNULIB's physmem.c code. This also allows us to integrate libvirt's error reporting functions closer to the error cause. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 16 1月, 2020 8 次提交
-
-
由 Daniel P. Berrangé 提交于
Update the host CPU code to report the die_id in the NUMA topology capabilities. On systems with multiple dies, this fixes the bug where CPU cores can't be distinguished: <cpus num='12'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> <cpu id='1' socket_id='0' core_id='1' siblings='1'/> <cpu id='2' socket_id='0' core_id='0' siblings='2'/> <cpu id='3' socket_id='0' core_id='1' siblings='3'/> </cpus> Notice how core_id is repeated within the scope of the same socket_id. It now reports <cpus num='12'> <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/> <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/> <cpu id='2' socket_id='0' die_id='1' core_id='0' siblings='2'/> <cpu id='3' socket_id='0' die_id='1' core_id='1' siblings='3'/> </cpus> So core_id is now unique within a (socket_id, die_id) pair. Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Recently CPU hardware vendors have started to support a new structure inside the CPU package topology known as a "die". Thus the hierarchy is now: sockets > dies > cores > threads This adds support for "dies" in the XML parser, with the value defaulting to 1 if not specified for backwards compatibility. For example a system with 64 logical CPUs might report <topology sockets="4" dies="2" cores="4" threads="2"/> Reviewed-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
This is only a theoretical leak, but in virChrdevAlloc() we initialize a mutex and if creating a hash table fails, then virChrdevFree() is called which because of incorrect check doesn't deinit the mutex. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
When opening a console to a domain, we put a tuple of {path, virStreamPtr} into a hash table that's private to the domain. This is to ensure only one client at most has the console stream open. Later, when the console is closed, the tuple is removed from the hash table and freed. Except, @path won't be freed. ==234102== 60 bytes in 5 blocks are definitely lost in loss record 436 of 651 ==234102== at 0x4836753: malloc (vg_replace_malloc.c:307) ==234102== by 0x5549110: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6) ==234102== by 0x5562D1E: g_strdup (in /usr/lib64/libglib-2.0.so.0.6000.6) ==234102== by 0x4A5A917: virChrdevOpen (virchrdev.c:412) ==234102== by 0x17B64645: qemuDomainOpenConsole (qemu_driver.c:17309) ==234102== by 0x4BC8031: virDomainOpenConsole (libvirt-domain.c:9662) ==234102== by 0x13F854: remoteDispatchDomainOpenConsole (remote_daemon_dispatch_stubs.h:9211) ==234102== by 0x13F72F: remoteDispatchDomainOpenConsoleHelper (remote_daemon_dispatch_stubs.h:9178) ==234102== by 0x4AB0685: virNetServerProgramDispatchCall (virnetserverprogram.c:430) ==234102== by 0x4AB01F0: virNetServerProgramDispatch (virnetserverprogram.c:302) ==234102== by 0x4AB700B: virNetServerProcessMsg (virnetserver.c:136) ==234102== by 0x4AB70CB: virNetServerHandleJob (virnetserver.c:153) Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Ján Tomko 提交于
As of systemd commit: commit d65652f1f21a4b0c59711320f34266c635393c89 Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> CommitDate: 2018-12-10 09:56:56 +0100 Partially unify hostname_is_valid() and dns_name_is_valid() Dashes are no longer allowed at the end of machine names. Trim the trailing dashes from the generated name before passing it to machined. https://bugzilla.redhat.com/show_bug.cgi?id=1790409Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 13 1月, 2020 2 次提交
-
-
由 Thomas Huth 提交于
When trying to specify an input device on s390x without bus like this: <input type='keyboard'/> ... then libvirt currently complains: error: unsupported configuration: USB is disabled for this domain, but USB devices are present in the domain XML This is somewhat confusing since the user did not specify an USB device here. Since USB is not available on s390x, we should default to the "virtio" bus here instead. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1790189Signed-off-by: NThomas Huth <thuth@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Historically there are two places where we format authentication and encryption for a disk. The logich which formats it for backing files was flawed though and didn't format it at all. This worked if the image became a backing file through the means of a snapshot but not directly. Force formatting of the source and encryption for any non-disk case to fix the issue. This caused problems in many places as we use the formatter to copy the definition. Effectively any copy lost the secret definition. https://bugzilla.redhat.com/show_bug.cgi?id=1789310 https://bugzilla.redhat.com/show_bug.cgi?id=1788898Signed-off-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
- 08 1月, 2020 3 次提交
-
-
由 Michal Privoznik 提交于
The point of this function is to translate virDomainOsDefFirmware enum to qemuFirmwareOSInterface enum. However, with my commit v5.10.0-507-g8e1804f9 we are passing a variable type of virDomainLoader enum. Make the function accept both enums and make the enum members correspond to each other. This fixes clang build. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Ján Tomko 提交于
Add an object to hold the private data and call the allocation function if it's present in xmlopt. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Ján Tomko 提交于
This will be needed in the future for allocating private data. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 1月, 2020 3 次提交
-
-
由 Daniel Henrique Barboza 提交于
Remove unneeded, easy to remove goto labels (cleanup|error|done|...). Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Michal Privoznik 提交于
These functions are meant to replace verbose check for the old style of specifying UEFI with a simple function call. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The g_date_time_new_from_iso8601() function was introduced as a replacement for strptime in commit 810613a6 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Mon Dec 23 15:37:26 2019 +0000 src: replace strptime()/timegm()/mktime() with GDateTime APIs set Unfortunately g_date_time_new_from_iso8601 isn't available until glib 2.56, and backporting it requires alot of code copying and poking at private glib structs. This reverts domain_conf.c back to its original parsing logic prior to 810613a6, but using g_date_time_new() instead of gmtime(). The other files are then adapted to follow a similar approach. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 03 1月, 2020 4 次提交
-
-
由 Daniel P. Berrangé 提交于
All places where we use strptime/timegm()/mktime() are handling conversion of dates in a format compatible with ISO 8601, so we can use the GDateTime APIs to simplify code. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The last_component() method is a GNULIB custom function that returns a pointer to the base name in the path. This is similar to g_path_get_basename() but without the malloc. The extra malloc is no trouble for libvirt's needs so we can use g_path_get_basename(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
g_get_real_time() returns the time since epoch in microseconds. It uses gettimeofday() internally while libvirt used clock_gettime because it is declared async signal safe. In practice gettimeofday is also async signal safe *provided* the timezone parameter is NULL. This is indeed the case in g_get_real_time(). Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 21 12月, 2019 1 次提交
-
-
由 Fabiano Fidêncio 提交于
As pointed out by Ján Tomko, "no_memory seems suspicious in the times of abort()". As libvirt decided to take the path to not report OOM and simply abort when it happens, let's get rid of the no_memory labels and simplify the code around them. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
-
- 20 12月, 2019 1 次提交
-
-
由 Pino Toscano 提交于
It will be used to represent the type of a filesystem pool in ESXi. Signed-off-by: NPino Toscano <ptoscano@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
- 19 12月, 2019 2 次提交
-
-
由 John Ferlan 提交于
Recent changes removed the virCapsPtr, but didn't adjust/remove the corresponding ATTRIBUTE_NONNULL resulting in a build failure to build in my Coverity environment. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
This patch introduces a new PCI hostdev address type called 'unassigned'. This new type gives users the option to add PCI hostdevs to the domain XML in an 'unassigned' state, meaning that the device exists in the domain, is managed by Libvirt like any regular PCI hostdev, but the guest does not have access to it. This adds extra options for managing PCI device binding inside Libvirt, for example, making all the managed PCI hostdevs declared in the domain XML to be detached from the host and bind to the chosen driver and, at the same time, allowing just a subset of these devices to be usable by the guest. Next patch will use this new address type in the QEMU driver to avoid adding unassigned devices to the QEMU launch command line. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 18 12月, 2019 3 次提交
-
-
由 Daniel P. Berrangé 提交于
If the host OS doesn't have NUMA present, we fallback to populating fake NUMA info and the code thus assumes only a single NUMA node. Unfortunately we also fallback to fake NUMA if numactl-devel was not present, and in this case we can still have multiple NUMA nodes. In this case we create all CPUs, but only the CPUs in the first node have any data filled in, resulting in capabilities like: <topology> <cells num='1'> <cell id='0'> <memory unit='KiB'>15977572</memory> <cpus num='48'> <cpu id='0' socket_id='0' core_id='0' siblings='0'/> <cpu id='1' socket_id='0' core_id='0' siblings='1'/> <cpu id='2' socket_id='0' core_id='1' siblings='2'/> <cpu id='3' socket_id='0' core_id='1' siblings='3'/> <cpu id='4' socket_id='0' core_id='2' siblings='4'/> <cpu id='5' socket_id='0' core_id='2' siblings='5'/> <cpu id='6' socket_id='0' core_id='3' siblings='6'/> <cpu id='7' socket_id='0' core_id='3' siblings='7'/> <cpu id='8' socket_id='0' core_id='4' siblings='8'/> <cpu id='9' socket_id='0' core_id='4' siblings='9'/> <cpu id='10' socket_id='0' core_id='5' siblings='10'/> <cpu id='11' socket_id='0' core_id='5' siblings='11'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> <cpu id='0'/> </cpus> </cell> </cells> </topology> With this new code we get something slightly less broken <topology> <cells num='4'> <cell id='0'> <memory unit='KiB'>15977572</memory> <cpus num='12'> <cpu id='0' socket_id='0' core_id='0' siblings='0-1'/> <cpu id='1' socket_id='0' core_id='0' siblings='0-1'/> <cpu id='2' socket_id='0' core_id='1' siblings='2-3'/> <cpu id='3' socket_id='0' core_id='1' siblings='2-3'/> <cpu id='4' socket_id='0' core_id='2' siblings='4-5'/> <cpu id='5' socket_id='0' core_id='2' siblings='4-5'/> <cpu id='6' socket_id='0' core_id='3' siblings='6-7'/> <cpu id='7' socket_id='0' core_id='3' siblings='6-7'/> <cpu id='8' socket_id='0' core_id='4' siblings='8-9'/> <cpu id='9' socket_id='0' core_id='4' siblings='8-9'/> <cpu id='10' socket_id='0' core_id='5' siblings='10-11'/> <cpu id='11' socket_id='0' core_id='5' siblings='10-11'/> </cpus> </cell> <cell id='0'> <memory unit='KiB'>15977572</memory> <cpus num='12'> <cpu id='12' socket_id='0' core_id='0' siblings='12-13'/> <cpu id='13' socket_id='0' core_id='0' siblings='12-13'/> <cpu id='14' socket_id='0' core_id='1' siblings='14-15'/> <cpu id='15' socket_id='0' core_id='1' siblings='14-15'/> <cpu id='16' socket_id='0' core_id='2' siblings='16-17'/> <cpu id='17' socket_id='0' core_id='2' siblings='16-17'/> <cpu id='18' socket_id='0' core_id='3' siblings='18-19'/> <cpu id='19' socket_id='0' core_id='3' siblings='18-19'/> <cpu id='20' socket_id='0' core_id='4' siblings='20-21'/> <cpu id='21' socket_id='0' core_id='4' siblings='20-21'/> <cpu id='22' socket_id='0' core_id='5' siblings='22-23'/> <cpu id='23' socket_id='0' core_id='5' siblings='22-23'/> </cpus> </cell> </cells> </topology> The topology at least now reflects what 'virsh nodeinfo' reports. The main bug is that the CPU "id" values won't match what the Linux host actually uses. Reviewed-by: NMichal Privoznik <mprivozn@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The 'caps' object is already allocated when the fake NUMA initialization takes place. Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
Fortunately, this is not causing any problems now because glib does this check for us when calling this function via attribute cleanup. But in a future commit we will explicitly call this function over a struct member that might be NULL. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
- 17 12月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
This function will return true if any of disks (or their backing chain) for given domain contains an NVMe disk. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-