[libvirt] [PATCH 0/2] nodedev: fix virtual_functions element
by Laine Stump
Moshe Levi pointed out yesterday in an email to libvir-list that there
was no way to tell from the node device API that a PCI was capable of
having SRIOV virtual functions (VFs) if it was currently setup to not
have any:
https://www.redhat.com/archives/libvir-list/2015-November/msg00894.html
These two patches modify the node device XML in two ways:
1) if the device has a file called sriov_totalvfs, the value contained
in that file will be included in the capabilities element as the
attribute "maxCount".
2) in this case, even if there are currently no VFs active/visible for
the device, the virtual_functions capability will still be reported.
Laine Stump (2):
conf: support reporting maxCount attribute for virtual_functions cap
nodedev: report maxCount for virtual_functions capability
docs/formatnode.html.in | 11 ++++++++++-
src/conf/node_device_conf.c | 32 +++++++++++++++++++------------
src/conf/node_device_conf.h | 1 +
src/network/bridge_driver.c | 5 +++--
src/node_device/node_device_linux_sysfs.c | 7 +++++--
src/util/virnetdev.c | 9 ++++++---
src/util/virnetdev.h | 5 +++--
src/util/virpci.c | 30 +++++++++++++++++++++++++----
src/util/virpci.h | 5 +++--
9 files changed, 77 insertions(+), 28 deletions(-)
--
2.4.3
9 years, 1 month
[libvirt] [PATCH] Post-release version bump to 1.3.0
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
We've dropped support for old QEMU and there was a vote to change version to
1.3.0, let's make it official.
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index f481c50..4b7c9ed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [1.2.22], [libvir-list(a)redhat.com], [], [http://libvirt.org])
+AC_INIT([libvirt], [1.3.0], [libvir-list(a)redhat.com], [], [http://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
--
2.6.3
9 years, 1 month
[libvirt] [PATCH RFC] libxl: use libxl_event_wait to process libxl events
by Jim Fehlig
Prior to this patch, libxl events were delivered to libvirt via
the libxlDomainEventHandler callback registered with libxl.
Documenation in $xensrc/tools/libxl/libxl_event.h states that the
callback "may occur on any thread in which the application calls
libxl". This can result in deadlock since many of the libvirt
callees of libxl hold a lock on the virDomainObj they are working
on. When the callback is invoked, it attempts to find a virDomainObj
corresponding to the domain ID provided by libxl. Searching the
domain obj list results in locking each obj before checking if it is
active, and its ID equals the requested ID. Deadlock is possible
when attempting to lock an obj that is already locked further up
the call stack. Indeed, Max Ustermann recently reported an instance
of this deadlock
https://www.redhat.com/archives/libvir-list/2015-November/msg00130.html
This patch moves processing of libxl events to a thread, where
libxl_event_wait() is used to collect events. This allows processing
libxl events asynchronously in libvirt, avoiding the deadlock.
Reported-by: max ustermann <ustermann78(a)web.de>
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
The only reservations I have about this patch come from comments
about libxl_event_wait in libxl_event.h
Like libxl_event_check but blocks if no suitable events are
available, until some are. Uses libxl_osevent_beforepoll/
_afterpoll so may be inefficient if very many domains are being
handled by a single program.
libvirt does handle "very many domains" :-). But thus far, I haven't
noticed any problems in my testing. The reporter expressed interest
in testing the patch. Positive results from that testing would improve
my confidence, as would an ACK from Ian Jackson.
src/libxl/libxl_domain.c | 130 ++++++++++++++++++++++-------------------------
src/libxl/libxl_domain.h | 16 +-----
src/libxl/libxl_driver.c | 13 ++---
3 files changed, 66 insertions(+), 93 deletions(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 40dcea1..0b8c292 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -380,27 +380,14 @@ virDomainDefParserConfig libxlDomainDefParserConfig = {
.domainPostParseCallback = libxlDomainDefPostParse,
};
-
-struct libxlShutdownThreadInfo
-{
- libxlDriverPrivatePtr driver;
- virDomainObjPtr vm;
- libxl_event *event;
-};
-
-
static void
-libxlDomainShutdownThread(void *opaque)
+libxlDomainShutdownEventHandler(libxlDriverPrivatePtr driver,
+ virDomainObjPtr vm,
+ libxl_event *ev)
{
- struct libxlShutdownThreadInfo *shutdown_info = opaque;
- virDomainObjPtr vm = shutdown_info->vm;
- libxl_event *ev = shutdown_info->event;
- libxlDriverPrivatePtr driver = shutdown_info->driver;
virObjectEventPtr dom_event = NULL;
libxl_shutdown_reason xl_reason = ev->u.domain_shutdown.shutdown_reason;
- libxlDriverConfigPtr cfg;
-
- cfg = libxlDriverConfigGet(driver);
+ libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
goto cleanup;
@@ -501,74 +488,77 @@ libxlDomainShutdownThread(void *opaque)
virObjectUnlock(vm);
if (dom_event)
libxlDomainEventQueue(driver, dom_event);
- libxl_event_free(cfg->ctx, ev);
- VIR_FREE(shutdown_info);
virObjectUnref(cfg);
}
+static int
+libxlDomainXEventsPredicate(const libxl_event *event,
+ ATTRIBUTE_UNUSED void *data)
+{
+ /*
+ * Currently we only handle shutdown event
+ */
+ if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN)
+ return 1;
+
+ return 0;
+}
+
/*
- * Handle previously registered domain event notification from libxenlight.
+ * Process events from libxl using libxl_event_wait.
*/
-void
-libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
+static void
+libxlDomainXEventsProcess(void *opaque)
{
- libxlDriverPrivatePtr driver = data;
+ libxlDriverPrivatePtr driver = opaque;
+ libxl_event *event;
virDomainObjPtr vm = NULL;
- libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason;
- struct libxlShutdownThreadInfo *shutdown_info = NULL;
- virThread thread;
- libxlDriverConfigPtr cfg;
+ libxl_shutdown_reason xl_reason;
+ libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
- if (event->type != LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) {
- VIR_INFO("Unhandled event type %d", event->type);
- goto error;
- }
+ while (1) {
+ event = NULL;
+ libxl_event_wait(cfg->ctx, &event, LIBXL_EVENTMASK_ALL,
+ libxlDomainXEventsPredicate, NULL);
- /*
- * Similar to the xl implementation, ignore SUSPEND. Any actions needed
- * after calling libxl_domain_suspend() are handled by its callers.
- */
- if (xl_reason == LIBXL_SHUTDOWN_REASON_SUSPEND)
- goto error;
+ if (event == NULL) {
+ VIR_INFO("libxl_event_wait returned a NULL event");
+ continue;
+ }
- vm = virDomainObjListFindByID(driver->domains, event->domid);
- if (!vm) {
- VIR_INFO("Received event for unknown domain ID %d", event->domid);
- goto error;
- }
-
- /*
- * Start a thread to handle shutdown. We don't want to be tying up
- * libxl's event machinery by doing a potentially lengthy shutdown.
- */
- if (VIR_ALLOC(shutdown_info) < 0)
- goto error;
-
- shutdown_info->driver = driver;
- shutdown_info->vm = vm;
- shutdown_info->event = (libxl_event *)event;
- if (virThreadCreate(&thread, false, libxlDomainShutdownThread,
- shutdown_info) < 0) {
+ xl_reason = event->u.domain_shutdown.shutdown_reason;
/*
- * Not much we can do on error here except log it.
+ * Similar to the xl implementation, ignore SUSPEND. Any actions needed
+ * after calling libxl_domain_suspend() are handled by its callers.
*/
- VIR_ERROR(_("Failed to create thread to handle domain shutdown"));
- goto error;
+ if (xl_reason == LIBXL_SHUTDOWN_REASON_SUSPEND) {
+ libxl_event_free(cfg->ctx, event);
+ continue;
+ }
+
+ vm = virDomainObjListFindByID(driver->domains, event->domid);
+ if (!vm) {
+ VIR_INFO("Received event for unknown domain ID %d", event->domid);
+ libxl_event_free(cfg->ctx, event);
+ continue;
+ }
+
+ libxlDomainShutdownEventHandler(driver, vm, event);
+ libxl_event_free(cfg->ctx, event);
}
- /*
- * VM is unlocked and libxl_event freed in shutdown thread
- */
- return;
-
- error:
- cfg = libxlDriverConfigGet(driver);
- /* Cast away any const */
- libxl_event_free(cfg->ctx, (libxl_event *)event);
virObjectUnref(cfg);
- if (vm)
- virObjectUnlock(vm);
- VIR_FREE(shutdown_info);
+}
+
+int
+libxlDomainXEventsInit(libxlDriverPrivatePtr driver)
+{
+ virThread thread;
+
+ if (virThreadCreate(&thread, false, libxlDomainXEventsProcess, driver) < 0)
+ return -1;
+
+ return 0;
}
void
diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h
index 44b3e0b..18a9ddc 100644
--- a/src/libxl/libxl_domain.h
+++ b/src/libxl/libxl_domain.h
@@ -112,20 +112,8 @@ void
libxlDomainCleanup(libxlDriverPrivatePtr driver,
virDomainObjPtr vm);
-/*
- * Note: Xen 4.3 removed the const from the event handler signature.
- * Detect which signature to use based on
- * LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG.
- */
-# ifdef LIBXL_HAVE_NONCONST_EVENT_OCCURS_EVENT_ARG
-# define VIR_LIBXL_EVENT_CONST /* empty */
-# else
-# define VIR_LIBXL_EVENT_CONST const
-# endif
-
-void
-libxlDomainEventHandler(void *data,
- VIR_LIBXL_EVENT_CONST libxl_event *event);
+int
+libxlDomainXEventsInit(libxlDriverPrivatePtr driver);
int
libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index fcdcbdb..050ed0f 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -503,12 +503,6 @@ static const libxl_childproc_hooks libxl_child_hooks = {
#endif
};
-const struct libxl_event_hooks ev_hooks = {
- .event_occurs_mask = LIBXL_EVENTMASK_ALL,
- .event_occurs = libxlDomainEventHandler,
- .disaster = NULL,
-};
-
static int
libxlAddDom0(libxlDriverPrivatePtr driver)
{
@@ -626,9 +620,6 @@ libxlStateInitialize(bool privileged,
/* Setup child process handling. See $xen-src/tools/libxl/libxl_event.h */
libxl_childproc_setmode(cfg->ctx, &libxl_child_hooks, cfg->ctx);
- /* Register callback to handle domain events */
- libxl_event_register_callbacks(cfg->ctx, &ev_hooks, libxl_driver);
-
libxl_driver->config = cfg;
if (virFileMakePath(cfg->stateDir) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -683,6 +674,10 @@ libxlStateInitialize(bool privileged,
if (!(libxl_driver->xmlopt = libxlCreateXMLConf()))
goto error;
+ /* Start processing events from libxl */
+ if (libxlDomainXEventsInit(libxl_driver) < 0)
+ goto error;
+
/* Add Domain-0 */
if (libxlAddDom0(libxl_driver) < 0)
goto error;
--
2.1.4
9 years, 1 month
[libvirt] [PATCH] document virCommandRunRegex function
by Christian Loehle
>From 01a3ed1e6bacba8cd9f398e5233960714b2c4f49 Mon Sep 17 00:00:00 2001
From: Christian Loehle <cloehle(a)linutronix.de>
Date: Mon, 23 Nov 2015 15:06:37 +0100
Subject: [PATCH] =?UTF-8?q?document=20virCommandRunRegex=20function=C3=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/util/vircommand.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index c7f1538..a88cc13 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -2889,12 +2889,24 @@ virCommandSetDryRun(virBufferPtr buf,
}
#ifndef WIN32
-/*
+/**
+ * virCommandRunRegex:
+ * @cmd: command to run
+ * @nregex: number of regexes to apply
+ * @regex: array of regexes to apply
+ * @nvars: array of numbers of variables each regex will produce
+ * @func: callback function that is called for every line of output,
+ * needs to return 0 on success
+ * @data: additional data that will be passed to the callback function
+ * @prefix: prefix that will be skipped at the beginning of each line
+ * @exitstatus: 0 on success, -1 on memory allocation error, virCommandRun
+ * error or callback function error
+ *
* Run an external program.
*
* Read its output and apply a series of regexes to each line
* When the entire set of regexes has matched consecutively
- * then run a callback passing in all the matches
+ * then run a callback passing in all the matches of the current line.
*/
int
virCommandRunRegex(virCommandPtr cmd,
--
2.1.4
9 years, 1 month
[libvirt] [PATCH 00/24] qemu: Add support for -incoming defer
by Jiri Denemark
Traditionally, we pass incoming migration URI on QEMU command line,
which has some drawbacks. Depending on the URI QEMU may initialize its
migration state immediately without giving us a chance to set any
additional migration parameters (this applies mainly for fd: URIs). For
some URIs the monitor may be completely blocked from the beginning until
migration is finished, which means we may be stuck in qmp_capabilities
command without being able to send any QMP commands.
QEMU solved this by introducing "defer" parameter for -incoming command
line option. This will tell QEMU to prepare for an incoming migration
while the actual incoming URI is sent using migrate-incoming QMP
command. Before calling this command we can normally talk to the
monitor and even set any migration parameters which will be honored by
the incoming migration.
Jiri Denemark (24):
qemu: Refactor waiting for completed migration on destination
qemu: Refactor the code to build -incoming command line
qemu: Don't generate migration URI in qemuBuildCommandLine
qemu: Move incoming URI code to qemu_migration
qemu: Introduce qemuProcessIncomingDef
qemu: Always set async job when starting a domain
qemu: Add APIs for migrate-incoming QMP command
qemu: Use -incoming defer for migrations
qemu: Rename stdin_{fd,path} in qemuProcessStart
qemu: Separate hook handling code from qemuProcessStart
qemu: Separate graphics handling code from qemuProcessStart
qemu: Separate raw IO code from qemuProcessStart
qemu: Enter monitor within qemuProcessSetLinkStates
qemu: Separate balloon code from qemuProcessStart
qemu: Introduce qemuProcessMakeDir
qemu: Do not infer flags from other qemuProcessStart arguments
qemu: Close logfd when closing monitor
qemu: Introduce qemuProcessInit
qemu: Introduce qemuProcessLaunch
qemu: Introduce qemuProcessFinish
qemu: Separate incoming URI generation from qemuMigrationPrepareAny
qemu: Kill QEMU process if Prepare phase fails
qemu: Skip starting NBD servers for offline migration
qemu: Use qemuProcessLaunch in migration Prepare phase
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_command.c | 42 +-
src/qemu/qemu_command.h | 4 +-
src/qemu/qemu_domain.c | 3 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 74 ++-
src/qemu/qemu_migration.c | 357 +++++++----
src/qemu/qemu_migration.h | 11 +
src/qemu/qemu_monitor.c | 14 +
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 25 +
src/qemu/qemu_monitor_json.h | 5 +
src/qemu/qemu_process.c | 881 +++++++++++++++++----------
src/qemu/qemu_process.h | 41 +-
tests/qemucapabilitiesdata/caps_2.4.0-1.caps | 1 +
tests/qemuxml2argvtest.c | 16 +-
17 files changed, 969 insertions(+), 515 deletions(-)
--
2.6.3
9 years, 1 month
[libvirt] [PATCH 0/3] libxl: implement virDomainInterfaceStats
by Joao Martins
Hey,
As discussed yesterday, this patch series implements virDomainInterfaceStats
but based on "ConsoleCallback" as opposed of doing it in libxlDomainStart.
The series is divided as following: Patch 1 adds up domain config to
libxlDomainObjPrivate, Patch 2 renames console callback to something more
generic and Patch 3 implements virDomainInterfaceStats also taking the
previous review (v3 statistics) comments.
Regards,
Joao
Joao Martins (3):
libxl: add libxl_domain_config to libxlDomainObjPrivate
libxl: Rename libxlConsoleCallback
libxl: implement virDomainInterfaceStats
src/libxl/libxl_domain.c | 65 +++++++++++++++++++++++++++++++++++++++---------
src/libxl/libxl_domain.h | 1 +
src/libxl/libxl_driver.c | 46 ++++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 12 deletions(-)
--
2.1.4
9 years, 1 month
[libvirt] [libvirt-glib v2 1/3] gobject: Drop redundant glib compatibility code
by Zeeshan Ali (Khattak)
We already require and use glib >= 2.36 so there is no reason to keep
around code to ensure compatibility with glib older than that.
---
libvirt-gobject/libvirt-gobject-compat.c | 87 --------------------------------
libvirt-gobject/libvirt-gobject-compat.h | 73 ---------------------------
2 files changed, 160 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-compat.c b/libvirt-gobject/libvirt-gobject-compat.c
index 14b5eb3..e91b018 100644
--- a/libvirt-gobject/libvirt-gobject-compat.c
+++ b/libvirt-gobject/libvirt-gobject-compat.c
@@ -17,93 +17,6 @@
#include "libvirt-gobject-compat.h"
-#if !GLIB_CHECK_VERSION(2,28,0)
-/**
- * g_simple_async_result_take_error: (skip)
- * @simple: a #GSimpleAsyncResult
- * @error: a #GError
- *
- * Sets the result from @error, and takes over the caller's ownership
- * of @error, so the caller does not need to free it any more.
- *
- * Since: 2.28
- **/
-G_GNUC_INTERNAL void
-g_simple_async_result_take_error (GSimpleAsyncResult *simple,
- GError *error)
-{
- /* this code is different from upstream */
- /* we can't avoid extra copy/free, since the simple struct is
- opaque */
- g_simple_async_result_set_from_error (simple, error);
- g_error_free (error);
-}
-
-/**
- * g_simple_async_result_new_take_error: (skip)
- * @source_object: (allow-none): a #GObject, or %NULL
- * @callback: (scope async): a #GAsyncReadyCallback
- * @user_data: (closure): user data passed to @callback
- * @error: a #GError
- *
- * Creates a #GSimpleAsyncResult from an error condition, and takes over the
- * caller's ownership of @error, so the caller does not need to free it anymore.
- *
- * Returns: a #GSimpleAsyncResult
- *
- * Since: 2.28
- **/
-GSimpleAsyncResult *
-g_simple_async_result_new_take_error(GObject *source_object,
- GAsyncReadyCallback callback,
- gpointer user_data,
- GError *error)
-{
- GSimpleAsyncResult *simple;
-
- g_return_val_if_fail(!source_object || G_IS_OBJECT(source_object), NULL);
-
- simple = g_simple_async_result_new(source_object,
- callback,
- user_data, NULL);
- g_simple_async_result_take_error(simple, error);
-
- return simple;
-}
-
-/**
- * g_simple_async_report_take_gerror_in_idle: (skip)
- * @object: (allow-none): a #GObject, or %NULL
- * @callback: a #GAsyncReadyCallback.
- * @user_data: user data passed to @callback.
- * @error: the #GError to report
- *
- * Reports an error in an idle function. Similar to
- * g_simple_async_report_gerror_in_idle(), but takes over the caller's
- * ownership of @error, so the caller does not have to free it any more.
- *
- * Since: 2.28
- **/
-void
-g_simple_async_report_take_gerror_in_idle(GObject *object,
- GAsyncReadyCallback callback,
- gpointer user_data,
- GError *error)
-{
- GSimpleAsyncResult *simple;
-
- g_return_if_fail(!object || G_IS_OBJECT(object));
- g_return_if_fail(error != NULL);
-
- simple = g_simple_async_result_new_take_error(object,
- callback,
- user_data,
- error);
- g_simple_async_result_complete_in_idle(simple);
- g_object_unref(simple);
-}
-#endif
-
GMutex *gvir_mutex_new(void)
{
GMutex *mutex;
diff --git a/libvirt-gobject/libvirt-gobject-compat.h b/libvirt-gobject/libvirt-gobject-compat.h
index 2e87966..27fa305 100644
--- a/libvirt-gobject/libvirt-gobject-compat.h
+++ b/libvirt-gobject/libvirt-gobject-compat.h
@@ -35,77 +35,4 @@ GMutex *gvir_mutex_new(void);
#endif
-#if !GLIB_CHECK_VERSION(2,26,0)
-#define G_DEFINE_BOXED_TYPE(TypeName, type_name, copy_func, free_func) G_DEFINE_BOXED_TYPE_WITH_CODE (TypeName, type_name, copy_func, free_func, {})
-#define G_DEFINE_BOXED_TYPE_WITH_CODE(TypeName, type_name, copy_func, free_func, _C_) _G_DEFINE_BOXED_TYPE_BEGIN (TypeName, type_name, copy_func, free_func) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
-GType \
-type_name##_get_type (void) \
-{ \
- static volatile gsize g_define_type_id__volatile = 0; \
- if (g_once_init_enter (&g_define_type_id__volatile)) \
- { \
- GType (* _g_register_boxed) \
- (const gchar *, \
- union \
- { \
- TypeName * (*do_copy_type) (TypeName *); \
- TypeName * (*do_const_copy_type) (const TypeName *); \
- GBoxedCopyFunc do_copy_boxed; \
- } __attribute__((__transparent_union__)), \
- union \
- { \
- void (* do_free_type) (TypeName *); \
- GBoxedFreeFunc do_free_boxed; \
- } __attribute__((__transparent_union__)) \
- ) = g_boxed_type_register_static; \
- GType g_define_type_id = \
- _g_register_boxed (g_intern_static_string (#TypeName), copy_func, free_func); \
- { /* custom code follows */
-#else
-#define _G_DEFINE_BOXED_TYPE_BEGIN(TypeName, type_name, copy_func, free_func) \
-GType \
-type_name##_get_type (void) \
-{ \
- static volatile gsize g_define_type_id__volatile = 0; \
- if (g_once_init_enter (&g_define_type_id__volatile)) \
- { \
- GType g_define_type_id = \
- g_boxed_type_register_static (g_intern_static_string (#TypeName), \
- (GBoxedCopyFunc) copy_func, \
- (GBoxedFreeFunc) free_func); \
- { /* custom code follows */
-#endif /* __GNUC__ */
-#endif /* glib 2.26 */
-
-#if !GLIB_CHECK_VERSION(2,28,0)
-#define g_clear_object(object_ptr) \
- G_STMT_START { \
- /* Only one access, please */ \
- gpointer *_p = (gpointer) (object_ptr); \
- gpointer _o; \
- \
- do \
- _o = g_atomic_pointer_get (_p); \
- while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_p, _o, NULL));\
- \
- if (_o) \
- g_object_unref (_o); \
- } G_STMT_END
-
-void
-g_simple_async_result_take_error(GSimpleAsyncResult *simple,
- GError *error);
-GSimpleAsyncResult *g_simple_async_result_new_take_error (GObject *source_object,
- GAsyncReadyCallback callback,
- gpointer user_data,
- GError *error);
-void g_simple_async_report_take_gerror_in_idle (GObject *object,
- GAsyncReadyCallback callback,
- gpointer user_data,
- GError *error);
-#endif /* glib 2.28 */
-
-
#endif /* __LIBVIRT_GOBJECT_COMPAT_H__ */
--
2.5.0
9 years, 1 month
[libvirt] Fw:[PATCH] fix configure for pcap
by 程宝传
when cross-compiling, pcap can not point to the correct toolchain.
configure.ac | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index f481c50..d6d2cf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1555,7 +1555,7 @@ if test "$with_numad" != "no" ; then
with_numad="yes"
fi
else
- test -z "$NUMAD" &&
+ test -z "$NUMAD" &&/
AC_MSG_ERROR([You must install numad package to manage CPU and memory placement dynamically])
test "$with_numactl" = "yes" || fail=1
@@ -1588,8 +1588,13 @@ if test "$with_qemu" = "yes"; then
if ! $LIBPCAP_CONFIG --libs > /dev/null 2>&1 ; then
AC_MSG_RESULT(no)
else
- LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
- LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
+ if test -n $with_libtool_sysroot && test -n $lt_sysroot; then
+ LIBPCAP_LIBS="-lpcap"
+ LIBPCAP_CFLAGS="-I$lt_sysroot/usr/include"
+ else
+ LIBPCAP_LIBS="`$LIBPCAP_CONFIG --libs`"
+ LIBPCAP_CFLAGS="`$LIBPCAP_CONFIG --cflags`"
+ fi
LIBPCAP_FOUND="yes"
AC_MSG_RESULT(yes)
fi
--
2.6.3.windows.1
9 years, 1 month
[libvirt] [PATCH 0/3] qemu_cgroup cleanups
by Ján Tomko
*** BLARGGH HERE ***
Ján Tomko (3):
rename qemuSetupHostdevCGroup to qemuSetupHostdevCgroup
Simplify qemuSetupChrSourceCgroup and its callers
qemuSetupChrSourceCgroup: rename dev to source
src/qemu/qemu_cgroup.c | 37 ++++++++++++++++---------------------
src/qemu/qemu_cgroup.h | 2 +-
src/qemu/qemu_hotplug.c | 6 +++---
3 files changed, 20 insertions(+), 25 deletions(-)
--
2.4.6
9 years, 1 month
[libvirt] [libvirt-glib 2/3] gconfig: Drop redundant glib compatibility code
by Zeeshan Ali (Khattak)
We already require and use glib >= 2.36 so there is no reason to keep
around code to ensure compatibility with glib older than that.
---
libvirt-gconfig/libvirt-gconfig-compat.h | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-compat.h b/libvirt-gconfig/libvirt-gconfig-compat.h
index fbf552c..c9ac645 100644
--- a/libvirt-gconfig/libvirt-gconfig-compat.h
+++ b/libvirt-gconfig/libvirt-gconfig-compat.h
@@ -25,26 +25,6 @@
#include <glib-object.h>
-#if !GLIB_CHECK_VERSION(2,32,0)
-
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define G_DEPRECATED __attribute__((__deprecated__))
-#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
-#define G_DEPRECATED __declspec(deprecated)
-#else
-#define G_DEPRECATED
-#endif
-
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define G_DEPRECATED_FOR(f) __attribute__((__deprecated__("Use '" #f "' instead")))
-#elif defined(_MSC_FULL_VER) && (_MSC_FULL_VER > 140050320)
-#define G_DEPRECATED_FOR(f) __declspec(deprecated("is deprecated. Use '" #f "' instead"))
-#else
-#define G_DEPRECATED_FOR(f) G_DEPRECATED
-#endif
-
-#endif
-
#if GLIB_CHECK_VERSION(2, 35, 0)
#define g_type_init()
#endif
--
2.5.0
9 years, 1 month