[libvirt] [libvirt-glib] spec: Move .vapi files to -devel RPMs
by Christophe Fergeau
.vapi files are only needed when building vala programs using
libvirt-glib, so they belong to the -devel RPMs, not to the non-devel
RPMs which only hold files needed at runtime.
---
libvirt-glib.spec.in | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/libvirt-glib.spec.in b/libvirt-glib.spec.in
index f467767..202e624 100644
--- a/libvirt-glib.spec.in
+++ b/libvirt-glib.spec.in
@@ -162,28 +162,18 @@ rm -rf $RPM_BUILD_ROOT
%if %{with_introspection}
%{_libdir}/girepository-1.0/LibvirtGLib-1.0.typelib
%endif
-%if %{with_vala}
-%{_datadir}/vala/vapi/libvirt-glib-1.0.vapi
-%endif
%files -n libvirt-gconfig
%{_libdir}/libvirt-gconfig-1.0.so.*
%if %{with_introspection}
%{_libdir}/girepository-1.0/LibvirtGConfig-1.0.typelib
%endif
-%if %{with_vala}
-%{_datadir}/vala/vapi/libvirt-gconfig-1.0.vapi
-%endif
%files -n libvirt-gobject
%{_libdir}/libvirt-gobject-1.0.so.*
%if %{with_introspection}
%{_libdir}/girepository-1.0/LibvirtGObject-1.0.typelib
%endif
-%if %{with_vala}
-%{_datadir}/vala/vapi/libvirt-gobject-1.0.deps
-%{_datadir}/vala/vapi/libvirt-gobject-1.0.vapi
-%endif
%files devel
%defattr(-,root,root,-)
@@ -198,6 +188,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gir-1.0/LibvirtGLib-1.0.gir
%endif
%{_datadir}/gtk-doc/html/Libvirt-glib
+%if %{with_vala}
+%{_datadir}/vala/vapi/libvirt-glib-1.0.vapi
+%endif
%files -n libvirt-gconfig-devel
%defattr(-,root,root,-)
@@ -212,6 +205,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gir-1.0/LibvirtGConfig-1.0.gir
%endif
%{_datadir}/gtk-doc/html/Libvirt-gconfig
+%if %{with_vala}
+%{_datadir}/vala/vapi/libvirt-gconfig-1.0.vapi
+%endif
%files -n libvirt-gobject-devel
%defattr(-,root,root,-)
@@ -226,6 +222,10 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gir-1.0/LibvirtGObject-1.0.gir
%endif
%{_datadir}/gtk-doc/html/Libvirt-gobject
+%if %{with_vala}
+%{_datadir}/vala/vapi/libvirt-gobject-1.0.deps
+%{_datadir}/vala/vapi/libvirt-gobject-1.0.vapi
+%endif
%if %{with_python}
%files python
--
1.9.3
10 years, 5 months
[libvirt] [PATCH] build: fix race in vapi/ subdirectory
by Michael Catanzaro
libvirt-gobject-1.0.vapi depends on libvirt-gconfig-1.0.vapi
---
vapi/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index 0154104..af10e98 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -17,7 +17,7 @@ libvirt-glib-1.0.vapi:
$(top_builddir)/libvirt-glib/LibvirtGLib-1.0.gir
--library libvirt-glib-1.0 \
$<
-libvirt-gobject-1.0.vapi:
$(top_builddir)/libvirt-gobject/LibvirtGObject-1.0.gir
libvirt-glib-1.0.vapi
+libvirt-gobject-1.0.vapi:
$(top_builddir)/libvirt-gobject/LibvirtGObject-1.0.gir
libvirt-glib-1.0.vapi libvirt-gconfig-1.0.vapi
$(AM_V_GEN)$(VAPIGEN) \
--vapidir=$(builddir) \
--pkg gobject-2.0 \
--
1.9.3
10 years, 5 months
[libvirt] [PATCH v2 0/4] Testing libvirt XML -> libxl_domain_config conversion
by Daniel P. Berrange
Version 2 of:
https://www.redhat.com/archives/libvir-list/2014-May/msg01102.html
This tests the conversion of libvirt XML to libxl_domain_config
objects by the libvirt libxl driver.
Changed in v2:
- Compare the parsed JSON object model instead of strcmp() on
the string-ified JSON document
- To cope with new additions between Xen 4.3 and 4.4
- Ignore case where actual JSON object has gained new keys.
This copes with fact that '/c_info' gained a new key
called 'pvh' in 4.4
- Ignore case where actual JSON value has changed from 'null'
to a non-'null' value type. This copes with fact that
the element at /b_info/device_model_version changed from
'null' to a specific value by default in 4.4.
- Use libxl_domain_config_to_json instead of libxl_json.h
functions, and disable test if running on Xen version
which lacks this function (eg 4.2)
- Isolate VNC port allocator from host TCP ports so a predictable
VNC port is always in the config.
Daniel P. Berrange (4):
util: Introduce virJSONStringCompare for JSON doc comparisons
util: Allow port allocator to skip bind() check
tests: Add more test suite mock helpers
libxl: Add a test suite for libxl option generator
configure.ac | 2 +
src/libvirt_private.syms | 1 +
src/libxl/libxl_driver.c | 3 +-
src/qemu/qemu_driver.c | 9 +-
src/util/virjson.c | 185 ++++++++++++++++++++++++++++++++++
src/util/virjson.h | 22 +++++
src/util/virportallocator.c | 14 ++-
src/util/virportallocator.h | 7 +-
tests/Makefile.am | 25 ++++-
tests/libxlxml2jsondata/minimal.json | 172 ++++++++++++++++++++++++++++++++
tests/libxlxml2jsondata/minimal.xml | 36 +++++++
tests/libxlxml2jsontest.c | 186 +++++++++++++++++++++++++++++++++++
tests/virfirewalltest.c | 4 +-
tests/virmock.h | 54 +++++++---
tests/virmocklibxl.c | 87 ++++++++++++++++
tests/virportallocatortest.c | 4 +-
tests/virsystemdtest.c | 4 +-
17 files changed, 786 insertions(+), 29 deletions(-)
create mode 100644 tests/libxlxml2jsondata/minimal.json
create mode 100644 tests/libxlxml2jsondata/minimal.xml
create mode 100644 tests/libxlxml2jsontest.c
create mode 100644 tests/virmocklibxl.c
--
1.9.3
10 years, 5 months
[libvirt] [PATCH v2 0/2] Expose distance between host NUMA nodes
by Michal Privoznik
diff to v1:
-slight change in the XML format
-added description to distances value
Michal Privoznik (2):
virnuma: Introduce virNumaGetDistances
virCaps: Expose distance between host NUMA nodes
docs/schemas/capability.rng | 15 +++++++++++
src/conf/capabilities.c | 19 +++++++++++++-
src/conf/capabilities.h | 13 +++++++++-
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 4 +--
src/nodeinfo.c | 61 ++++++++++++++++++++++++++++++++++++++++++---
src/test/test_driver.c | 2 +-
src/util/virnuma.c | 55 ++++++++++++++++++++++++++++++++++++++++
src/util/virnuma.h | 3 +++
src/xen/xend_internal.c | 3 ++-
tests/vircapstest.c | 4 +--
11 files changed, 169 insertions(+), 11 deletions(-)
--
2.0.0
10 years, 5 months
[libvirt] [PATCH] tests: monitor: json: Fix error message when returning json in json
by Peter Krempa
The qemu JSON monitor test allows to test also expected command
arguments. As the error from the monitor simulator is returned as a
simulated qemu error (in JSON) all other JSON contained in the error
message needs to be escaped. This will happen if the monitor command
under test receives a JSON array as an argument.
This will improve the error message from:
libvirt: error : internal error: cannot parse json { "error": { "desc":
"Invalid value of argument 'keys' of command 'send-key': expected 'ble'
got '[{"type":"number","data":43},{"type":"number","data":26},
{"type":"number","data":46},{"type":"number","data":32}]'",
"class": "UnexpectedCommand" } }: lexical error: invalid string in json text.
To:
libvirt: QEMU Driver error : internal error: unable to execute QEMU
command 'send-key': Invalid value of argument 'keys' of command
'send-key': expected 'ble' got '[{"type":"number","data":43},
{"type":"number","data":26},{"type":"number","data":46},
{"type":"number","data":32}]'
This improvement will not have any effect on tests executing as
expected, but it will help test development.
---
tests/qemumonitortestutils.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c
index 30c2153..8155a69 100644
--- a/tests/qemumonitortestutils.c
+++ b/tests/qemumonitortestutils.c
@@ -145,6 +145,12 @@ qemuMonitorReportError(qemuMonitorTestPtr test, const char *errmsg, ...)
goto cleanup;
if (test->agent || test->json) {
+ char *tmp = msg;
+ msg = qemuMonitorEscapeArg(tmp);
+ VIR_FREE(tmp);
+ if (!msg)
+ goto cleanup;
+
if (virAsprintf(&jsonmsg, "{ \"error\": "
" { \"desc\": \"%s\", "
" \"class\": \"UnexpectedCommand\" } }",
--
1.9.3
10 years, 5 months
Re: [libvirt] [PATCH 1/2] Parallels: add domainGetVcpus().
by Daniel P. Berrange
Re-adding the mailing list - please don't drop the list CC when
replying.
On Mon, Jun 02, 2014 at 09:22:35PM +0400, aburluka wrote:
> >Hmm, what error did you get from openstack ? The two uses of the
> >'dom.vcpus' function are both wrapped in try/except so that it is
> >considered non-fatal if libvirt doesn't provide this.
> I have caught this error on Havana release. I would try to reproduce
> this error, but it will take some short time to test it on Icehouse.
Ok, then I think you should find the lack of this API is non-fatal
in Icehouse / Juno now.
> >Are you talking about container based virt here or full machine
> >based virt ? IIUC Parallels can do both ? With container based
> >virt, does parallels have the concept of 'vcpus' at all ? We
> >don't have that in LXC at least.
> Parallels Cloud Server has that concept in both types of virt.
With the full machine virt does Parallels have a separate
process or thread for each vCPU, and if so can we identify
the PIDs for the vCPUs to let us do proper pCPU<->vCPU
mapping & reporting.
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] Expose distance between host NUMA nodes
by Michal Privoznik
*** BLURB HERE ***
Michal Privoznik (3):
virnuma.c: Fix some comments
virnuma: Introduce virNumaGetDistances
virCaps: Expose distance between host NUMA nodes
docs/schemas/capability.rng | 11 ++++++++
src/conf/capabilities.c | 13 +++++++++-
src/conf/capabilities.h | 13 +++++++++-
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 4 +--
src/nodeinfo.c | 61 ++++++++++++++++++++++++++++++++++++++++++---
src/test/test_driver.c | 2 +-
src/util/virnuma.c | 54 +++++++++++++++++++++++++++++++++++++--
src/util/virnuma.h | 3 +++
src/xen/xend_internal.c | 3 ++-
tests/vircapstest.c | 4 +--
11 files changed, 156 insertions(+), 13 deletions(-)
--
2.0.0
10 years, 5 months
[libvirt] [PATCH] network: bridge: Avoid memory leak from networkBuildDhcpDaemonCommandLine
by Peter Krempa
If the leasehelper_path couldn't be found the code would leak the
freshly constructed command structure. Re-arrange code to avoid the
problem.
Found by coverity, broken by baafe668fa56767c031468ccd5df3e62eaa11370.
---
src/network/bridge_driver.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 51f01fb..4fc4c9a 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1273,15 +1273,14 @@ networkBuildDhcpDaemonCommandLine(virNetworkObjPtr network,
goto cleanup;
}
- cmd = virCommandNew(dnsmasqCapsGetBinaryPath(caps));
- virCommandAddArgFormat(cmd, "--conf-file=%s", configfile);
-
/* This helper is used to create custom leases file for libvirt */
if (!(leaseshelper_path = virFileFindResource("libvirt_leaseshelper",
"src",
LIBEXECDIR)))
goto cleanup;
+ cmd = virCommandNew(dnsmasqCapsGetBinaryPath(caps));
+ virCommandAddArgFormat(cmd, "--conf-file=%s", configfile);
virCommandAddArgFormat(cmd, "--dhcp-script=%s", leaseshelper_path);
*cmdout = cmd;
--
1.9.3
10 years, 5 months
[libvirt] [PATCH] qemu: monitor: Fix type of holdtime argument in qemuMonitorJSONSendKey
by Peter Krempa
qemuMonitorJSONSendKey declares the "holdtime" argument as unsigned int
while the command was constructed in qemuMonitorJSONMakeCommand using
the "P" modifier which took a unsigned long from the variable
arguments which then made it possible to access uninitialized memory.
This broke the qemumonitorjsontest on 32bit fedora 20:
64) qemuMonitorJSONSendKey
... libvirt: QEMU Driver error : internal error: unsupported data type 'W' for arg 'WVSì D$0èwÿÿÃAå' FAILED
Uncovered by upstream commit f744b831c66d9e82453f7a96cab5eddf7570c253.
Additionally add test for the hold-time option.
---
src/qemu/qemu_monitor_json.c | 2 +-
tests/qemumonitorjsontest.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 0c44b11..bedd959 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -3610,7 +3610,7 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon,
cmd = qemuMonitorJSONMakeCommand("send-key",
"a:keys", keys,
- "P:hold-time", holdtime,
+ "p:hold-time", holdtime,
NULL);
if (!cmd)
goto cleanup;
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 47d7481..2099dc8 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -1960,6 +1960,38 @@ testQemuMonitorJSONqemuMonitorJSONSendKey(const void *data)
}
static int
+testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(const void *data)
+{
+ virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
+ int ret = -1;
+ unsigned int keycodes[] = {43, 26, 46, 32};
+
+ if (!test)
+ return -1;
+
+ if (qemuMonitorTestAddItemParams(test, "send-key",
+ "{\"return\":{}}",
+ "hold-time", "31337",
+ "keys", "[{\"type\":\"number\",\"data\":43},"
+ "{\"type\":\"number\",\"data\":26},"
+ "{\"type\":\"number\",\"data\":46},"
+ "{\"type\":\"number\",\"data\":32}]",
+ NULL, NULL) < 0)
+ goto cleanup;
+
+ if (qemuMonitorJSONSendKey(qemuMonitorTestGetMonitor(test),
+ 31337, keycodes,
+ ARRAY_CARDINALITY(keycodes)) < 0)
+ goto cleanup;
+
+ ret = 0;
+ cleanup:
+ qemuMonitorTestFree(test);
+ return ret;
+}
+
+static int
testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *data)
{
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
@@ -2230,6 +2262,7 @@ mymain(void)
DO_TEST(qemuMonitorJSONGetVirtType);
DO_TEST(qemuMonitorJSONSendKey);
DO_TEST(qemuMonitorJSONGetDumpGuestMemoryCapability);
+ DO_TEST(qemuMonitorJSONSendKeyHoldtime);
DO_TEST_CPU_DATA("host");
DO_TEST_CPU_DATA("full");
--
1.9.3
10 years, 5 months