- 17 1月, 2020 10 次提交
-
-
由 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é 提交于
The GNULIB termios module ensures termios.h exists (but is none the less empty) when building for Windows. We already exclude usage of the functions that would exist in a real termios.h, so having an empty termios.h is not especially useful. It is simpler to just put all use of termios.h related functions behind a "#ifndef WIN32" conditional. Reviewed-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é 提交于
Libvirt's original atomic ops impls were largely copied from GLib's code at the time. The only API difference was that libvirt's virAtomicIntInc() would return a value, but g_atomic_int_inc was void. We thus use g_atomic_int_add(v, 1) instead, though this means virAtomicIntInc() now returns the original value, instead of the new value. This rewrites libvirt's impl in terms of g_atomic_int* as a short term conversion. The key motivation was to quickly eliminate use of GNULIB's verify_expr() macro which is not a direct match for G_STATIC_ASSERT_EXPR. Long term all the callers should be updated to use g_atomic_int* directly. 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>
-
由 Daniel P. Berrangé 提交于
Convert to use socket wrappers. Aside from the header file include change, this requires changing close -> closesocket since our portability isn't trying to replace the close function. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Windows sockets take a SOCKET HANDLE object instead of a file descriptor. Wrap them in the same way that gnulib does so that they use C runtime file descriptors. While we could in theory use GSocket, it is hard to get the exact same semantics libvirt has for its current socket usage. Wrapping the Winsock2 APIs is thus the easiest approach in the short term. In changing the socke wrappers we need to re-implement the nonblocking function too, since the GNULIB impl expects to be used with the GNULIB sockets wrappers. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
All UNIX platforms we care about have openpty() in the libutil library. Use of pty.h must also be made conditional, excluding Win32. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
The GLib g_size_checked_mul() function is not quite the same signature, and gives compiler warnings due to not correctly casting from gsize to guint64/32. Implementing a replacement for INT_MULTIPLY_OVERFLOW is easy enough to do ourselves. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Introduce a vastly simpler VIR_INT64_STR_BUFLEN constant which is large enough for all cases where we currently use INT_BUFSIZE_BOUND. This eliminates most use of the gnulib intprops.h header. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 16 1月, 2020 27 次提交
-
-
由 Daniel P. Berrangé 提交于
RHEL7 has libcurl 7.29.0, which is the oldest of any supported build platform. Thus we no longer need the back compat for libcurl < 7.28.0. Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Jonathon Jongsma 提交于
Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
Switch from old VIR_ allocation APIs to glib equivalents. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
This function potentially grabs both a monitor job and an agent job at the same time. This is problematic because it means that a malicious (or just buggy) guest agent can cause a denial of service on the host. The presence of this function makes it easy to do the wrong thing and hold both jobs at the same time. All existing uses have already been removed by previous commits. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
In order to avoid holding an agent job and a normal job at the same time, we want to avoid accessing the domain's definition while holding the agent job. To achieve this, qemuAgentGetFSInfo() only returns the raw information from the agent query to the caller. The caller can then release the agent job and then proceed to look up the disk alias from the vm definition. This necessitates moving a few helper functions to qemu_driver.c and exposing the agent data structure (qemuAgentFSInfo) in the header. In addition, because the agent function no longer returns the looked-up disk alias, we can't test the alias within qemuagenttest. Instead we simply test that we parse and return the raw agent data correctly. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
The qemuAgentDiskInfo structure is filled with information received from the agent command response, except for the 'alias' field, which is retrieved from the vm definition. Limit this structure only to data that was received from the agent message. This is another intermediate step in moving the responsibility for searching the vmdef from qemu_agent.c to qemu_driver.c so that we can avoid holding an agent job and a normal job at the same time. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
In an effort to avoid holding both an agent and normal job at the same time, we shouldn't access the vm definition from within qemu_agent.c (i.e. while the agent job is being held). In preparation, we need to store the full filesystem disk information in qemuAgentDiskInfo. In a following commit, we can pass this information back to the caller and the caller can search the vm definition to match the filsystem disk to an alias. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Jonathon Jongsma 提交于
The function name doesn't give a good idea of what the function does. Rename to qemuAgentGetFSInfoFillDisks() to make it more obvious than it is filling in the disk information in the fsinfo struct. Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 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é 提交于
QEMU since 4.1.0 supports the "dies" parameter for -smp 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>
-
由 Jiri Denemark 提交于
When pause-before-switchover QEMU capability is enabled, we get STOP event before MIGRATION event with postcopy-active state. To properly handle post-copy migration and emit correct events commit v4.10.0-rc1-4-geca9d21e added a hack to qemuProcessHandleMigrationStatus which translates the paused state reason to VIR_DOMAIN_PAUSED_POSTCOPY and emits VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event when migration state changes to post-copy. However, the code was effective on both sides of migration resulting in a confusing VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event on the destination host, where entering post-copy mode is already properly advertised by VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event. https://bugzilla.redhat.com/show_bug.cgi?id=1791458Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@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>
-
由 Michal Privoznik 提交于
When resuming a domain from a save file, we read the domain XML from the file, add it onto our internal list of domains, start the qemu process, let it load the incoming migration stream and resume its vCPUs afterwards. If anything goes wrong, the domain object is removed from the list of domains and error is returned to the caller. However, the qemu process might be left behind - if resuming vCPUs fails (e.g. because qemu is unable to acquire write lock on a disk) then due to a bug the qemu process is not killed but the domain object is removed from the list. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1718707Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Julio Faracco 提交于
Since there is no guest agent in LXC world (yet), we can implement _LEASE flag only. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Julio Faracco 提交于
We have to keep the default - querying the agent if no flag is set. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Julio Faracco 提交于
There is a lots of possibilities to retrieve hostname information from domain. Libvirt could use lease information from dnsmasq to get current hostname too. QEMU supports QEMU-agent but it can use lease source. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com> 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>
-
由 Ján Tomko 提交于
A new helper for trimming combinations of specified characters from the tail of the buffer. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 13 1月, 2020 3 次提交
-
-
由 Pavel Hrdina 提交于
This leaks the FD of BPF map which means it will not be freed. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Thomas Huth 提交于
libvirt currently always reports that USB is available as a bus subsystem type when running "virsh domcapabilities". However, this is not always true, for example the qemu-system-s390x binary normally never has support for USB. Thus we should only report that USB is available if there is also a USB host controller available where we can attach USB devices. Reported-by: NSebastian Mitterle <smitterl@redhat.com> Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1759849Signed-off-by: NThomas Huth <thuth@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 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>
-