- 16 10月, 2019 1 次提交
-
-
由 Ján Tomko 提交于
Since commit 44e7f029 util: rewrite auto cleanup macros to use glib's equivalent VIR_AUTOCLEAN is just an alias for g_auto. Use the GLib macros directly instead of our custom aliases. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 10月, 2019 8 次提交
-
-
由 Ján Tomko 提交于
Prefer the GLib version of the macro. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Also define the macro for building with GLib older than 2.60 Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Define the macro for older GLib versions. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Pavel Mores 提交于
When undefining a UEFI domain its nvram file has to be properly handled as well. It's mandatory to use one of --nvram and --keep-nvram options when 'virsh undefine <domain>' is issued for a UEFI domain. To fix the bug as reported, virsh should return an error message if neither option is used and the nvram file should be removed when --nvram is given. The cause of the problem is that when qemuDomainUndefineFlags() is invoked on an inactive domain the path to its nvram file is empty. This commit aims to fix this by formatting and filling in the path in time for the nvram removal code to run properly. https://bugzilla.redhat.com/show_bug.cgi?id=1751596Signed-off-by: NPavel Mores <pmores@redhat.com> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Use G_GNUC_UNUSED from GLib instead of ATTRIBUTE_UNUSED. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Introduced in GLib 2.10. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Ján Tomko 提交于
Prefer G_GNUC_NULL_TERMINATED which was introduced in GLib 2.8. Signed-off-by: NJán Tomko <jtomko@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 14 10月, 2019 6 次提交
-
-
由 Michal Privoznik 提交于
In upcoming commits, virSecurityManagerSetAllLabel() will perform rollback in case of failure by calling virSecurityManagerRestoreAllLabel(). But in order to do that, the former needs to have @migrated argument so that it can be passed to the latter. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NCole Robinson <crobinso@redhat.com>
-
由 Daniel P. Berrangé 提交于
The usleep function was missing on older mingw versions, but we can rely on it existing everywhere these days. It may only support times upto 1 second in duration though, so we'll prefer to use g_usleep instead. The commandhelper program is not changed since that can't link to glib. Fortunately it doesn't need to build on Windows platforms either. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Converting from virObject to GObject is reasonably straightforward, as illustrated by this patch for virIdentity In the header file - Remove typedef struct _virIdentity virIdentity - Add #define VIR_TYPE_IDENTITY virIdentity_get_type () G_DECLARE_FINAL_TYPE (virIdentity, vir_identity, VIR, IDENTITY, GObject); Which provides the typedef we just removed, and class declaration boilerplate and various other constants/macros. In the source file - Change 'virObject parent' to 'GObject parent' in the struct - Remove the virClass variable and its initializing call - Add G_DEFINE_TYPE(virIdentity, vir_identity, G_TYPE_OBJECT) which declares the instance & class constructor functions - Add an impl of the instance & class constructors wiring up the finalize method to point to our dispose impl In all files - Replace VIR_AUTOUNREF(virIdentityPtr) with g_autoptr(virIdentity) - Replace virObjectRef/Unref with g_object_ref/unref. Note the latter functions do *NOT* accept a NULL object where as libvirt's do. If you replace g_object_unref with g_clear_object it is NULL safe, but also clears the pointer. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Replace use of the gnulib base64 module with glib's own base64 API family. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Libvirt currently uses the VIR_AUTOUNREF macro for auto cleanup of virObject instances. GLib approaches things differently with GObject, reusing their g_autoptr() concept. This introduces support for g_autoptr() with virObject, to facilitate the conversion to GObject. Only virObject classes which are currently used with VIR_AUTOREF are updated. Any others should be converted to GObject before introducing use of autocleanup. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Daniel P. Berrangé 提交于
Add the main glib.h to internal.h so that all common code can use it. Historically glib allowed applications to register an alternative memory allocator, so mixing g_malloc/g_free with malloc/free was not safe. This was feature was dropped in 2.46.0 with: commit 3be6ed60aa58095691bd697344765e715a327fc1 Author: Alexander Larsson <alexl@redhat.com> Date: Sat Jun 27 18:38:42 2015 +0200 Deprecate and drop support for memory vtables Applications are still encourged to match g_malloc/g_free, but it is no longer a mandatory requirement for correctness, just stylistic. This is explicitly clarified in commit 1f24b36607bf708f037396014b2cdbc08d67b275 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Thu Sep 5 14:37:54 2019 +0100 gmem: clarify that g_malloc always uses the system allocator Applications can still use custom allocators in general, but they must do this by linking to a library that replaces the core malloc/free implemenentation entirely, instead of via a glib specific call. This means that libvirt does not need to be concerned about use of g_malloc/g_free causing an ABI change in the public libary, and can avoid memory copying when talking to external libraries. This patch probes for glib, which provides the foundation layer with a collection of data structures, helper APIs, and platform portability logic. Later patches will introduce linkage to gobject which provides the object type system, built on glib, and gio which providing objects for various interesting tasks, most notably including DBus client and server support and portable sockets APIs, but much more too. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 10 10月, 2019 6 次提交
-
-
由 Michal Privoznik 提交于
When constructing QMP capabilities we allocate a dummy domain object to pass to qemuMonitorOpen(). However, after 75dd5958 the function also expects domain definition to be allocated for the domain object. The referenced commit already fixed qemumonitortestutils.c but forgot to fix the other caller: qemuProcessQMPConnectMonitor(). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel Henrique Barboza 提交于
This patch adds the implementation of the ccf-assist pSeries feature, based on the QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST capability that was added in the previous patch. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Daniel Henrique Barboza 提交于
Linux kernel 5.1 added a new PPC KVM capability named KVM_PPC_CPU_CHAR_BCCTR_FLUSH_ASSIST, which is exposed to the QEMU guest since QEMU commit 8ff43ee404d under a new sPAPR capability called SPAPR_CAP_CCF_ASSIST. This cap indicates whether the processor supports hardware acceleration for the count cache flush workaround, which is a software workaround that flushes the count cache on context switch. If the processor has this hardware acceleration, the software flush can be shortened, resulting in performance gain. This hardware acceleration is defaulted to 'off' in QEMU. The reason is that earlier versions of the Power 9 processor didn't support it (it is available on Power 9 DD2.3 and newer), and defaulting this option to 'on' would break migration compatibility between the Power 9 processor class. However, the user running a P9 DD2.3+ hypervisor might want to create guests with ccf-assist=on, accepting the downside of only being able to migrate them only between other P9 DD2.3+ hosts running upstream kernel 5.1+, to get a performance boost. This patch adds this new capability to Libvirt, with the name of QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Jonathon Jongsma 提交于
This device is a very simple framebuffer device supported by qemu that is mostly intended to use as a boot framebuffer in conjunction with a vgpu. However, there is also a standalone ramfb device that can be used as a primary display device and is useful for e.g. aarch64 guests where different memory mappings between the host and guest can prevent use of other devices with framebuffers such as virtio-vga. https://bugzilla.redhat.com/show_bug.cgi?id=1679680 describes the issues in more detail. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-
由 Jonathon Jongsma 提交于
Add a qemu capbility to see if the standalone ramfb device is available. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-
由 Jonathon Jongsma 提交于
When the bochs display type was added, the capability was never checked. Add that check in the same place as the other video device capability checks. Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NJonathon Jongsma <jjongsma@redhat.com>
-
- 09 10月, 2019 3 次提交
-
-
由 Michal Privoznik 提交于
This reverts commit a5a777a8. After previous commit the domain won't disappear while connecting to monitor. There's no need to ref monitor config then. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Michal Privoznik 提交于
When connecting to qemu's monitor the @vm object is unlocked. This is justified - connecting may take a long time and we don't want to wait with the domain object locked. However, just before the domain object is locked again, the monitor's FD is registered in the event loop. Therefore, there is a small window where the event loop has a chance to call a handler for an event that occurred on the monitor FD but vm is not initalized properly just yet (i.e. priv->mon is not set). For instance, if there's an incoming migration, qemu creates its socket but then fails to initialize (for various reasons, I'm reproducing this by using hugepages but leaving the HP pool empty) then the following may happen: 1) qemuConnectMonitor() unlocks @vm 2) qemuMonitorOpen() connects to the monitor socket and by calling qemuMonitorOpenInternal() which subsequently calls qemuMonitorRegister() the event handler is installed 3) qemu fails to initialize and exit()-s, which closes the monitor 4) The even loop sees EOF on the monitor and the control gets to qemuProcessEventHandler() which locks @vm and calls processMonitorEOFEvent() which then calls qemuMonitorLastError(priv->mon). But priv->mon is not set just yet. 5) qemuMonitorLastError() dereferences NULL pointer The solution is to unlock the domain object for a shorter time and most importantly, register event handler with domain object locked so that any possible event processing is done only after @vm's private data was properly initialized. This issue is also mentioned in v4.2.0-99-ga5a777a8. Since we are unlocking @vm and locking it back, another thread might have destroyed the domain meanwhile. Therefore we have to check if domain is still active, and we have to do it at the same place where domain lock is acquired back, i.e. in qemuMonitorOpen(). This creates a small problem for our test suite which calls qemuMonitorOpen() directly and passes @vm which has no definition. This makes virDomainObjIsActive() call crash. Fortunately, allocating empty domain definition is sufficient. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
-
由 Jiri Denemark 提交于
QEMU 2.11 for ppc64 changed all CPU model names to lower case. Since libvirt can't change the model names for compatibility reasons, we need to translate the matching lower case models to the names known by libvirt. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 08 10月, 2019 2 次提交
-
-
由 Michal Privoznik 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=1755303 With the recent work in daemon split and socket activation daemons can come and go. They can and will be started many times during a session which results in objects being autostarted multiple times. This is not optimal. Use virDriverShouldAutostart() to determine if autostart should be done or not. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Michal Privoznik 提交于
The comment says that the function kills domains and networks. This is obviously not the case. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 07 10月, 2019 14 次提交
-
-
由 Fabiano Fidêncio 提交于
086c19d6 added bochs-display capability but didn't fill in the info for domain capabilities. Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Collin Walling 提交于
This command is hooked into the virsh hypervisor-cpu-compare command. As such, the CPU model XML provided to the command will be compared to the hypervisor CPU contained in the QEMU capabilities file for the appropriate QEMU binary (for s390x, this CPU definition can be observed via virsh domcapabilities). QMP will report that the XML CPU is either identical to, a subset of, or incompatible with the hypervisor CPU. s390 can also report that the XML CPU is a "superset" of the hypervisor CPU. This response is presented as incompatible, as this CPU model would not be able to run on the hypervisor. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Message-Id: <1568924706-2311-15-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
This capability enables comparison of CPU models via QMP. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Message-Id: <1568924706-2311-13-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Interfaces with QEMU to compare CPU models. The command takes two CPU models, A and B, that are given a model name and an optional list of CPU features. Through the query-cpu-model-comparison command issued via QMP, a result is produced that contains the comparison evaluation string (identical, superset, subset, incompatible). The list of properties (aka CPU features) that is returned from the QMP response is ignored. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Message-Id: <1568924706-2311-12-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Perform a full CPU model expansion on the result of the baselined model name when the features flag is present. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-11-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
This command is hooked into the virsh hypervisor-cpu-baseline command. The CPU models provided in the XML sent to the command will be baselined via the query-cpu-model-baseline QMP command. The resulting CPU model will be reported. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Message-Id: <1568924706-2311-10-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
This capability enables baselining of CPU models via QMP. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com> Message-Id: <1568924706-2311-9-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Interfaces with QEMU to baseline CPU models. The command takes two CPU models, A and B, that are given a model name and an optional list of CPU features. Through the query-cpu-model-baseline command issued via QMP, a result is produced that contains a new baselined CPU model that is guaranteed to run on both A and B. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielh413@gmail.com> Message-Id: <1568924706-2311-8-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Modify the error messages in qemuMonitorJSONParseCPUModelData to print the command name provided to the function. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-7-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Some older s390 CPU models (e.g. z900) will not report props as a response from query-cpu-model-expansion. As such, we should make the props field optional when parsing the return data from the QMP response. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-6-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
query-cpu-model-baseline/comparison will accept a list of features as part of the command. Since CPUs may be defined with CPU feature policies, let's parse it to the appropriate boolean that the QMP command expects. A feature that is set to required, force, or if it is a hypervisor CPU feature (-1), then set the property value to true. Otherwise (optional, disabled) set the value to false. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-5-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
When expanding a CPU model via query-cpu-model-expansion, any features that were a part of the original model are discarded. For exmaple, when expanding modelA with features f1, f2, a full expansion may reveal feature f3, but the expanded model will not include f1 or f2. Let's pass a virCPUDefPtr to the expansion function in preparation for taking features into consideration. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-4-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
With refactoring most of the expansion function, let's take care of some additional cleanups. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Message-Id: <1568924706-2311-3-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Collin Walling 提交于
Refactor some code in qemuMonitorJSONGetCPUModelExpansion to be later used for the comparison and baseline functions. Signed-off-by: NCollin Walling <walling@linux.ibm.com> Reviewed-by: NBjoern Walk <bwalk@linux.ibm.com> Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <1568924706-2311-2-git-send-email-walling@linux.ibm.com> Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
-