[libvirt] [PATCH] Fix build without polkit
by Pavel Hrdina
The commit 1b854c76 introduced a new function 'virPolkitCheckAuth' and
in the #else section when you don't have polkit all attributes should be
follwed by ATTRIBUTE_UNUSED.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed as build breaker.
src/util/virpolkit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c
index 203bd6e..f4ea736 100644
--- a/src/util/virpolkit.c
+++ b/src/util/virpolkit.c
@@ -238,12 +238,12 @@ int virPolkitCheckAuth(const char *actionid,
#else /* ! WITH_POLKIT1 && ! WITH_POLKIT0 */
-int virPolkitCheckAuth(const char *actionid,
- pid_t pid,
- unsigned long long startTime,
- uid_t uid,
- const char **details,
- bool allowInteraction)
+int virPolkitCheckAuth(const char *actionid ATTRIBUTE_UNUSED,
+ pid_t pid ATTRIBUTE_UNUSED,
+ unsigned long long startTime ATTRIBUTE_UNUSED,
+ uid_t uid ATTRIBUTE_UNUSED,
+ const char **details ATTRIBUTE_UNUSED,
+ bool allowInteraction ATTRIBUTE_UNUSED)
{
VIR_ERROR(_("Polkit auth attempted, even though polkit is not available"));
virReportError(VIR_ERR_AUTH_FAILED, "%s",
--
1.8.5.5
10 years, 2 months
[libvirt] [PATCH 0/4] Add API to manipulate huge pages pool
by Michal Privoznik
This may seem like a cherry on top of the cake, but once we allow
guests to use huge pages we must allow admins to allocate ones.
Michal Privoznik (4):
Introduce virNodeAllocPages
virnuma: Introduce virNumaSetPagePoolSize
nodeinfo: Implement nodeAllocPages
virsh: Expose virNodeAllocPages
daemon/remote.c | 37 ++++++++++++
include/libvirt/libvirt.h.in | 16 ++++++
src/driver.h | 10 ++++
src/libvirt.c | 67 ++++++++++++++++++++++
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 1 +
src/lxc/lxc_driver.c | 22 +++++++
src/nodeinfo.c | 29 ++++++++++
src/nodeinfo.h | 7 +++
src/qemu/qemu_driver.c | 22 +++++++
src/remote/remote_driver.c | 47 +++++++++++++++
src/remote/remote_protocol.x | 20 ++++++-
src/remote_protocol-structs | 17 ++++++
src/uml/uml_driver.c | 22 +++++++
src/util/virnuma.c | 108 ++++++++++++++++++++++++++++++++++
src/util/virnuma.h | 4 ++
src/vbox/vbox_common.c | 19 ++++++
tools/virsh-host.c | 134 +++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 12 ++++
19 files changed, 595 insertions(+), 1 deletion(-)
--
1.8.5.5
10 years, 2 months
[libvirt] [PATCH] tunable_event: extend debug message and tweak limit for remote message
by Pavel Hrdina
It would be nice to also print a params pointer and number of params in
the debug message and the previous limit for number of params in the rpc
message was too large. The 2048 params will be enough for future events.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
daemon/remote.c | 4 ++--
src/remote/remote_protocol.x | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index ddd510c..9884bae 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -990,8 +990,8 @@ remoteRelayDomainEventTunable(virConnectPtr conn,
!remoteRelayDomainEventCheckACL(callback->client, conn, dom))
return -1;
- VIR_DEBUG("Relaying domain tunable event %s %d, callback %d",
- dom->name, dom->id, callback->callbackID);
+ VIR_DEBUG("Relaying domain tunable event %s %d, callback %d, params %p %n",
+ dom->name, dom->id, callback->callbackID, params, nparams);
/* build return data */
memset(&data, 0, sizeof(data));
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 0c6a91e..cd190ef 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -248,7 +248,7 @@ const REMOTE_NETWORK_DHCP_LEASES_MAX = 65536;
const REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX = 4096;
/* Upper limit of message size for tunable event. */
-const REMOTE_DOMAIN_EVENT_TUNABLE_MAX = 8388608;
+const REMOTE_DOMAIN_EVENT_TUNABLE_MAX = 2048;
/* UUID. VIR_UUID_BUFLEN definition comes from libvirt.h */
typedef opaque remote_uuid[VIR_UUID_BUFLEN];
--
1.8.5.5
10 years, 2 months
[libvirt] [RFC] exclusive vcpu-cpu pinning
by Ján Tomko
Hello developers!
Currently, our default cgroup layout is:
-top level cgroup
\-machine (machine.slice with systemd)
`-vm1.libvirt-qemu (machine-qemu\x2dvm1.scope with systemd)
`-emulator
`-vcpu0
\-vcpu1
\-vm2.libvirt-qemu
`-emulator
`-vcpu0
`-vcpu1
To free some CPUs for exclusive use, either all processes from the top level
cgroup should be moved to another one (which does not seem like a great idea)
or isolcpus= should be specified on the kernel command line.
The cpuset.cpu_exclusive option can be set on a cgroup if
* all the groups up to the top level group have it set
* the cpuset of the current group is a subset of the parent group
and no siblings use any cpus from the current cpuset
This would mean that to keep the existing nested structure, all vcpus and the
emulator thread would need to have an exclusive CPU, e.g:
<vcpu placement='static' cpuset='4-6'>2</vcpu>
<cputune exclusive='yes'>
<vcpupin vcpu='0' cpuset='5'/>
<vcpupin vcpu='1' cpuset='6'/>
<emulatorpin cpuset='4'/>
</cputune>
(The only two issues I found:
1) libvirt would have to mess with systemd's 'machine-scope' behind it's back
(setting cpu_exclusive)
2) creating machines without explicit cpu pinning fails, as libvirt tries to
write all the cpus to the cpuset, even those the other machine uses
exclusively)
I've also thought about just keeping track of the 'exclusived' CPUs in
libvirt. This would not work across drivers. And it could possibly be needed
to solve issue 2).
Do you think any of these options would be useful?
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=996758
Jan
10 years, 2 months
[libvirt] [PATCH] hotplug: Fix libvirtd crash on qemu-attached guest
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1141621
Using qemu-attach to attach to a qemu created process and then
attempting to virsh detach-interface caused a libvirtd crash
since the assumption was that device aliases were in place and
that assumption is not necessarily true for the qemu-attach environment.
Add some more verbiage to the virsh man page.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Notes:
* The bz also mentions a failure for the hotplug/virsh attach-interface,
but that has been resolved by commit id 'ba7468db'
* For the bz, the attempt to attach-interface/hotplug still is not
successful, since device aliases are not set for the PCI controller.
* I did try adding a call to qemuAssignDeviceAliases() during the qemu-
attach code; however, that failed as well (perhaps for a different
reason) as the attach to PCI slot 3 function 0 was not available
for rtl8139 since it was being used by e1000
* If it's desired to add the alias call in that's fine, then that could
be added in qemuDomainQemuAttach prior to the qemuDomainAssignAddresses
call similar to qemuConnectDomainXMLToNative.
src/qemu/qemu_hotplug.c | 3 ++-
tools/virsh.pod | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7bc19cd..b7514ce 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3520,7 +3520,8 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
qemuDomainObjEnterMonitor(driver, vm);
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE) &&
+ detach->info.alias) {
if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
qemuDomainObjExitMonitor(driver, vm);
virDomainAuditNet(vm, detach, NULL, "detach", false);
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 9919f92..947adaf 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -3686,8 +3686,9 @@ using the UNIX driver. Ideally the process will also have had the
Not all functions of libvirt are expected to work reliably after
attaching to an externally launched QEMU process. There may be
-issues with the guest ABI changing upon migration, and hotunplug
-may not work.
+issues with the guest ABI changing upon migration and device hotplug
+or hotunplug may not work. The attached environment should be considered
+primarily read-only.
=item B<qemu-monitor-command> I<domain> { [I<--hmp>] | [I<--pretty>] }
I<command>...
--
1.9.3
10 years, 2 months
[libvirt] [PATCH] nodeinfo: fix nodeGetFreePages when max node is zero
by Jincheng Miao
In nodeGetFreePages, if startCell is given by '0',
and the max node number is '0' too. The for-loop
wouldn't be executed.
So convert it to while-loop.
Before:
> virsh freepages --cellno 0 --pagesize 4
error: internal error: no suitable info found
After:
> virsh freepages --cellno 0 --pagesize 4
4KiB: 472637
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/nodeinfo.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 2459922..1fe190a 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -2042,18 +2042,19 @@ nodeGetFreePages(unsigned int npages,
}
lastCell = MIN(lastCell, startCell + cellCount);
+ cell = startCell;
- for (cell = startCell; cell < lastCell; cell++) {
+ do {
for (i = 0; i < npages; i++) {
unsigned int page_size = pages[i];
unsigned int page_free;
- if (virNumaGetPageInfo(cell, page_size, 0, NULL, &page_free) < 0)
+ if (virNumaGetPageInfo(cell++, page_size, 0, NULL, &page_free) < 0)
goto cleanup;
counts[ncounts++] = page_free;
}
- }
+ } while (cell < lastCell);
if (!ncounts) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
--
1.9.3
10 years, 2 months
[libvirt] [PATCH] security: Fix labelling host devices (bz 1145968)
by Cole Robinson
The check for ISCSI devices was missing a check of subsys type, which
meant we could skip labelling of other host devices as well. This fixes
USB hotplug on F21
https://bugzilla.redhat.com/show_bug.cgi?id=1145968
---
src/security/security_apparmor.c | 3 ++-
src/security/security_dac.c | 6 ++++--
src/security/security_selinux.c | 6 ++++--
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 041ce65..3025284 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -828,7 +828,8 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
/* Like AppArmorRestoreSecurityImageLabel() for a networked disk,
* do nothing for an iSCSI hostdev
*/
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ if (dev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
return 0;
if (profile_loaded(secdef->imagelabel) < 0)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index e398d2c..85253af 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -523,7 +523,8 @@ virSecurityDACSetSecurityHostdevLabel(virSecurityManagerPtr mgr,
/* Like virSecurityDACSetSecurityImageLabel() for a networked disk,
* do nothing for an iSCSI hostdev
*/
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ if (dev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
return 0;
cbdata.manager = mgr;
@@ -657,7 +658,8 @@ virSecurityDACRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr,
/* Like virSecurityDACRestoreSecurityImageLabelInt() for a networked disk,
* do nothing for an iSCSI hostdev
*/
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ if (dev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
return 0;
switch ((virDomainHostdevSubsysType) dev->source.subsys.type) {
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index b9efbc5..ea1efc9 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1327,7 +1327,8 @@ virSecuritySELinuxSetSecurityHostdevSubsysLabel(virDomainDefPtr def,
/* Like virSecuritySELinuxSetSecurityImageLabelInternal() for a networked
* disk, do nothing for an iSCSI hostdev
*/
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ if (dev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
return 0;
switch (dev->source.subsys.type) {
@@ -1520,7 +1521,8 @@ virSecuritySELinuxRestoreSecurityHostdevSubsysLabel(virSecurityManagerPtr mgr,
/* Like virSecuritySELinuxRestoreSecurityImageLabelInt() for a networked
* disk, do nothing for an iSCSI hostdev
*/
- if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
+ if (dev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
+ scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
return 0;
switch (dev->source.subsys.type) {
--
2.1.0
10 years, 2 months
[libvirt] [PATCH] Fix MinGW build
by Pavel Hrdina
When building on mingw the format string for long long/unsigned long
long have to be I64d/I64u instead of lld/llu.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
I'm not sure if this is the right way to do it so sending it for review.
examples/object-events/event-test.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c
index 9e09736..e90b590 100644
--- a/examples/object-events/event-test.c
+++ b/examples/object-events/event-test.c
@@ -476,6 +476,15 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
printf("%s EVENT: Domain %s(%d) tunable updated:\n",
__func__, virDomainGetName(dom), virDomainGetID(dom));
+#ifdef WIN32
+/* MinGW doesn't know the lld/llu so we have to use I64f/I64u instead. */
+# define LLD_FORMAT "%I64d"
+# define LLU_FORMAT "%I64u"
+#else /* WIN32 */
+# define LLD_FORMAT "%lld"
+# define LLU_FORMAT "%llu"
+#endif /* WIN32 */
+
for (i = 0; i < nparams; i++) {
switch (params[i].type) {
case VIR_TYPED_PARAM_INT:
@@ -485,10 +494,10 @@ myDomainEventTunableCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
printf("\t%s: %u\n", params[i].field, params[i].value.ui);
break;
case VIR_TYPED_PARAM_LLONG:
- printf("\t%s: %lld\n", params[i].field, params[i].value.l);
+ printf("\t%s: "LLD_FORMAT"\n", params[i].field, params[i].value.l);
break;
case VIR_TYPED_PARAM_ULLONG:
- printf("\t%s: %llu\n", params[i].field, params[i].value.ul);
+ printf("\t%s: "LLU_FORMAT"\n", params[i].field, params[i].value.ul);
break;
case VIR_TYPED_PARAM_DOUBLE:
printf("\t%s: %g\n", params[i].field, params[i].value.d);
--
1.8.5.5
10 years, 2 months
[libvirt] bad rpm: libvirt-daemon-1.2.8-1
by Gene Czarcinski
Since libvirt-daemon-1.2.8-5 fixes the problem, I just wanted to give
everyone a heads up. The libvirt-daemon-1.2.8-1 has an error in the
spec file scripts which causes removal failure.
I had to manually rpm -e --noscripts libvirt-daemon-1.2.8-1.fc20.x86_64
and then I reinstalled libvirt-daemon-1.2.8-5 to make sure things were
"clean".
The error was:
/var/tmp/rpm-tmp.bvfDlf: line 8: libvirtd.socket: command not found
error: %preun(libvirt-daemon-1.2.8-1.fc20.x86_64) scriptlet failed, exit
status 127
Error in PREUN scriptlet in rpm package libvirt-daemon
Gene
10 years, 2 months
[libvirt] [PATCHv2 0/2] Add support for turning off offloading for virtio-net
by Ján Tomko
v2: rework XML to avoid underscores
Ján Tomko (2):
conf: add options for disabling segment offloading
qemu: wire up virtio-net segment offloading options
docs/formatdomain.html.in | 24 ++-
docs/schemas/domaincommon.rng | 44 ++++-
src/conf/domain_conf.c | 218 ++++++++++++++++++++-
src/conf/domain_conf.h | 15 ++
src/qemu/qemu_command.c | 40 ++++
.../qemuxml2argv-net-virtio-disable-offloads.args | 10 +
.../qemuxml2argv-net-virtio-disable-offloads.xml | 35 ++++
tests/qemuxml2argvtest.c | 2 +
tests/qemuxml2xmltest.c | 1 +
9 files changed, 381 insertions(+), 8 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-virtio-disable-offloads.xml
--
1.8.5.5
10 years, 2 months