[libvirt] [PATCH] Fix the build failure
by Osier Yang
Commit 16251193afdc forgot to include "virstring.h". Pushed under
build-breaker rule.
---
src/rpc/virnetservermdns.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c
index 68d5e4e..4b3c19a 100644
--- a/src/rpc/virnetservermdns.c
+++ b/src/rpc/virnetservermdns.c
@@ -45,6 +45,7 @@
#include "viralloc.h"
#include "virerror.h"
#include "virlog.h"
+#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_RPC
--
1.8.1.4
11 years, 6 months
[libvirt] Schedule for next release ?
by Daniel Veillard
It seems that if we want to have the release at the end of the month
we ought to enter freeze next Monday the 27 for a release on the 3rd
(I may have a hard time making the release on Friday 31 or w.e.).
Is there any problem with freezing next Monday ? If not let's proceed
that way, in that case 1.0.6 will be out on Monday 3rd June !
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
11 years, 6 months
[libvirt] [PATCH 0/7 v2] Fixes for cgroup setting.
by Osier Yang
/8 ~ 5/8 are refactorings, real fixes are 6/8, 7/8.
v1 - v2:
* Only rebasing
Osier Yang (7):
qemu: Abstract the code for blkio controller setting into a helper
qemu: Abstract code for memory controller setting into a helper
qemu: Abstract code for devices controller setting into a helper
qemu: Abstract code for cpuset controller setting into a helper
qemu: Abstract code for the cpu controller setting into a helper
qemu: Set cpuset.cpus for domain process
qemu: Prohibit getting the numa parameters if mode is not strict
src/qemu/qemu_cgroup.c | 556 +++++++++++++++++++++++++++++--------------------
src/qemu/qemu_driver.c | 11 +-
2 files changed, 340 insertions(+), 227 deletions(-)
--
1.8.1.4
11 years, 6 months
[libvirt] [test-API][PATCH] Add env check function for memory_params_live
by Wayne Sun
In this case, domain memory cgroup path is hardcoded and fail the
case after cgroup path changed recently. To avoid such failure, add
check function for lscgroup command before run this case, if check
fail then skip this case.
Signed-off-by: Wayne Sun <gsun(a)redhat.com>
---
repos/domain/memory_params_live.py | 36 ++++++++++++++++++++++++++++++------
1 file changed, 30 insertions(+), 6 deletions(-)
diff --git a/repos/domain/memory_params_live.py b/repos/domain/memory_params_live.py
index 44fb8b4..280792a 100644
--- a/repos/domain/memory_params_live.py
+++ b/repos/domain/memory_params_live.py
@@ -4,6 +4,7 @@
import os
import math
+import commands
from xml.dom import minidom
import libvirt
@@ -15,27 +16,35 @@ required_params = ('guestname', 'hard_limit', 'soft_limit', 'swap_hard_limit', )
optional_params = {}
UNLIMITED = 9007199254740991
-CGROUP_PATH = "/cgroup/memory/libvirt/qemu"
+CGROUP_PATH = "/cgroup/"
def get_cgroup_setting(guestname):
"""get domain memory parameters in cgroup
"""
if os.path.exists(CGROUP_PATH):
- cgroup_path = "%s/%s" % (CGROUP_PATH, guestname)
+ cgroup_path = CGROUP_PATH
else:
- cgroup_path = "/sys/fs%s/%s" % (CGROUP_PATH, guestname)
+ cgroup_path = "/sys/fs%s" % CGROUP_PATH
- f = open("%s/memory.limit_in_bytes" % cgroup_path)
+ cmd = "lscgroup | grep %s | grep memory:" % guestname
+ ret, out = commands.getstatusoutput(cmd)
+ if ret:
+ logger.error(out)
+ return 1
+ else:
+ mem_cgroup_path = "%s%s" % (cgroup_path, out.replace(':', ''))
+
+ f = open("%s/memory.limit_in_bytes" % mem_cgroup_path)
hard = int(f.read())
logger.info("memory.limit_in_bytes value is %s" % hard)
f.close()
- f = open("%s/memory.soft_limit_in_bytes" % cgroup_path)
+ f = open("%s/memory.soft_limit_in_bytes" % mem_cgroup_path)
soft = int(f.read())
logger.info("memory.soft_limit_in_bytes value is %s" % soft)
f.close()
- f = open("%s/memory.memsw.limit_in_bytes" % cgroup_path)
+ f = open("%s/memory.memsw.limit_in_bytes" % mem_cgroup_path)
swap = int(f.read())
logger.info("memory.memsw.limit_in_bytes value is %s" % swap)
f.close()
@@ -98,6 +107,10 @@ def memory_params_live(params):
logger.info("check memory parameters in cgroup")
ret = get_cgroup_setting(guestname)
+ if ret == 1:
+ logger.error("fail to get domain memory cgroup setting")
+ return 1
+
for i in param_dict.keys():
if math.fabs(param_dict[i] - ret[i]) > 1:
logger.error("%s value not match with cgroup setting" % i)
@@ -110,3 +123,14 @@ def memory_params_live(params):
return 1
return 0
+
+def memory_params_live_check(params):
+ """check lscgroup packages
+ """
+ logger = params['logger']
+ cmd = 'lscgroup'
+ ret, out = commands.getstatusoutput(cmd)
+ if ret and 'command not found' in out:
+ logger.error(out)
+ logger.error("package libcgroup or libcgroup-tools is not installed")
+ return 1
--
1.8.2.1
11 years, 6 months
[libvirt] Remove OPTION section in output of 'virsh help command' if no option exists.
by Zhang Xiaohe
Don't print 'OPTION' if there's no options. Just behaves as DESCRIPTION
does.
This mostly affects 'interface' command group.
Signed-off-by: Zhang Xiaohe <zhangxh(a)cn.fujitsu.com>
Reported-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
---
tools/virsh.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index ecb7bd4..7c60800 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1270,7 +1270,9 @@ vshCmddefHelp(vshControl *ctl, const char *cmdname)
if (def->opts) {
const vshCmdOptDef *opt;
- fputs(_("\n OPTIONS\n"), stdout);
+ /* Print the option only if there are options */
+ if (def->opts->name)
+ fputs(_("\n OPTIONS\n"), stdout);
for (opt = def->opts; opt->name; opt++) {
switch (opt->type) {
case VSH_OT_BOOL:
--
1.7.1
11 years, 6 months
[libvirt] [PATCH] virNetDevTapCreate: Fail on systems not supporting IFF_MULTI_QUEUE
by Michal Privoznik
In my previous patches I enabled the IFF_MULTI_QUEUE flag every
time the user requested multiqueue TAP device. However, this
works only at runtime. During build time the flag may be
undeclared.
---
src/util/virnetdevtap.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index aa41b9c..e8057f7 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -178,8 +178,15 @@ int virNetDevTapCreate(char **ifname,
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
/* If tapfdSize is greater than one, request multiqueue */
- if (tapfdSize > 1)
+ if (tapfdSize > 1) {
+# ifdef IFF_MULTI_QUEUE
ifr.ifr_flags |= IFF_MULTI_QUEUE;
+# else
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Multiqueue devices are not supported on this system"));
+ goto cleanup;
+# endif
+ }
# ifdef IFF_VNET_HDR
if ((flags & VIR_NETDEV_TAP_CREATE_VNET_HDR) &&
--
1.8.2.1
11 years, 6 months
[libvirt] [qemu-devel] Default machine type setting for ppc64
by Li Zhang
Hi all,
Sorry to bring this problem up again.
We encounter this problem in openstack which always use
default machine type. Currently, QEMU sets mac99 as default
setting for ppc64 but it doesn't work on our platform at all.
I tried to fix this in libvirt which it is not acceptable because
libvirt only considers to get default setting from QEMU.
Maybe I need to cc openstack mailing list, if it is one solution to
add one option for machine types it supports.
Any suggestion is appreciated.
Thanks. :)
--Li
11 years, 6 months
[libvirt] [PATCH 0/3 v4] add 'sharePolicy' attribute for qemu vnc sharing policy
by Guannan Ren
v3->v4
add missing .args, .xml files
(I raw it in git Untracked files this morning and
thought about it for a while, then git-cleaned them...)
rebase work.
v2->v3
rebase work.
v1->v2:
changed attribute name from 'policy' to 'sharePolicy'
renamed caps flag name: QEMU_CAPS_VNC_SHARE_POLICY
fixed issues pointed out in v1 review
have to keep hard-coded version probe after checking qemu -help and qmp command.
As there were some vnc patches recently, I chose do rebase work a little later.
These patches try to add a new attribute 'sharePolicy' to element graphics of
vnc type. This attribute has three values:
allow-exclusive,force-shared and ignore.
11 years, 6 months
[libvirt] [PATCH] vbox: fix VIR_STRDUP value check
by Ján Tomko
In my review of 31532ca I missed the fact that VIR_STRDUP
now returns 1 on success, and 0 if the source was NULL.
(This still doesn't add proper OOM error handling.)
---
src/vbox/vbox_tmpl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index eb8ac63..163aeff 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2688,9 +2688,9 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) {
if (hddType == HardDiskType_Immutable)
def->disks[hddNum]->readonly = true;
- if (VIR_STRDUP_QUIET(def->disks[hddNum]->src, hddlocation) == 0 &&
- VIR_STRDUP_QUIET(def->disks[hddNum]->dst, "hdd") == 0)
- hddNum++;
+ ignore_value(VIR_STRDUP(def->disks[hddNum]->src, hddlocation));
+ ignore_value(VIR_STRDUP(def->disks[hddNum]->dst, "hdd"));
+ hddNum++;
VBOX_UTF8_FREE(hddlocation);
VBOX_UTF16_FREE(hddlocationUtf16);
@@ -7507,7 +7507,7 @@ static int vboxConnectListNetworks(virConnectPtr conn, char **const names, int n
VBOX_UTF16_TO_UTF8(nameUtf16, &nameUtf8);
VIR_DEBUG("nnames[%d]: %s", ret, nameUtf8);
- if (VIR_STRDUP(names[ret], nameUtf8) == 0)
+ if (VIR_STRDUP(names[ret], nameUtf8) >= 0)
ret++;
VBOX_UTF8_FREE(nameUtf8);
@@ -7585,7 +7585,7 @@ static int vboxConnectListDefinedNetworks(virConnectPtr conn, char **const names
VBOX_UTF16_TO_UTF8(nameUtf16, &nameUtf8);
VIR_DEBUG("nnames[%d]: %s", ret, nameUtf8);
- if (VIR_STRDUP(names[ret], nameUtf8) == 0)
+ if (VIR_STRDUP(names[ret], nameUtf8) >= 0)
ret++;
VBOX_UTF8_FREE(nameUtf8);
@@ -8087,7 +8087,7 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network,
networkInterface->vtbl->GetInterfaceType(networkInterface, &interfaceType);
if (interfaceType == HostNetworkInterfaceType_HostOnly) {
- if (VIR_STRDUP(def->name, network->name) == 0) {
+ if (VIR_STRDUP(def->name, network->name) >= 0) {
PRUnichar *networkNameUtf16 = NULL;
IDHCPServer *dhcpServer = NULL;
vboxIID vboxnet0IID = VBOX_IID_INITIALIZER;
--
1.8.1.5
11 years, 6 months
[libvirt] [PATCH 00/31] Forbid whitespace before ";"
by Osier Yang
Inspired by [1] from Daniel, when I tried to add the syntax-check
rule, it detected the various places which use the whitespace before
";". So before adding the syntax-check rule, I cleaned up them first
by a simple Bash script:
\#!/bin/bash
for dir in $dirs; do
files=$(find $dir -type f -name "*.[ch]")
for file in $files; do
sed -r -i -e "/^ \s+;/!s/\s+;/;/g" $file
done
git add $files
git commit -m "$1: Remove the whitespace before ';'"
done
So it's rather mechanically, except I need to change a few places of the
generated patch.
[1] https://www.redhat.com/archives/libvir-list/2013-May/msg01397.html
Osier Yang (31):
src/network: Remove the whitespace before ';'
src/libxl: Remove the whitespace before ';'
src/conf: Remove the whitespace before ';'
src/test: Remove the whitespace before ';'
src/vbox: Remove the whitespace before ';'
src/xenxs: Remove the whitespace before ';'
src/nwfilter: Remove the whitespace before ';'
src/phyp: Remove the whitespace before ';'
src/node_device: Remove the whitespace before ';'
src/openvz: Remove the whitespace before ';'
src/uml: Remove the whitespace before ';'
src/parallels: Remove the whitespace before ';'
src/interface: Remove the whitespace before ';'
src/qemu: Remove the whitespace before ';'
src/vmware: Remove the whitespace before ';'
src/xen: Remove the whitespace before ';'
src/security: Remove the whitespace before ';'
src/storage: Remove the whitespace before ';'
tools: Remove the whitespace before ";"
daemon: Remove the whitespace before ";"
tests/: Remove the whitespace before ";"
src/utils: Remove the whitespace before ";"
src/rpc: Remove the whitespace before ";"
src/remote: Remove the whitespace before ";"
src/lxc: Remove the whitespace before ";"
examples: Remove the whitespace before ';'
python: Remove the whitespace before ";"
src/locking: Remove the whitespace before ";"
src/*.[ch]: Remove the whitespace before ";"
nwfitler: Change the comment style
syntax-check: Add the rule to forbid whitespace before ";"
build-aux/bracket-spacing.pl | 18 +++
daemon/libvirtd-config.c | 2 +-
daemon/remote.c | 12 +-
examples/domain-events/events-c/event-test.c | 2 +-
examples/openauth/openauth.c | 4 +-
python/libvirt-lxc-override.c | 4 +-
python/libvirt-override.c | 16 +-
src/conf/capabilities.c | 50 +++---
src/conf/cpu_conf.c | 14 +-
src/conf/domain_audit.c | 10 +-
src/conf/domain_conf.c | 230 +++++++++++++--------------
src/conf/domain_event.c | 32 ++--
src/conf/interface_conf.c | 8 +-
src/conf/network_conf.c | 28 ++--
src/conf/node_device_conf.c | 12 +-
src/conf/nwfilter_conf.c | 8 +-
src/conf/storage_conf.c | 8 +-
src/interface/interface_backend_udev.c | 2 +-
src/libvirt-lxc.c | 2 +-
src/libvirt.c | 10 +-
src/libxl/libxl_conf.c | 4 +-
src/libxl/libxl_driver.c | 2 +-
src/locking/domain_lock.c | 4 +-
src/locking/lock_daemon.c | 4 +-
src/locking/lock_driver_lockd.c | 12 +-
src/locking/lock_driver_sanlock.c | 6 +-
src/locking/lock_manager.c | 2 +-
src/lxc/lxc_cgroup.c | 4 +-
src/lxc/lxc_container.c | 24 +--
src/lxc/lxc_controller.c | 28 ++--
src/lxc/lxc_driver.c | 4 +-
src/lxc/lxc_hostdev.c | 4 +-
src/lxc/lxc_process.c | 18 +--
src/network/bridge_driver.c | 22 +--
src/node_device/node_device_udev.c | 2 +-
src/nodeinfo.c | 18 +--
src/nwfilter/nwfilter_dhcpsnoop.c | 10 +-
src/nwfilter/nwfilter_driver.c | 6 +-
src/openvz/openvz_driver.c | 6 +-
src/parallels/parallels_network.c | 12 +-
src/phyp/phyp_driver.c | 6 +-
src/qemu/qemu_agent.c | 4 +-
src/qemu/qemu_capabilities.c | 32 ++--
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 170 ++++++++++----------
src/qemu/qemu_conf.c | 4 +-
src/qemu/qemu_domain.c | 12 +-
src/qemu/qemu_driver.c | 30 ++--
src/qemu/qemu_hostdev.c | 8 +-
src/qemu/qemu_hotplug.c | 14 +-
src/qemu/qemu_migration.c | 6 +-
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_monitor_json.c | 34 ++--
src/qemu/qemu_monitor_text.c | 2 +-
src/qemu/qemu_process.c | 44 ++---
src/remote/remote_driver.c | 24 +--
src/rpc/virnetclient.c | 12 +-
src/rpc/virnetclientprogram.c | 12 +-
src/rpc/virnetmessage.c | 6 +-
src/rpc/virnetserver.c | 26 +--
src/rpc/virnetserverclient.c | 4 +-
src/rpc/virnetserverprogram.c | 2 +-
src/rpc/virnetserverservice.c | 14 +-
src/rpc/virnetsocket.c | 2 +-
src/rpc/virnettlscontext.c | 2 +-
src/security/security_dac.c | 8 +-
src/security/security_driver.c | 2 +-
src/security/security_selinux.c | 8 +-
src/security/virt-aa-helper.c | 4 +-
src/storage/storage_backend.c | 14 +-
src/storage/storage_backend_disk.c | 2 +-
src/storage/storage_backend_iscsi.c | 10 +-
src/storage/storage_backend_logical.c | 6 +-
src/storage/storage_driver.c | 26 +--
src/test/test_driver.c | 80 +++++-----
src/uml/uml_conf.c | 12 +-
src/uml/uml_driver.c | 14 +-
src/util/virarch.c | 2 +-
src/util/virauth.c | 2 +-
src/util/vircgroup.c | 38 ++---
src/util/vircommand.c | 12 +-
src/util/vireventpoll.c | 22 +--
src/util/virhash.c | 6 +-
src/util/viridentity.c | 4 +-
src/util/virjson.c | 16 +-
src/util/virlockspace.c | 10 +-
src/util/virportallocator.c | 2 +-
src/util/virprocess.c | 14 +-
src/util/virstoragefile.c | 4 +-
src/util/virstring.c | 2 +-
src/util/virthreadwin32.c | 4 +-
src/util/viruri.c | 2 +-
src/util/virutil.c | 2 +-
src/vbox/vbox_tmpl.c | 2 +-
src/vmware/vmware_conf.c | 2 +-
src/vmware/vmware_driver.c | 2 +-
src/xen/xen_driver.c | 6 +-
src/xen/xen_driver.h | 2 +-
src/xen/xen_hypervisor.c | 4 +-
src/xen/xen_inotify.c | 4 +-
src/xen/xm_internal.c | 4 +-
src/xen/xs_internal.c | 12 +-
src/xenxs/xen_sxpr.c | 20 +--
src/xenxs/xen_xm.c | 16 +-
tests/commandhelper.c | 6 +-
tests/eventtest.c | 18 +--
tests/fdstreamtest.c | 14 +-
tests/libvirtdconftest.c | 2 +-
tests/nodeinfotest.c | 2 +-
tests/qemuhelptest.c | 2 +-
tests/qemumonitortestutils.c | 2 +-
tests/qemuxml2argvtest.c | 4 +-
tests/securityselinuxlabeltest.c | 12 +-
tests/ssh.c | 4 +-
tests/testutils.c | 16 +-
tests/vircgrouptest.c | 2 +-
tests/virnetsockettest.c | 10 +-
tests/viruritest.c | 2 +-
tools/virsh-domain.c | 6 +-
tools/virsh-nodedev.c | 6 +-
tools/virsh-nwfilter.c | 2 +-
tools/virsh-secret.c | 2 +-
tools/virsh.c | 4 +-
123 files changed, 838 insertions(+), 820 deletions(-)
--
1.8.1.4
11 years, 6 months