[libvirt] [libvirt-glib] gobject: Add GVirDomainRebootFlags
by Zeeshan Ali (Khattak)
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
Add flags to be used with gvir_domain_reboot().
---
libvirt-gobject/libvirt-gobject-domain.c | 2 +-
libvirt-gobject/libvirt-gobject-domain.h | 13 +++++++++++++
libvirt-gobject/libvirt-gobject.sym | 5 +++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 8ade3ea..c1ba5ce 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -688,7 +688,7 @@ gboolean gvir_domain_shutdown(GVirDomain *dom,
/**
* gvir_domain_reboot:
* @dom: the domain
- * @flags: the flags
+ * @flags: the %GVirDomainRebootFlags flags
*/
gboolean gvir_domain_reboot(GVirDomain *dom,
guint flags,
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 6e7b10d..bd0cfc0 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -158,6 +158,19 @@ typedef enum {
GVIR_DOMAIN_SNAPSHOT_ATOMIC = VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC,
} GVirDomainSnapshotCreateFlags;
+/**
+ * GVirDomainRebootFlags:
+ * @GVIR_DOMAIN_REBOOT_NONE: No flags, hypervisor choice
+ * @GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN: Send ACPI event
+ * @GVIR_DOMAIN_REBOOT_GUEST_AGENT: Use guest agent
+ *
+ */
+typedef enum {
+ GVIR_DOMAIN_REBOOT_NONE = 0,
+ GVIR_DOMAIN_REBOOT_ACPI_POWER_BTN = VIR_DOMAIN_REBOOT_ACPI_POWER_BTN,
+ GVIR_DOMAIN_REBOOT_GUEST_AGENT = VIR_DOMAIN_REBOOT_GUEST_AGENT,
+} GVirDomainRebootFlags;
+
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 3a40a8a..444a891 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -204,4 +204,9 @@ LIBVIRT_GOBJECT_0.1.3 {
gvir_domain_wakeup_finish;
} LIBVIRT_GOBJECT_0.1.2;
+LIBVIRT_GOBJECT_0.1.4 {
+ global:
+ gvir_domain_reboot_flags_get_type;
+} LIBVIRT_GOBJECT_0.1.3;
+
# .... define new API here using predicted next version number ....
--
1.7.12.1
12 years
[libvirt] [libvirt-glib] Log virStreamFinish error when it fails
by Christophe Fergeau
GVirObjectStream::finalize() logs a critical() if virStreamFinish
fails. This commit adds the libvirt error message to this critical
to ease debugging.
---
libvirt-gobject/libvirt-gobject-stream.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libvirt-gobject/libvirt-gobject-stream.c b/libvirt-gobject/libvirt-gobject-stream.c
index fa1a32c..3c61fdb 100644
--- a/libvirt-gobject/libvirt-gobject-stream.c
+++ b/libvirt-gobject/libvirt-gobject-stream.c
@@ -217,8 +217,10 @@ static void gvir_stream_finalize(GObject *object)
if (priv->handle) {
gvir_stream_update_events(self);
- if (virStreamFinish(priv->handle) < 0)
- g_critical("cannot finish stream");
+ if (virStreamFinish(priv->handle) < 0) {
+ virErrorPtr verr = virGetLastError();
+ g_critical("cannot finish stream: %s", verr->message);
+ }
virStreamFree(priv->handle);
}
--
1.7.12.1
12 years
[libvirt] [PATCH v12] support offline migration
by liguang
original migration did not aware of offline case,
so, try to support offline migration quietly
(did not disturb original migration) by pass
VIR_MIGRATE_OFFLINE flag to migration APIs if only
the domain is really inactive, and
migration process will not puzzled by domain
offline and exit unexpectedly.
these changes did not take care of disk images the
domain required, for them could be transferred by
other APIs as suggested, then VIR_MIGRATE_OFFLINE
should not combined with VIR_MIGRATE_NON_SHARED_*.
if you want a persistent migration,
you should do "virsh migrate --persistent" youself.
v12:
rebased for conflicting with commit 2f3e2c0c434218a3d656c08779cb98b327170e11,
and take in some messages from Doug Goldstein's patch
https://www.redhat.com/archives/libvir-list/2012-October/msg00957.html
Signed-off-by: liguang <lig.fnst(a)cn.fujitsu.com>
---
include/libvirt/libvirt.h.in | 1 +
src/qemu/qemu_driver.c | 15 +++++++++
src/qemu/qemu_migration.c | 66 ++++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_migration.h | 3 +-
tools/virsh-domain.c | 10 ++++++
5 files changed, 86 insertions(+), 9 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 2b17cef..a8f641f 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1089,6 +1089,7 @@ typedef enum {
* whole migration process; this will be used automatically
* when supported */
VIR_MIGRATE_UNSAFE = (1 << 9), /* force migration even if it is considered unsafe */
+ VIR_MIGRATE_OFFLINE = (1 << 10), /* offline migrate */
} virDomainMigrateFlags;
/* Domain migration. */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 267bbf1..f5c05e4 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9759,6 +9759,20 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
}
if (!virDomainObjIsActive(vm)) {
+ if (flags & VIR_MIGRATE_OFFLINE) {
+ if (flags & (VIR_MIGRATE_NON_SHARED_DISK|
+ VIR_MIGRATE_NON_SHARED_INC)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("offline migration cannot handle non-shared storage"));
+ goto endjob;
+ }
+ if (!(flags & VIR_MIGRATE_PERSIST_DEST)) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("offline migration must be specified with the persistent flag set"));
+ goto endjob;
+ }
+ goto offline;
+ }
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
@@ -9771,6 +9785,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
if (qemuDomainCheckEjectableMedia(driver, vm, asyncJob) < 0)
goto endjob;
+offline:
if (!(xml = qemuMigrationBegin(driver, vm, xmlin, dname,
cookieout, cookieoutlen,
flags)))
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e0acc20..85fc48b 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -72,6 +72,7 @@ enum qemuMigrationCookieFlags {
QEMU_MIGRATION_COOKIE_FLAG_LOCKSTATE,
QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT,
QEMU_MIGRATION_COOKIE_FLAG_NETWORK,
+ QEMU_MIGRATION_COOKIE_FLAG_OFFLINE,
QEMU_MIGRATION_COOKIE_FLAG_LAST
};
@@ -79,13 +80,14 @@ enum qemuMigrationCookieFlags {
VIR_ENUM_DECL(qemuMigrationCookieFlag);
VIR_ENUM_IMPL(qemuMigrationCookieFlag,
QEMU_MIGRATION_COOKIE_FLAG_LAST,
- "graphics", "lockstate", "persistent", "network");
+ "graphics", "lockstate", "persistent", "network", "offline");
enum qemuMigrationCookieFeatures {
QEMU_MIGRATION_COOKIE_GRAPHICS = (1 << QEMU_MIGRATION_COOKIE_FLAG_GRAPHICS),
QEMU_MIGRATION_COOKIE_LOCKSTATE = (1 << QEMU_MIGRATION_COOKIE_FLAG_LOCKSTATE),
QEMU_MIGRATION_COOKIE_PERSISTENT = (1 << QEMU_MIGRATION_COOKIE_FLAG_PERSISTENT),
QEMU_MIGRATION_COOKIE_NETWORK = (1 << QEMU_MIGRATION_COOKIE_FLAG_NETWORK),
+ QEMU_MIGRATION_COOKIE_OFFLINE = (1 << QEMU_MIGRATION_COOKIE_FLAG_OFFLINE),
};
typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics;
@@ -594,6 +596,9 @@ qemuMigrationCookieXMLFormat(struct qemud_driver *driver,
if ((mig->flags & QEMU_MIGRATION_COOKIE_NETWORK) && mig->network)
qemuMigrationCookieNetworkXMLFormat(buf, mig->network);
+ if (mig->flags & QEMU_MIGRATION_COOKIE_OFFLINE)
+ virBufferAsprintf(buf, " <offline/>\n");
+
virBufferAddLit(buf, "</qemu-migration>\n");
return 0;
}
@@ -874,6 +879,11 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
(!(mig->network = qemuMigrationCookieNetworkXMLParse(ctxt))))
goto error;
+ if ((flags & QEMU_MIGRATION_COOKIE_OFFLINE)) {
+ if (virXPathBoolean("count(./offline) > 0", ctxt))
+ mig->flags |= QEMU_MIGRATION_COOKIE_OFFLINE;
+ }
+
return 0;
error:
@@ -938,6 +948,12 @@ qemuMigrationBakeCookie(qemuMigrationCookiePtr mig,
return -1;
}
+ if (flags & QEMU_MIGRATION_COOKIE_OFFLINE) {
+ mig->flags |= QEMU_MIGRATION_COOKIE_OFFLINE;
+ }
+
+
+
if (!(*cookieout = qemuMigrationCookieXMLFormatStr(driver, mig)))
return -1;
@@ -1443,6 +1459,13 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
QEMU_MIGRATION_COOKIE_LOCKSTATE) < 0)
goto cleanup;
+ if (flags & VIR_MIGRATE_OFFLINE) {
+ if (qemuMigrationBakeCookie(mig, driver, vm,
+ cookieout, cookieoutlen,
+ QEMU_MIGRATION_COOKIE_OFFLINE) < 0)
+ goto cleanup;
+ }
+
if (xmlin) {
if (!(def = virDomainDefParseString(driver->caps, xmlin,
QEMU_EXPECTED_VIRT_TYPES,
@@ -1607,6 +1630,15 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
goto endjob;
}
+ if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
+ QEMU_MIGRATION_COOKIE_OFFLINE)))
+ return ret;
+
+ if (mig->flags & QEMU_MIGRATION_COOKIE_OFFLINE) {
+ ret = 0;
+ goto cleanup;
+ }
+
/* Start the QEMU daemon, with the same command-line arguments plus
* -incoming $migrateFrom
*/
@@ -2150,6 +2182,9 @@ qemuMigrationRun(struct qemud_driver *driver,
return -1;
}
+ if (flags & VIR_MIGRATE_OFFLINE)
+ return 0;
+
if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen,
QEMU_MIGRATION_COOKIE_GRAPHICS)))
goto cleanup;
@@ -2665,7 +2700,12 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
uri, &uri_out, flags, dname, resource, dom_xml);
qemuDomainObjExitRemoteWithDriver(driver, vm);
}
+
VIR_FREE(dom_xml);
+
+ if (flags & VIR_MIGRATE_OFFLINE)
+ goto cleanup;
+
if (ret == -1)
goto cleanup;
@@ -2771,7 +2811,7 @@ finish:
vm->def->name);
cleanup:
- if (ddomain) {
+ if (ddomain || (flags & VIR_MIGRATE_OFFLINE)) {
virObjectUnref(ddomain);
ret = 0;
} else {
@@ -2848,7 +2888,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
}
/* domain may have been stopped while we were talking to remote daemon */
- if (!virDomainObjIsActive(vm)) {
+ if (!virDomainObjIsActive(vm) && !(flags & VIR_MIGRATE_OFFLINE)) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
@@ -2911,7 +2951,7 @@ qemuMigrationPerformJob(struct qemud_driver *driver,
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
goto cleanup;
- if (!virDomainObjIsActive(vm)) {
+ if (!virDomainObjIsActive(vm) && !(flags & VIR_MIGRATE_OFFLINE)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
@@ -3236,6 +3276,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
*/
if (retcode == 0) {
if (!virDomainObjIsActive(vm)) {
+ if (flags & VIR_MIGRATE_OFFLINE)
+ goto offline;
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
@@ -3255,6 +3297,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
if (qemuDomainMigrateOPDRelocate(driver, vm, mig) < 0)
VIR_WARN("unable to provide network data for relocation");
+ offline:
if (flags & VIR_MIGRATE_PERSIST_DEST) {
virDomainDefPtr vmdef;
if (vm->persistent)
@@ -3302,7 +3345,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
event = NULL;
}
- if (!(flags & VIR_MIGRATE_PAUSED)) {
+ if (!(flags & VIR_MIGRATE_PAUSED) && !(flags & VIR_MIGRATE_OFFLINE)) {
/* run 'cont' on the destination, which allows migration on qemu
* >= 0.10.6 to work properly. This isn't strictly necessary on
* older qemu's, but it also doesn't hurt anything there
@@ -3351,9 +3394,11 @@ qemuMigrationFinish(struct qemud_driver *driver,
VIR_DOMAIN_EVENT_SUSPENDED,
VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
}
- if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) {
- VIR_WARN("Failed to save status on vm %s", vm->def->name);
- goto endjob;
+ if (virDomainObjIsActive(vm)) {
+ if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) {
+ VIR_WARN("Failed to save status on vm %s", vm->def->name);
+ goto endjob;
+ }
}
/* Guest is successfully running, so cancel previous auto destroy */
@@ -3373,6 +3418,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
endjob:
if (qemuMigrationJobFinish(driver, vm) == 0) {
vm = NULL;
+ } else if (flags & VIR_MIGRATE_OFFLINE) {
} else if (!vm->persistent && !virDomainObjIsActive(vm)) {
qemuDomainRemoveInactive(driver, vm);
vm = NULL;
@@ -3420,6 +3466,9 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
if (!(mig = qemuMigrationEatCookie(driver, vm, cookiein, cookieinlen, 0)))
return -1;
+ if (flags & VIR_MIGRATE_OFFLINE)
+ goto offline;
+
/* Did the migration go as planned? If yes, kill off the
* domain object, but if no, resume CPUs
*/
@@ -3455,6 +3504,7 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
}
}
+offline:
qemuMigrationCookieFree(mig);
rv = 0;
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
index 7a2269a..b4f6a77 100644
--- a/src/qemu/qemu_migration.h
+++ b/src/qemu/qemu_migration.h
@@ -36,7 +36,8 @@
VIR_MIGRATE_NON_SHARED_DISK | \
VIR_MIGRATE_NON_SHARED_INC | \
VIR_MIGRATE_CHANGE_PROTECTION | \
- VIR_MIGRATE_UNSAFE)
+ VIR_MIGRATE_UNSAFE | \
+ VIR_MIGRATE_OFFLINE)
enum qemuMigrationJobPhase {
QEMU_MIGRATION_PHASE_NONE = 0,
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 255669f..4be1cb4 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6644,6 +6644,7 @@ static const vshCmdInfo info_migrate[] = {
static const vshCmdOptDef opts_migrate[] = {
{"live", VSH_OT_BOOL, 0, N_("live migration")},
+ {"offline", VSH_OT_BOOL, 0, N_("offline (domain's inactive) migration")},
{"p2p", VSH_OT_BOOL, 0, N_("peer-2-peer migration")},
{"direct", VSH_OT_BOOL, 0, N_("direct migration")},
{"tunneled", VSH_OT_ALIAS, 0, "tunnelled"},
@@ -6729,6 +6730,15 @@ doMigrate(void *opaque)
if (vshCommandOptBool(cmd, "unsafe"))
flags |= VIR_MIGRATE_UNSAFE;
+ if (vshCommandOptBool(cmd, "offline")) {
+ flags |= VIR_MIGRATE_OFFLINE;
+ }
+
+ if (virDomainIsActive(dom) && (flags & VIR_MIGRATE_OFFLINE)) {
+ vshError(ctl, "%s", _("domain is active, offline migration for inactive domain only"));
+ goto out;
+ }
+
if (xmlfile &&
virFileReadAll(xmlfile, 8192, &xml) < 0) {
vshError(ctl, _("file '%s' doesn't exist"), xmlfile);
--
1.7.1
12 years
[libvirt] [PATCH] esx: Yet another connection fix for 5.1
by Martin Kletzander
After the connection to ESX 5.1 being broken since g1e7cd39, the fix
in bab7752c helped a bit, but still missed a spot, so the connection
is now successful, but some APIs (for example defineXML) don't work.
Two cases missing are added in this patch to avoid that.
---
src/esx/esx_vi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 097ed48..f3224f8 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -2,7 +2,7 @@
/*
* esx_vi.c: client for the VMware VI API 2.5 to manage ESX hosts
*
- * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2010-2012 Red Hat, Inc.
* Copyright (C) 2009-2012 Matthias Bolte <matthias.bolte(a)googlemail.com>
*
* This library is free software; you can redistribute it and/or
@@ -4657,7 +4657,9 @@ esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersio
case esxVI_ProductVersion_VPX50:
return 8;
+ case esxVI_ProductVersion_ESX51:
case esxVI_ProductVersion_ESX5x:
+ case esxVI_ProductVersion_VPX51:
case esxVI_ProductVersion_VPX5x:
return 8;
--
1.8.0
12 years
[libvirt] [PATCH v2 0/3] QEMU: Specific order for controllers in cmd line
by Michal Privoznik
The order is basically random for now, with one constraint:
CCID must be preceded with USB.
diff to v1:
-split into 2 patches
-add a test case
Michal Privoznik (3):
qemu: Wrap controllers code into dummy loop
qemu: Add controllers in specified order
tests: Add test for controller order
src/qemu/qemu_command.c | 101 +++++++++++---------
.../qemuxml2argv-controller-order.args | 28 ++++++
.../qemuxml2argv-controller-order.xml | 89 +++++++++++++++++
tests/qemuxml2argvtest.c | 6 +
4 files changed, 177 insertions(+), 47 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-controller-order.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml
--
1.7.8.6
12 years
[libvirt] [test-API][PATCH] Fix a typo xml_file_path
by hongming
Change the undefined variable "xml_file_path" to "file_path"
---
src/testcasexml.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/testcasexml.py b/src/testcasexml.py
index 8485d3d..4cbdc03 100644
--- a/src/testcasexml.py
+++ b/src/testcasexml.py
@@ -31,7 +31,7 @@ def xml_file_to_str(proxy_obj, mod_case, case_params):
text = fh.read()
fh.close()
else:
- raise exception.FileDoesNotExist("xml file %s doesn't exist" % xml_file_path)
+ raise exception.FileDoesNotExist("xml file %s doesn't exist" % file_path)
# replace the params that in testcase.conf first
for (key, value) in case_params.items():
--
1.7.7.6
12 years
[libvirt] [PATCH v6 1/6] add a configure option --with-fuse to prepare introduction of fuse support for libvirt lxc
by Gao feng
add a configure option --with-fuse to prepare introduction
of fuse support for libvirt lxc.
With help from Daniel
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
configure.ac | 36 ++++++++++++++++++++++++++++++++++++
libvirt.spec.in | 9 +++++++++
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8810efd..0cac7fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,7 @@ LIBSSH2_REQUIRED="1.0"
LIBSSH2_TRANSPORT_REQUIRED="1.3"
LIBBLKID_REQUIRED="2.17"
DBUS_REQUIRED="1.0.0"
+FUSE_REQUIRED="2.8.6"
dnl Checks for C compiler.
AC_PROG_CC
@@ -1857,6 +1858,36 @@ AC_SUBST([CAPNG_CFLAGS])
AC_SUBST([CAPNG_LIBS])
+dnl libfuse
+AC_ARG_WITH([fuse],
+ AC_HELP_STRING([--with-fuse], [use libfuse to proivde fuse filesystem support for libvirt lxc]),
+ [],
+ [with_fuse=check])
+dnl
+dnl This check looks for 'fuse'
+dnl
+FUSE_CFLAGS=
+FUSE_LIBS=
+if test "x$with_fuse" != "xno"; then
+ PKG_CHECK_MODULES([FUSE], [fuse >= $FUSE_REQUIRED],
+ [with_fuse=yes], [
+ if test "x$with_fuse" = "xcheck" ; then
+ with_fuse=no
+ else
+ AC_MSG_ERROR(
+ [You must install fuse Library to compile libvirt])
+ fi
+ ])
+ if test "x$with_fuse" = "xyes" ; then
+ FUSE_LIBS="-lfuse"
+ FUSE_CFLAGS="-D_FILE_OFFSET_BITS=64"
+ AC_DEFINE_UNQUOTED([HAVE_FUSE], 1, [whether fuse is available for libvirt lxc])
+ fi
+fi
+AM_CONDITIONAL([HAVE_FUSE], [test "x$with_fuse" = "xyes"])
+AC_SUBST([FUSE_CFLAGS])
+AC_SUBST([FUSE_LIBS])
+
dnl virsh libraries
AC_CHECK_HEADERS([readline/readline.h])
@@ -3161,6 +3192,11 @@ AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS])
else
AC_MSG_NOTICE([ capng: no])
fi
+if test "$with_fuse" = "yes" ; then
+AC_MSG_NOTICE([ fuse: $FUSE_CFLAGS $FUSE_LIBS])
+else
+AC_MSG_NOTICE([ fuse: no])
+fi
if test "$with_xen" = "yes" ; then
AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS])
else
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 511949e..8fe0d77 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -93,6 +93,7 @@
# A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_capng 0%{!?_without_capng:0}
+%define with_fuse 0%{!?_without_fuse:0}
%define with_netcf 0%{!?_without_netcf:0}
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
@@ -503,6 +504,9 @@ BuildRequires: numactl-devel
%if %{with_capng}
BuildRequires: libcap-ng-devel >= 0.5.0
%endif
+%if %{with_fuse}
+BuildRequires: fuse-devel >= 2.8.6
+%endif
%if %{with_phyp} || %{with_libssh2_transport}
%if %{with_libssh2_transport}
BuildRequires: libssh2-devel >= 1.3.0
@@ -1186,6 +1190,10 @@ of recent versions of Linux (and other OSes).
%define _without_capng --without-capng
%endif
+%if ! %{with_fuse}
+%define _without_fuse --without-fuse
+%endif
+
%if ! %{with_netcf}
%define _without_netcf --without-netcf
%endif
@@ -1289,6 +1297,7 @@ autoreconf -if
%{?_without_numactl} \
%{?_without_numad} \
%{?_without_capng} \
+ %{?_without_fuse} \
%{?_without_netcf} \
%{?_without_selinux} \
%{?_with_selinux_mount} \
--
1.7.7.6
12 years
[libvirt] [PATCH] iohelper: Don't report errors on special FDs
by Michal Privoznik
Some FDs may not implement fdatasync() functionality, e.g.
pipes or stdout. In that case EINVAL or EROFS is returned.
We don't want to fail then nor report any error.
Reported-by: Christophe Fergeau <cfergeau(a)redhat.com>
---
I know that those two 'if-s' can be joined together but it just looks weird to me.
src/util/iohelper.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/util/iohelper.c b/src/util/iohelper.c
index 860e14a..b8c91aa 100644
--- a/src/util/iohelper.c
+++ b/src/util/iohelper.c
@@ -181,8 +181,11 @@ runIO(const char *path, int fd, int oflags, unsigned long long length)
/* Ensure all data is written */
if (fdatasync(fdout) < 0) {
- virReportSystemError(errno, _("unable to fsync %s"), fdoutname);
- goto cleanup;
+ if (errno != EINVAL && errno != EROFS) {
+ /* fdatasync() may fail on some special FDs like stdout or pipes */
+ virReportSystemError(errno, _("unable to fsync %s"), fdoutname);
+ goto cleanup;
+ }
}
ret = 0;
--
1.7.8.6
12 years
[libvirt] [PATCH v2] gitignore: ignore more files
by liguang
ignore cscope.in.out, cscope.po.out
Signed-off-by: liguang <lig.fnst(a)cn.fujitsu.com>
---
.gitignore | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 79a055b..12fbe0e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -188,7 +188,9 @@ Makefile.in
TAGS
coverage
cscope.files
+cscope.in.out
cscope.out
+cscope.po.out
results.log
stamp-h
stamp-h.in
--
1.7.1
12 years