[libvirt] [PATCH 0/2] Fix compatibility with MTTCG
by Daniel P. Berrangé
QEMU is using MTTCG by default on an increasingly large
set of host/guest combinations. This allows us to use the
normal vCPU pinning support we already have for KVM. We
just need to stop throwing away the PID info, and stop
artificially blocking pinning APIs.
Daniel P. Berrangé (2):
qemu: fix recording of vCPU pids for MTTCG
Revert "qemu: Forbid pinning vCPUs for TCG domain"
src/qemu/qemu_domain.c | 81 ++++++++++++++++++++++++++----------------
src/qemu/qemu_driver.c | 7 ----
2 files changed, 51 insertions(+), 37 deletions(-)
--
2.17.2
6 years
[libvirt] [PATCH 0/2] Augment access denied error message and adjust polkit docs
by John Ferlan
Details in the patches
John Ferlan (2):
access: Modify the VIR_ERR_ACCESS_DENIED to include driverName
docs: Enhance polkit documentation to describe secondary connection
docs/aclpolkit.html.in | 117 ++++++++++++++++++++++++++++++++++
docs/libvirt.css | 1 +
src/access/viraccessmanager.c | 25 ++++----
src/rpc/gendispatch.pl | 2 +-
src/util/virerror.c | 4 +-
5 files changed, 134 insertions(+), 15 deletions(-)
--
2.17.2
6 years
[libvirt] [snmp PATCH 00/20] Misc cleanups and improvements
by Michal Privoznik
These are not pushed. I'll wait couple of moments if there is somebody
who has opinion. If not I will push them.
Michal Privoznik (20):
libvirtGuestTable.c: Free duplicated domain name
libvirtSnmp.c: Retab and realign
configure: Drop support for libvirt older than 0.9.0
configure.ac: Drop useless "-lvirt" in LIBVIRT_LIBS
showError: Switch to less ancient error reporting
libvirtSnmp: Modernize libvirtSnmpLoadGuests
libvirtSnmp: Modernize insertGuest
libvirtSnmp: Rewrite some functions
src: Fix header file defines
src: Fix includes in header files
libvirtRegisterEvents: Drop pthread_attr_init
libvirtSnmp: turn showError() into printf-like function
libvirtSnmpError: Drop 'extern' for printLibvirtError()
libvirtSnmp: Drop 'extern' from function headers
libvirtSnmp: s/showError/printLibvirtError/
libvirtSnmpError: Introduce and use printSystemError
libvirtSnmp: Fix type of libvirtUnregisterEvents()
libvirtSnmp: Report libvirt errors if no domain is found
libvirtSnmpInit: Don't report errors from libvirtRegisterEvents()
.gitignore: Ignore tags file
.gitignore | 1 +
configure.ac | 31 +-
src/Makefile.am | 18 -
src/event_poll.c | 724 -------------------------------------
src/event_poll.h | 132 -------
src/ignore-value.h | 64 ----
src/internal.h | 138 -------
src/libvirtGuestTable.c | 4 +-
src/libvirtNotifications.h | 8 +-
src/libvirtSnmp.c | 436 ++++++++--------------
src/libvirtSnmp.h | 30 +-
src/libvirtSnmpError.c | 83 ++++-
src/libvirtSnmpError.h | 23 +-
src/memory.c | 313 ----------------
src/memory.h | 212 -----------
src/threads.c | 251 -------------
src/threads.h | 101 ------
src/util.c | 105 ------
src/util.h | 38 --
19 files changed, 261 insertions(+), 2451 deletions(-)
delete mode 100644 src/event_poll.c
delete mode 100644 src/event_poll.h
delete mode 100644 src/ignore-value.h
delete mode 100644 src/internal.h
delete mode 100644 src/memory.c
delete mode 100644 src/memory.h
delete mode 100644 src/threads.c
delete mode 100644 src/threads.h
delete mode 100644 src/util.c
delete mode 100644 src/util.h
--
2.18.1
6 years
[libvirt] [PATCH] qemu: Introduce caching whether /dev/kvm is accessible
by Marc Hartmayer
Introduce caching whether /dev/kvm is usable as the QEMU user:QEMU
group. This reduces the overhead of the QEMU capabilities cache
lookup. Before this patch there were many fork() calls used for
checking whether /dev/kvm is accessible. Now we store the result
whether /dev/kvm is accessible or not and we only need to re-run the
virFileAccessibleAs check if the ctime of /dev/kvm has changed.
Suggested-by: Daniel P. Berrangé <berrange(a)redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
---
src/qemu/qemu_capabilities.c | 56 ++++++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e228f52ec0bb..ea95915f0f71 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3238,6 +3238,10 @@ struct _virQEMUCapsCachePriv {
virArch hostArch;
unsigned int microcodeVersion;
char *kernelVersion;
+
+ /* cache whether /dev/kvm is usable as runUid:runGuid */
+ virTristateBool kvmUsable;
+ time_t kvmCtime;
};
typedef struct _virQEMUCapsCachePriv virQEMUCapsCachePriv;
typedef virQEMUCapsCachePriv *virQEMUCapsCachePrivPtr;
@@ -3824,6 +3828,54 @@ virQEMUCapsSaveFile(void *data,
}
+/* Determine whether '/dev/kvm' is usable as QEMU user:QEMU group. */
+static bool
+virQEMUCapsKVMUsable(virQEMUCapsCachePrivPtr priv)
+{
+ struct stat sb;
+ static const char *kvm_device = "/dev/kvm";
+ virTristateBool value;
+ virTristateBool cached_value = priv->kvmUsable;
+ time_t kvm_ctime;
+ time_t cached_kvm_ctime = priv->kvmCtime;
+
+ if (stat(kvm_device, &sb) < 0) {
+ virReportSystemError(errno,
+ _("Failed to stat %s"), kvm_device);
+ return false;
+ }
+ kvm_ctime = sb.st_ctime;
+
+ if (cached_value != VIR_TRISTATE_BOOL_ABSENT) {
+ if (kvm_ctime != cached_kvm_ctime) {
+ VIR_DEBUG("%s has changed (%lld vs %lld)", kvm_device,
+ (long long)kvm_ctime, (long long)cached_kvm_ctime);
+ goto update;
+ }
+
+ return cached_value == VIR_TRISTATE_BOOL_YES;
+ }
+
+ update:
+ if (virFileAccessibleAs(kvm_device, R_OK | W_OK,
+ priv->runUid, priv->runGid) == 0) {
+ value = VIR_TRISTATE_BOOL_YES;
+ } else {
+ value = VIR_TRISTATE_BOOL_NO;
+ }
+
+ /* There is a race window between 'stat' and
+ * 'virFileAccessibleAs'. However, since we're only interested in
+ * detecting changes *after* the virFileAccessibleAs check, we can
+ * neglect this here.
+ */
+ priv->kvmCtime = kvm_ctime;
+ priv->kvmUsable = value;
+
+ return value == VIR_TRISTATE_BOOL_YES;
+}
+
+
static bool
virQEMUCapsIsValid(void *data,
void *privData)
@@ -3872,8 +3924,7 @@ virQEMUCapsIsValid(void *data,
return true;
}
- kvmUsable = virFileAccessibleAs("/dev/kvm", R_OK | W_OK,
- priv->runUid, priv->runGid) == 0;
+ kvmUsable = virQEMUCapsKVMUsable(priv);
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
kvmUsable) {
@@ -4684,6 +4735,7 @@ virQEMUCapsCacheNew(const char *libDir,
priv->runUid = runUid;
priv->runGid = runGid;
priv->microcodeVersion = microcodeVersion;
+ priv->kvmUsable = VIR_TRISTATE_BOOL_ABSENT;
if (uname(&uts) == 0 &&
virAsprintf(&priv->kernelVersion, "%s %s", uts.release, uts.version) < 0)
--
2.17.0
6 years
[libvirt] number of graphic device in vm xml is limited to only 1
by Huangyong
Hello,
In qemu_command, vnc graphic device can’t be more than 1, as the following code show in qemuBuildCommandLineValidate():
If(sdl > 1 || vnc > 1 || spice > 1) {
virReportError(….);
return -1;
}
This check originally introduced by commit: 6fe9025eb.
Qemu: Error on unsupported graphics config
qemu can support multi-vnc-configuration in qemu process, but libvirt limit vnc graphics in only 1.
Is there any considerations in libvirt? can remove this restriction?
-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
6 years
[libvirt] [PATCH v2 0/2] nwfilter: don't reinstantiate rules if there is no need to
by Nikolay Shirokovskiy
Applied on top of [1] that restores reinstantiating filters on daemon reload.
Note the fragile issue mentioned in ebiptablesDumpIstalledRules in respect to list
of firewall tables we are using.
I wonder can we instead of caching instantiate rules faster in the end? There
is iptables-restore if we instantiate directly. And in case of firewalld
mode why we instantiate filters via firewalld dbus interface after all? We use
passthrough interface so looks like firewalld don't account our rules in any
way. May be all we need is reloading rules on firewalld reload and always
instantiate thru binaries? Then we can do things fast.
Diff from v1 [2]:
------------
Approach is changed. Instead of checking whether applied filters changed
or not (so we can miss firewall changes from outside) let's check that
don't change both - rules we are going to apply and rules in firewall in
comparion to previous instantiation.
[1] [PATCH] nwfilter: intantiate filters on loading driver
https://www.redhat.com/archives/libvir-list/2018-October/msg00787.html
[2] [PATCH RFC 0/4] nwfilter: don't reinstantiate filters if they are not changed
https://www.redhat.com/archives/libvir-list/2018-October/msg00904.html
[3] [RFC] Faster libvirtd restart with nwfilter rules
https://www.redhat.com/archives/libvir-list/2018-September/msg01206.html
which continues in
https://www.redhat.com/archives/libvir-list/2018-October/msg00657.html
Nikolay Shirokovskiy (2):
firewall: add dump function
nwfilter: don't reinstantiate rules if there is no need to
src/libvirt_private.syms | 1 +
src/nwfilter/nwfilter_ebiptables_driver.c | 387 +++++++++++++++++++++++++++++-
src/util/virfirewall.c | 111 +++++++++
src/util/virfirewall.h | 3 +
4 files changed, 500 insertions(+), 2 deletions(-)
--
1.8.3.1
6 years
[libvirt] [PATCH] conf: More clear error msg for incomplete coalesce xml
by Han Han
https://bugzilla.redhat.com/show_bug.cgi?id=1535930
Report more clear err msg instead of unknown error when coalesce
settings is incomplete.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/conf/domain_conf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9911d56130..e755f45d3d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7804,8 +7804,12 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node,
ctxt->node = node;
str = virXPathString("string(./rx/frames/@max)", ctxt);
- if (!str)
+ if (!str) {
+ virReportError(VIR_ERR_XML_DETAIL,
+ "%s",
+ _("incomplete coalesce settings in interface xml"));
goto cleanup;
+ }
if (VIR_ALLOC(ret) < 0)
goto cleanup;
--
2.19.1
6 years
[libvirt] [PULL v2 00/43] Machine queue, 2018-10-25
by Eduardo Habkost
Changes v1 -> v2:
* Fix 'make check' warnings (Igor)
The following changes since commit 13399aad4fa87b2878c49d02a5d3bafa6c966ba3:
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' into staging (2018-10-23 17:20:23 +0100)
are available in the Git repository at:
git://github.com/ehabkost/qemu.git tags/machine-next-pull-request
for you to fetch changes up to 8fa922c241e63f018f5b55c03ac494ae3d5fe594:
net: xgmac: convert SysBus init method to a realize method (2018-10-24 06:44:59 -0300)
----------------------------------------------------------------
Machine queue, 2018-10-25
* sysbus init/realize cleanups
(Cédric Le Goater, Philippe Mathieu-Daudé)
* memory-device refactoring (David Hildenbrand)
* -smp: deprecate incorrect CPUs topology (Igor Mammedov)
* -numa parsing cleanups (Markus Armbruster)
* Fix hostmem-file memory leak (Zhang Yi)
* Typo fix (Li Qiang)
----------------------------------------------------------------
Queue for Machine Core patches
Cédric Le Goater (11):
net: etraxfs_eth: convert SysBus init method to a realize method
net: etraxfs_eth: add a reset method
net: lan9118: convert SysBus init method to a realize method
net: lance: convert SysBus init method to a realize method
net: milkymist_minimac2: convert SysBus init method to a realize
method
net: mipsnet: convert SysBus init method to a realize method
net: opencores_eth: convert SysBus init method to a realize method
net: smc91c111: convert SysBus init method to a realize method
net: stellaris_enet: convert SysBus init method to a realize method
net: stellaris_enet: add a reset method
net: xgmac: convert SysBus init method to a realize method
David Hildenbrand (16):
memory-device: fix alignment error message
memory-device: fix error message when hinted address is too small
memory-device: improve "range conflicts" error message
pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug
memory-device: use memory device terminology in error messages
memory-device: introduce separate config option
memory-device: forward errors in get_region_size()/get_plugged_size()
memory-device: document MemoryDeviceClass
memory-device: add and use memory_device_get_region_size()
memory-device: factor out get_memory_region() from pc-dimm
memory-device: drop get_region_size()
memory-device: add device class function set_addr()
memory-device: complete factoring out pre_plug handling
memory-device: complete factoring out plug handling
memory-device: complete factoring out unplug handling
memory-device: trace when pre_plugging/plugging/unplugging
Igor Mammedov (2):
vl.c deprecate incorrect CPUs topology
vl:c: make sure that sockets are calculated correctly in '-smp X' case
Li Qiang (1):
machine: fix a typo
Philippe Mathieu-Daudé (12):
trace-events: Fix copy/paste typo
hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events
hw/timer/sun4v-rtc: Use DeviceState::realize rather than
SysBusDevice::init
hw/ssi/xilinx_spi: Use DeviceState::realize rather than
SysBusDevice::init
hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init
hw/pci-host/bonito: Use DeviceState::realize rather than
SysBusDevice::init
hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device
reset method
hw/mips/gt64xxx_pci: Mark as bridge device
hw/sparc64/niagara: Model the I/O Bridge with the
'unimplemented_device'
hw/alpha/typhoon: Remove unuseful code
hw/hppa/dino: Remove unuseful code
hw/mips/malta: Remove unuseful code
Zhang Yi (1):
hostmem-file: fixed the memory leak while get pmem path.
default-configs/i386-softmmu.mak | 3 +-
default-configs/ppc64-softmmu.mak | 3 +-
default-configs/sparc64-softmmu.mak | 1 -
qapi/misc.json | 2 +-
include/hw/mem/memory-device.h | 74 +++++++++++++++++---
include/hw/mem/pc-dimm.h | 10 +--
backends/hostmem-file.c | 10 ++-
hw/alpha/typhoon.c | 13 ----
hw/core/machine.c | 2 +-
hw/hppa/dino.c | 7 --
hw/i386/pc.c | 6 +-
hw/mem/memory-device.c | 103 ++++++++++++++++++++++------
hw/mem/nvdimm.c | 9 ++-
hw/mem/pc-dimm.c | 84 ++++++++---------------
hw/mips/gt64xxx_pci.c | 18 ++---
hw/mips/mips_malta.c | 13 ----
hw/net/etraxfs_eth.c | 44 ++++++++----
hw/net/lan9118.c | 9 +--
hw/net/lance.c | 8 +--
hw/net/milkymist-minimac2.c | 9 +--
hw/net/mipsnet.c | 9 +--
hw/net/opencores_eth.c | 8 +--
hw/net/smc91c111.c | 8 +--
hw/net/stellaris_enet.c | 15 ++--
hw/net/xgmac.c | 9 +--
hw/pci-host/bonito.c | 9 +--
hw/ppc/spapr.c | 29 +++-----
hw/sh4/sh_pci.c | 20 +++---
hw/sparc64/niagara.c | 4 +-
hw/ssi/xilinx_spi.c | 9 +--
hw/timer/sun4v-rtc.c | 23 +++----
tests/cpu-plug-test.c | 18 ++---
vl.c | 12 +++-
hw/Makefile.objs | 2 +-
hw/mem/Makefile.objs | 4 +-
hw/mem/trace-events | 5 +-
hw/timer/trace-events | 6 +-
qemu-deprecated.texi | 12 ++++
38 files changed, 344 insertions(+), 286 deletions(-)
--
2.18.0.rc1.1.g3f1ff2140
6 years
[libvirt] [PATCH 00/11] Avoid numerous calls of virQEMUCapsCacheLookup
by Marc Hartmayer
For a domain definition there are numerous calls of
virQEMUCapsCacheLookup (the same applies to the domain start). This
slows down the process since virQEMUCapsCacheLookup validates that the
QEMU capabilitites are still valid (among other things, a fork is done
for this if the user for the QEMU processes is 'qemu'). Therefore
let's reduce the number of virQEMUCapsCacheLookup calls whenever
possible and reasonable.
In addition to the speed up, there is the risk that
virQEMUCapsCacheLookup returns different QEMU capabilities during a
task if, for example, the QEMU binary has changed during the task.
The correct way would be:
- get the QEMU capabilities only once per task via virQEMUCapsCacheLookup
- do the task with these QEMU capabilities
or
- abort the task after a cache invalidation
Note: With this patch series the behavior is still not (completely)
fixed, but the performance has been significantly improved. In a quick
test this gave a speed up of factor 4 for a simple define/undefine
loop.
In general, the more devices a domain has, the more drastic the
overhead becomes (because a cache validation is performed for each
device).
Marc Hartmayer (11):
qemu: Use VIR_STEAL_PTR macro
qemu: Introduce qemuDomainUpdateQEMUCaps()
qemu: Pass QEMUCaps to virDomainDefPostParse
conf: Use getParseOpaque() in virDomainObjSetDefTransient
conf: Add function description for virDomainDefPostParse
conf: Get rid of virDomainDeviceDefPostParseOne
conf: Extend virDomainDefValidate(Callback) for parseOpaque
conf: Use domainPostParseData(Alloc|Free) in virDomainDefValidate
qemu: Use @parseOpaque in qemuDomainDefValidate
conf: Extend virDomainDeviceDefValidate(Callback) for parseOpaque
qemu: Use @parseOpaque in qemuDomainDeviceDefValidate
src/conf/domain_conf.c | 98 ++++++++++++++++++++++++++---------------
src/conf/domain_conf.h | 9 ++--
src/qemu/qemu_domain.c | 82 +++++++++++++++++++---------------
src/qemu/qemu_domain.h | 4 ++
src/qemu/qemu_process.c | 18 +++-----
src/vz/vz_driver.c | 6 ++-
6 files changed, 128 insertions(+), 89 deletions(-)
--
2.17.0
6 years, 1 month