[libvirt] [PATCH] LXC: trivially support flag VIR_DRV_FEATURE_TYPED_PARAM_STRING
by Chen Hanxiao
fix:
virsh -c lxc:/// memtune DOMAIN
error: Unable to get number of memory parameters
error: unsupported flags (0x4) in function lxcDomainGetMemoryParameters
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_driver.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 06f3e18..6b170fe 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -895,7 +895,11 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
size_t i;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
- VIR_DOMAIN_AFFECT_CONFIG, -1);
+ VIR_DOMAIN_AFFECT_CONFIG,
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ /* We don't return strings, and thus trivially support this flag. */
+ flags &= ~VIR_TYPED_PARAM_STRING_OKAY;
if (!(vm = lxcDomObjFromDomain(dom)))
goto cleanup;
--
1.9.0
10 years, 5 months
[libvirt] [PATCH] cmdFreepages: initialize @tmp
by Michal Privoznik
In the 404bac14 the @tmp variable was introduced. It's purpose is to
avoid typecasting when parsing --pagesize argument. However, if the
argument is not presented, tmp may be used uninitialized resulting in
bogus virNodeGetFreePages() API call:
virsh freepages --cellno 2
error: Failed to open file '/sys/devices/system/node/node2/hugepages/hugepages-4294967295kB/free_hugepages': No such file or directory
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virsh-host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-host.c b/tools/virsh-host.c
index 13d4c5c..734f1a8 100644
--- a/tools/virsh-host.c
+++ b/tools/virsh-host.c
@@ -229,7 +229,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd)
bool ret = false;
unsigned int npages;
unsigned int *pagesize = NULL;
- unsigned long long tmp;
+ unsigned long long tmp = 0;
int cell;
unsigned long long *counts = NULL;
size_t i, j;
--
1.8.5.5
10 years, 5 months
[libvirt] [PATCH v3 0/5] Next round of active commit support
by Eric Blake
Browseable at:
http://repo.or.cz/w/libvirt/ericb.git/shortlog/refs/heads/gluster
or git checkout git://repo.or.cz/libvirt/ericb.git gluster
Resolves some of the review comments, and in particular FINALLY
turns on capability probing. However, I can't push this to libvirt
until Jeff's patch actually makes it into qemu.git:
https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg04060.html
and still lacking cleanup of the persistent XML after a pivot
Eric Blake (5):
blockjob: allow omitted arguments to QMP block-commit
blockjob: turn on qemu capability bit for active commit
virsh: expose new active commit controls
blockcommit: track job type in xml
blockcommit: turn on active commit
docs/formatdomain.html.in | 20 +++----
docs/schemas/domaincommon.rng | 13 +++++
src/conf/domain_conf.c | 33 +++++++++++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 7 +++
src/qemu/qemu_capabilities.h | 3 +-
src/qemu/qemu_driver.c | 59 +++++++++++++++-----
src/qemu/qemu_monitor.c | 2 +-
src/qemu/qemu_monitor.h | 3 +-
src/qemu/qemu_monitor_json.c | 20 ++++++-
src/qemu/qemu_monitor_json.h | 3 +-
src/qemu/qemu_process.c | 18 ++++---
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 62 ++++++++++++----------
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 62 ++++++++++++----------
tests/qemumonitorjsontest.c | 49 +++++++++++++++++
.../qemuxml2argv-disk-active-commit.xml | 37 +++++++++++++
.../qemuxml2argvdata/qemuxml2argv-disk-mirror.xml | 4 +-
.../qemuxml2xmlout-disk-mirror-old.xml | 4 +-
tests/qemuxml2xmltest.c | 1 +
tools/virsh-domain.c | 56 ++++++++++++++++---
tools/virsh.pod | 32 +++++++----
24 files changed, 484 insertions(+), 191 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml
--
1.9.3
10 years, 5 months
[libvirt] Errors from unprivileged libvirtd at startup
by Daniel P. Berrange
Current libvirt git really spews errors to the console at startup when
run unprivileged
$ ./daemon/libvirtd
2014-06-23 16:55:27.806+0000: 5207: info : libvirt version: 1.2.6
2014-06-23 16:55:27.806+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:00.0/config': Permission denied
2014-06-23 16:55:27.807+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:02.0/config': Permission denied
2014-06-23 16:55:27.808+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:14.0/config': Permission denied
2014-06-23 16:55:27.810+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:16.0/config': Permission denied
2014-06-23 16:55:27.810+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:19.0/config': Permission denied
2014-06-23 16:55:27.811+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1a.0/config': Permission denied
2014-06-23 16:55:27.815+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1b.0/config': Permission denied
2014-06-23 16:55:27.817+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1c.0/config': Permission denied
2014-06-23 16:55:27.824+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:02:00.0/config': Permission denied
2014-06-23 16:55:27.825+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1c.1/config': Permission denied
2014-06-23 16:55:27.826+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:03:00.0/config': Permission denied
2014-06-23 16:55:27.827+0000: 5207: error : virFileReadAll:1297 : Failed to read file '/sys/class/net/wlp3s0/speed': Invalid argument
2014-06-23 16:55:27.828+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1c.2/config': Permission denied
2014-06-23 16:55:27.828+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1d.0/config': Permission denied
2014-06-23 16:55:27.829+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1f.0/config': Permission denied
2014-06-23 16:55:27.829+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1f.2/config': Permission denied
2014-06-23 16:55:27.834+0000: 5207: error : virPCIDeviceConfigOpen:300 : Failed to open config space file '/sys/bus/pci/devices/0000:00:1f.3/config': Permission denied
Whatever is doing this needs to skip itfrom unprivileged daemons.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
10 years, 5 months
[libvirt] [PATCH 0/3] Keeping / Dropping capabilities in lxc containers
by Cédric Bosdonnat
Hi all,
I had a request from some users to allow keeping the mknod capability in containers
even thought that may be a security threat for the container and host. After
discussing it with Dan on IRC, here is a patch series that adds a capabilities XML
element in the features section of the domain configuration. It also allows to drop
capabilities that are normally kept.
Coming with this commit are one for the conversion of LXC configuration to domain XML
for the lxc.cap.drop entry, and one commit to extend the documentation.
There is one thing I'm not sure how to do best: I had to list all capabilities into an
enum for the XML config, and I had to map those to the kernel CAP_* defines. Any
improvement idea is welcomed ;)
Cédric Bosdonnat (3):
lxc: allow to keep or drop capabilities
lxc domain from xml: convert lxc.cap.drop
lxc: update doc to mention features/capabilities/* domain
configuration
docs/drvlxc.html.in | 27 +++
docs/schemas/domaincommon.rng | 196 +++++++++++++++++++++
src/conf/domain_conf.c | 93 +++++++++-
src/conf/domain_conf.h | 47 +++++
src/libvirt_private.syms | 1 +
src/lxc/lxc_cgroup.c | 5 +
src/lxc/lxc_container.c | 90 ++++++++--
src/lxc/lxc_native.c | 27 +++
tests/domainschemadata/domain-caps-features.xml | 28 +++
tests/lxcconf2xmldata/lxcconf2xml-blkiotune.xml | 39 ++++
tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml | 39 ++++
tests/lxcconf2xmldata/lxcconf2xml-cputune.xml | 39 ++++
tests/lxcconf2xmldata/lxcconf2xml-idmap.xml | 39 ++++
.../lxcconf2xmldata/lxcconf2xml-macvlannetwork.xml | 41 +++++
tests/lxcconf2xmldata/lxcconf2xml-memtune.xml | 39 ++++
tests/lxcconf2xmldata/lxcconf2xml-nonenetwork.xml | 41 +++++
tests/lxcconf2xmldata/lxcconf2xml-nonetwork.xml | 39 ++++
tests/lxcconf2xmldata/lxcconf2xml-physnetwork.xml | 41 +++++
tests/lxcconf2xmldata/lxcconf2xml-simple.xml | 41 +++++
tests/lxcconf2xmldata/lxcconf2xml-vlannetwork.xml | 41 +++++
20 files changed, 935 insertions(+), 18 deletions(-)
create mode 100644 tests/domainschemadata/domain-caps-features.xml
--
1.8.4.5
10 years, 5 months
[libvirt] [PATCH] Fix closedir usage in virNumaGetPages
by Roman Bogorodskiy
virNumaGetPages calls closedir(dir) in cleanup and dir could
be NULL if we jump there from the failed opendir() call.
While it's not harmful on Linux, FreeBSD libc crashes [1], so
make sure that dir is not NULL before calling closedir.
1: http://lists.freebsd.org/pipermail/freebsd-standards/2014-January/002704....
---
src/util/virnuma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index c8e7f40..1048033 100644
--- a/src/util/virnuma.c
+++ b/src/util/virnuma.c
@@ -836,7 +836,8 @@ virNumaGetPages(int node,
VIR_FREE(tmp_free);
VIR_FREE(tmp_avail);
VIR_FREE(tmp_size);
- closedir(dir);
+ if (dir)
+ closedir(dir);
VIR_FREE(path);
return ret;
}
--
1.9.0
10 years, 5 months
[libvirt] [PATCH 0/3] Improve pkg-config files
by Daniel P. Berrange
This is a small set of fixes and improvements to the
pkg-config files, ultimately allowing external apps
to build against libvirt source tree
Daniel P. Berrange (3):
Don't include @LIBS@ in libvirt.pc.in file
Add pkg-config files for libvirt-qemu & libvirt-lxc
Add pkg-config files to allow deps to build against source tree
.gitignore | 3 ++-
Makefile.am | 4 +++-
configure.ac | 8 +++++++-
libvirt-lxc.pc.in | 14 ++++++++++++++
libvirt-qemu.pc.in | 14 ++++++++++++++
libvirt.pc.in | 5 ++++-
libvirt.spec.in | 15 ++++++++++++---
mingw-libvirt.spec.in | 2 ++
src/Makefile.am | 8 +++++++-
src/libvirt-lxc.pc.in | 18 ++++++++++++++++++
src/libvirt-qemu.pc.in | 18 ++++++++++++++++++
src/libvirt.pc.in | 23 +++++++++++++++++++++++
12 files changed, 124 insertions(+), 8 deletions(-)
create mode 100644 libvirt-lxc.pc.in
create mode 100644 libvirt-qemu.pc.in
create mode 100644 src/libvirt-lxc.pc.in
create mode 100644 src/libvirt-qemu.pc.in
create mode 100644 src/libvirt.pc.in
--
1.9.3
10 years, 5 months
[libvirt] Build failed in Jenkins: libvirt-syntax-check #2398
by Jenkins CI
See <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/2398/>
------------------------------------------
Started by upstream project "libvirt-build" build number 2706
Building on master in workspace <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/>
[workspace] $ /bin/sh -xe /tmp/hudson5640577394465354092.sh
+ make syntax-check
GEN bracket-spacing-check
GFDL_version
0.51 GFDL_version
TAB_in_indentation
0.35 TAB_in_indentation
Wundef_boolean
0.19 Wundef_boolean
avoid_attribute_unused_in_header
0.25 avoid_attribute_unused_in_header
avoid_ctype_macros
0.63 avoid_ctype_macros
avoid_if_before_free
6.29 avoid_if_before_free
avoid_strcase
0.70 avoid_strcase
avoid_write
0.32 avoid_write
bindtextdomain
0.26 bindtextdomain
cast_of_argument_to_free
0.55 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.71 cast_of_x_alloc_return_value
changelog
0.25 changelog
const_long_option
0.48 const_long_option
copyright_check
0.60 copyright_check
copyright_format
1.39 copyright_format
copyright_usage
1.52 copyright_usage
correct_id_types
0.60 correct_id_types
curly_braces_style
0.80 curly_braces_style
error_message_period
0.43 error_message_period
error_message_warn_fatal
0.43 error_message_warn_fatal
flags_debug
0.98 flags_debug
flags_usage
1.04 flags_usage
forbid_const_pointer_typedef
1.06 forbid_const_pointer_typedef
forbid_manual_xml_indent
0.52 forbid_manual_xml_indent
libvirt_unmarked_diagnostics
1.58 libvirt_unmarked_diagnostics
m4_quote_check
0.23 m4_quote_check
makefile_TAB_only_indentation
0.23 makefile_TAB_only_indentation
makefile_at_at_check
0.18 makefile_at_at_check
makefile_conditionals
tests/Makefile.am:293:endif
maint.mk: match "if FOO" with "endif FOO" in Makefiles
make: *** [sc_makefile_conditionals] Error 1
Build step 'Execute shell' marked build as failure
10 years, 5 months
[libvirt] [PATCH 0/2] util: numa: Fix few issues with hugepage code
by Peter Krempa
Peter Krempa (2):
util: numa: Catch readdir errors in virNumaGetPages
util: numa: Stub out hugepage code on non-Linux platforms
src/util/virnuma.c | 52 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 9 deletions(-)
--
1.9.3
10 years, 5 months