[libvirt] [libvirt-glib] gconfig: Entertain bridge interface devices
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Currently we ignore bridge interface devices from domain XML. This patch
fixes that.
Pushed under trivial rule.
---
libvirt-gconfig/libvirt-gconfig-domain-interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface.c b/libvirt-gconfig/libvirt-gconfig-domain-interface.c
index 2f7be5c..48fc6fd 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface.c
@@ -147,7 +147,7 @@ gvir_config_domain_interface_new_from_tree(GVirConfigXmlDoc *doc,
} else if (g_str_equal(type, "user")) {
gtype = GVIR_CONFIG_TYPE_DOMAIN_INTERFACE_USER;
} else if (g_str_equal(type, "bridge")) {
- goto unimplemented;
+ gtype = GVIR_CONFIG_TYPE_DOMAIN_INTERFACE_BRIDGE;
} else if (g_str_equal(type, "direct")) {
goto unimplemented;
} else if (g_str_equal(type, "server")) {
--
1.8.0.2
11 years, 11 months
[libvirt] [PATCH 0/2] Support PCI passthrough in libxl driver
by Chunyan Liu
This patch series is to add PCI passthrough support to libxenlight driver so that
it can create VM with managed/non-managed host pci device defined.
Chunyan Liu (2):
libxl: add APIs to prepare/release host pci device
libxl: support pci passthrough
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/libxl/libxl_conf.c | 44 ++++
src/libxl/libxl_conf.h | 5 +-
src/libxl/libxl_driver.c | 16 ++
src/libxl/libxl_hostdev.c | 600 +++++++++++++++++++++++++++++++++++++++++++++
src/libxl/libxl_hostdev.h | 44 ++++
7 files changed, 710 insertions(+), 1 deletions(-)
create mode 100644 src/libxl/libxl_hostdev.c
create mode 100644 src/libxl/libxl_hostdev.h
--
1.7.3.4
11 years, 11 months
[libvirt] [PATCH] build: avoid m4_expand for RHEL 5
by Eric Blake
Problem introduced in commit cd699ed.
* m4/virt-lib.m4 (LIBVIRT_CHECK_LIB, LIBVIRT_CHECK_PKG): Set up
direct expansions, since autoconf 2.59 lacked m4_expand.
---
Pushing under the build-breaker rule, once I finish testing.
m4/virt-lib.m4 | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/m4/virt-lib.m4 b/m4/virt-lib.m4
index 771c376..778cd40 100644
--- a/m4/virt-lib.m4
+++ b/m4/virt-lib.m4
@@ -84,16 +84,16 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
- m4_expand(with_var[=no])
+ with_var=no
])
if test "$fail" = "0" && test "x$with_var" != "xno" ; then
AC_CHECK_HEADER([header_name], [
- m4_expand(with_var[=yes])
+ with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
- m4_expand(with_var[=no])
+ with_var=no
])
fi
fi
@@ -218,20 +218,20 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
- m4_expand(with_var[=no])
+ with_var=no
])
])
if test "$fail" = "0" && test "x$with_var" != "xno" ; then
AC_CHECK_HEADER([header_name], [
- m4_expand(with_var[=yes])
+ with_var=yes
],[
AC_CHECK_HEADER([header_name_alt], [
- m4_expand(with_var[=yes])
+ with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
- m4_expand(with_var[=no])
+ with_var=no
])
])
fi
@@ -326,12 +326,12 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[
fail=0
if test "x$with_var" != "xno" ; then
PKG_CHECK_MODULES(check_name, pc_name[ >= ]pc_version, [
- m4_expand(with_var[=yes])
+ with_var=yes
],[
if test "x$with_var" != "xcheck"; then
fail=1
fi
- m4_expand(with_var[=no])
+ with_var=no
])
fi
--
1.8.0.2
11 years, 11 months
[libvirt] [PATCH 0/9 v2] Refactor the configure.ac to reduce duplication
by Daniel P. Berrange
This is an update to
https://www.redhat.com/archives/libvir-list/2012-September/msg01443.html
Aside from the rebase, the main changes are all in the first patch,
where I believe I addresses all Erics feedback with one exception.
The exception was about the suggestion to support action-if-found,
action-if-not-found, instead of the 2nd variant of macro. This is
not actually possible, since the 2nd variant is not equivalent to
a pair of calls to the 1st variant.
To avoid flooding the list I've reduced this to just the first
9 patches. If these are approved there are another 30 patches
to follow doing more conversions :-)
11 years, 11 months
[libvirt] [PATCH] docs: add some more hacking tips
by Eric Blake
Based on a suggestion by John Ferlan:
https://www.redhat.com/archives/libvir-list/2013-January/msg00158.html
* docs/hacking.html.in: Add some commit message instructions.
Mention the ./run script.
* HACKING: Regenerate.
---
I don't know how to make docs/hacking2.xsl delay the line wrapping
until after the '(3) ' prefix due to the <li> is inserted; as a
result, there is a line longer than 80 columns. Suggestions on
improving the template are welcome.
HACKING | 26 ++++++++++++++++++++++----
docs/hacking.html.in | 19 ++++++++++++++++++-
2 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/HACKING b/HACKING
index 0ee988a..1b4dea3 100644
--- a/HACKING
+++ b/HACKING
@@ -58,7 +58,19 @@ though).
-(3) Split large changes into a series of smaller patches, self-contained if
+(3) In your commit message, make the summary line reasonably short (60 characters
+is typical), followed by a blank line, followed by any longer description of
+why your patch makes sense. If the patch fixes a regression, and you know what
+commit introduced the problem, mentioning that is useful. If the patch
+resolves a bugzilla report, mentioning the URL of the bug number is useful;
+but also summarize the issue rather than making all readers follow the link.
+You can use 'git shortlog -30' to get an idea of typical summary lines.
+Libvirt does not currently attach any meaning to Signed-off-by: lines, so it
+is up to you if you want to include or omit them in the commit message.
+
+
+
+(4) Split large changes into a series of smaller patches, self-contained if
possible, with an explanation of each patch and an explanation of how the
sequence of patches fits together. Moreover, please keep in mind that it's
required to be able to compile cleanly (*including* "make check" and "make
@@ -69,10 +81,10 @@ things).
-(4) Make sure your patches apply against libvirt GIT. Developers only follow GIT
+(5) Make sure your patches apply against libvirt GIT. Developers only follow GIT
and don't care much about released versions.
-(5) Run the automated tests on your code before submitting any changes. In
+(6) Run the automated tests on your code before submitting any changes. In
particular, configure with compile warnings set to -Werror. This is done
automatically for a git checkout; from a tarball, use:
@@ -97,7 +109,13 @@ Also, individual tests can be run from inside the "tests/" directory, like:
./qemuxml2xmltest
-(6) Update tests and/or documentation, particularly if you are adding a new
+There is also a "./run" script at the top level, to make it easier to run
+uninstalled programs, as well as to wrap invocations of various tests under
+gdb or valgrind.
+
+
+
+(7) Update tests and/or documentation, particularly if you are adding a new
feature or changing the output of a program.
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index 40acdbb..17136f0 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -59,6 +59,21 @@
version if needed though).</p>
</li>
+ <li><p>In your commit message, make the summary line reasonably
+ short (60 characters is typical), followed by a blank line,
+ followed by any longer description of why your patch makes
+ sense. If the patch fixes a regression, and you know what
+ commit introduced the problem, mentioning that is useful.
+ If the patch resolves a bugzilla report, mentioning the URL
+ of the bug number is useful; but also summarize the issue
+ rather than making all readers follow the link. You can use
+ 'git shortlog -30' to get an idea of typical summary lines.
+ Libvirt does not currently attach any meaning to
+ Signed-off-by: lines, so it is up to you if you want to
+ include or omit them in the commit message.
+ </p>
+ </li>
+
<li><p>Split large changes into a series of smaller patches,
self-contained if possible, with an explanation of each patch
and an explanation of how the sequence of patches fits
@@ -110,7 +125,9 @@
<pre>
./qemuxml2xmltest
</pre>
-
+ <p>There is also a <code>./run</code> script at the top level,
+ to make it easier to run uninstalled programs, as well as to
+ wrap invocations of various tests under gdb or valgrind.</p>
</li>
<li>Update tests and/or documentation, particularly if you are adding
a new feature or changing the output of a program.</li>
--
1.8.0.2
11 years, 11 months
[libvirt] [PATCH] build: fix incomplete WITH_SASL conversion
by Eric Blake
Commit 321a7d53 missed a spot.
* src/rpc/virnetsocket.c (virNetSocketPreExecRestart): Use right
conditional.
---
Pushing under the build-breaker rule.
src/rpc/virnetsocket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index 549aabe..00c6121 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1,7 +1,7 @@
/*
* virnetsocket.c: generic network socket handling
*
- * Copyright (C) 2006-2012 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -943,7 +943,7 @@ virJSONValuePtr virNetSocketPreExecRestart(virNetSocketPtr sock)
virMutexLock(&sock->lock);
-#if HAVE_SASL
+#if WITH_SASL
if (sock->saslSession) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Unable to save socket state when SASL session is active"));
--
1.8.0.2
11 years, 11 months
[libvirt] [libvirt-glib] gobject: API to open read-only connection to libvirt
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gobject/libvirt-gobject-connection.c | 99 +++++++++++++++++++++++++---
libvirt-gobject/libvirt-gobject-connection.h | 10 +++
libvirt-gobject/libvirt-gobject.sym | 7 ++
3 files changed, 107 insertions(+), 9 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index 3157a66..558ed2a 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -407,14 +407,10 @@ static int domain_event_cb(virConnectPtr conn G_GNUC_UNUSED,
return 0;
}
-/**
- * gvir_connection_open:
- * @conn: a #GVirConnection
- * @cancellable: (allow-none)(transfer none): cancellation object
- */
-gboolean gvir_connection_open(GVirConnection *conn,
- GCancellable *cancellable,
- GError **err)
+static gboolean _gvir_connection_open(GVirConnection *conn,
+ gboolean read_only,
+ GCancellable *cancellable,
+ GError **err)
{
GVirConnectionPrivate *priv;
@@ -438,7 +434,11 @@ gboolean gvir_connection_open(GVirConnection *conn,
return FALSE;
}
- if (!(priv->conn = virConnectOpen(priv->uri))) {
+ if (read_only)
+ priv->conn = virConnectOpenReadOnly(priv->uri);
+ else
+ priv->conn = virConnectOpen(priv->uri);
+ if (!priv->conn) {
gvir_set_error(err, GVIR_CONNECTION_ERROR,
0,
"Unable to open %s",
@@ -472,6 +472,24 @@ gboolean gvir_connection_open(GVirConnection *conn,
return TRUE;
}
+/**
+ * gvir_connection_open:
+ * @conn: a #GVirConnection
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ */
+gboolean gvir_connection_open(GVirConnection *conn,
+ GCancellable *cancellable,
+ GError **err)
+{
+ return _gvir_connection_open(conn, FALSE, cancellable, err);
+}
+
+gboolean gvir_connection_open_read_only(GVirConnection *conn,
+ GCancellable *cancellable,
+ GError **err)
+{
+ return _gvir_connection_open(conn, TRUE, cancellable, err);
+}
static void
gvir_connection_open_helper(GSimpleAsyncResult *res,
@@ -537,6 +555,69 @@ gboolean gvir_connection_open_finish(GVirConnection *conn,
return TRUE;
}
+static void
+gvir_connection_open_read_only_helper(GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable)
+{
+ GVirConnection *conn = GVIR_CONNECTION(object);
+ GError *err = NULL;
+
+ if (!gvir_connection_open_read_only(conn, cancellable, &err)) {
+ g_simple_async_result_set_from_error(res, err);
+ g_error_free(err);
+ }
+}
+
+
+/**
+ * gvir_connection_open_read_only_async:
+ * @conn: a #GVirConnection
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ */
+void gvir_connection_open_read_only_async(GVirConnection *conn,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+
+ g_return_if_fail(GVIR_IS_CONNECTION(conn));
+ g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+
+ res = g_simple_async_result_new(G_OBJECT(conn),
+ callback,
+ user_data,
+ gvir_connection_open_read_only_async);
+ g_simple_async_result_run_in_thread(res,
+ gvir_connection_open_read_only_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+ g_object_unref(res);
+}
+
+
+/**
+ * gvir_connection_open_read_only_finish:
+ * @conn: a #GVirConnection
+ * @result: (transfer none): async method result
+ */
+gboolean gvir_connection_open_read_only_finish(GVirConnection *conn,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_CONNECTION(conn), FALSE);
+ g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(conn),
+ gvir_connection_open_read_only_async),
+ FALSE);
+
+ if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
+ return FALSE;
+
+ return TRUE;
+}
gboolean gvir_connection_is_open(GVirConnection *conn)
{
diff --git a/libvirt-gobject/libvirt-gobject-connection.h b/libvirt-gobject/libvirt-gobject-connection.h
index f91ca05..d2b0a9f 100644
--- a/libvirt-gobject/libvirt-gobject-connection.h
+++ b/libvirt-gobject/libvirt-gobject-connection.h
@@ -88,6 +88,9 @@ GVirConnection *gvir_connection_new(const char *uri);
gboolean gvir_connection_open(GVirConnection *conn,
GCancellable *cancellable,
GError **err);
+gboolean gvir_connection_open_read_only(GVirConnection *conn,
+ GCancellable *cancellable,
+ GError **err);
void gvir_connection_open_async(GVirConnection *conn,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -95,6 +98,13 @@ void gvir_connection_open_async(GVirConnection *conn,
gboolean gvir_connection_open_finish(GVirConnection *conn,
GAsyncResult *result,
GError **err);
+void gvir_connection_open_read_only_async(GVirConnection *conn,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_connection_open_read_only_finish(GVirConnection *conn,
+ GAsyncResult *result,
+ GError **err);
gboolean gvir_connection_is_open(GVirConnection *conn);
void gvir_connection_close(GVirConnection *conn);
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 8743b88..b02b365 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -224,4 +224,11 @@ LIBVIRT_GOBJECT_0.1.4 {
gvir_storage_pool_undefine_finish;
} LIBVIRT_GOBJECT_0.1.3;
+LIBVIRT_GOBJECT_0.1.5 {
+ global:
+ gvir_connection_open_read_only;
+ gvir_connection_open_read_only_async;
+ gvir_connection_open_read_only_finish;
+} LIBVIRT_GOBJECT_0.1.4;
+
# .... define new API here using predicted next version number ....
--
1.8.0.2
11 years, 11 months
[libvirt] [libvirt-java] git commit: Fix memory leaks for libvirt functions returning newly allocated memory. (3220de)
by Wido den Hollander
Hi,
I just wanted to build the latest libvirt-java master on my Ubuntu 12.04
laptop and it failed due to this commit.
The commit message says: "Use JNA's Native.free() method to free memory.
This requires JNA version 3.3.0 or later."
Ubuntu 12.04 comes with JNA 3.2.7-4, so the build fails.
Is there a way to still build and run on Ubuntu 12.04? This is a 5-year
LTS release from Ubuntu so we'll be seeing this around until 2017.
I'm working on the patches I sent last week and got some good feedback.
We (the Apache CloudStack project) rely heavily on libvirt-java for
virtual machine management when using the KVM Hypervisor, so I'd like to
keep the bindings working on Ubuntu 12.04 :)
Thanks,
Wido
11 years, 11 months
[libvirt] [PATCH 0/3] Fix various issues with libvirt networks
by Peter Krempa
This patchset fixes various non-related issues with libvirt networking:
Peter Krempa (3):
network: bridge: Fix regression when defining persistent networks
virsh: Reformat output of virsh net-list
network: Report real error if addition of firewall rules fails
src/network/bridge_driver.c | 10 ++++++++++
tools/virsh-network.c | 7 ++++---
2 files changed, 14 insertions(+), 3 deletions(-)
--
1.8.1
11 years, 11 months
[libvirt] [RFC] Overriding graphics relocation URI
by Jiri Denemark
Hi all.
Graphics relocation URI is currently transmitted within migration cookie
in the form of graphics type, address, port, tlsPort, and certificate
subject. The cookie is generated by target libvirtd and consumed by
source libvirtd which than forwards this data through QEMU to the
graphics client.
In case the target libvirtd is not able to provide the data in a way
usable by the client (e.g., because it needs to use different address),
we need to provide a way to override the graphics URI. We already
support similar thing for migration URI.
So the question is how we can support $SUBJ? The only way I came up with
is to introduce another set of migration APIs (such as
virDomainMigrateToURI3, ...) with an additional graphics URI parameter.
The URI would be formed as
type "://" address ":" port "?tlsPort=" tlsPort "&subject=" cert
with various parts being optional. That would allow us to override any
part of the graphics cookie we need.
However, I don't like the addition of another set of migration APIs and
I'd be glad to hear better ideas :-)
Jirka
11 years, 11 months