[libvirt] [PATCH][libvirt-sandbox] configure: Require higher version of glib
by Michal Privoznik
Since commit cfd4460b we must require glib-2.32.0 at least
because we are using g_value_set_schar which was introduced
in that release.
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index f8956c4..8d91440 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,7 +11,7 @@ AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
GIO_UNIX_REQUIRED=2.28.0
-GOBJECT_REQUIRED=2.28.0
+GOBJECT_REQUIRED=2.32.0
LIBVIRT_GLIB_REQUIRED=0.0.4
LIBVIRT_GOBJECT_REQUIRED=0.0.7
GOBJECT_INTROSPECTION_REQUIRED=0.10.8
--
1.7.8.5
12 years, 5 months
[libvirt] [PATCH 1/5] S390: Override QEMU_CAPS_NO_ACPI for s390x
by Viktor Mihajlovski
Starting a KVM guest on s390 fails immediately. This is because
"qemu --help" reports -no-acpi even for the s390(x) architecture but
-no-acpi isn't supported there.
Workaround is to remove QEMU_CAPS_NO_ACPI from the capability set
after the version/capability extraction.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4308833..0c01cb0 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1511,6 +1511,11 @@ int qemuCapsExtractVersionInfo(const char *qemu, const char *arch,
qemuCapsSet(flags, QEMU_CAPS_PCI_MULTIBUS);
}
+ /* S390 and probably other archs do not support no-acpi -
+ maybe the qemu option parsing should be re-thought. */
+ if (STREQLEN(arch, "s390x", 5))
+ qemuCapsClear(flags, QEMU_CAPS_NO_ACPI);
+
/* qemuCapsExtractDeviceStr will only set additional flags if qemu
* understands the 0.13.0+ notion of "-device driver,". */
if (qemuCapsGet(flags, QEMU_CAPS_DEVICE) &&
--
1.7.0.4
--
Mit freundlichen Grüßen/Kind Regards
Viktor Mihajlovski
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
12 years, 5 months
[libvirt] [PATCH libvirt-glib] Add async version of gvir_domain_start
by Marc-André Lureau
---
libvirt-gobject/libvirt-gobject-domain.c | 75 ++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 9 ++++
libvirt-gobject/libvirt-gobject.sym | 3 ++
3 files changed, 87 insertions(+)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 59af63f..088cd33 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -345,6 +345,81 @@ gboolean gvir_domain_start(GVirDomain *dom,
return TRUE;
}
+typedef struct {
+ guint flags;
+} DomainStartData;
+
+static void domain_start_data_free(DomainStartData *data)
+{
+ g_slice_free(DomainStartData, data);
+}
+
+static void
+gvir_domain_start_helper(GSimpleAsyncResult *res,
+ GObject *object,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirDomain *dom = GVIR_DOMAIN(object);
+ DomainStartData *data;
+ GError *err = NULL;
+
+ data = g_simple_async_result_get_op_res_gpointer(res);
+
+ if (!gvir_domain_start(dom, data->flags, &err))
+ g_simple_async_result_take_error(res, err);
+}
+
+/**
+ * gvir_domain_start_async:
+ * @dom: the domain
+ * @flags: the flags
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_domain_start.
+ */
+void gvir_domain_start_async(GVirDomain *dom,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *res;
+ DomainStartData *data;
+
+ g_return_if_fail(GVIR_IS_DOMAIN(dom));
+ g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+
+ data = g_slice_new0(DomainStartData);
+ data->flags = flags;
+
+ res = g_simple_async_result_new(G_OBJECT(dom),
+ callback,
+ user_data,
+ gvir_domain_start_async);
+ g_simple_async_result_set_op_res_gpointer (res, data, (GDestroyNotify)domain_start_data_free);
+ g_simple_async_result_run_in_thread(res,
+ gvir_domain_start_helper,
+ G_PRIORITY_DEFAULT,
+ cancellable);
+ g_object_unref(res);
+}
+
+gboolean gvir_domain_start_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(g_simple_async_result_is_valid(result, G_OBJECT(dom), gvir_domain_start_async), FALSE);
+ g_return_val_if_fail(err == NULL || *err == NULL, FALSE);
+
+ if (g_simple_async_result_propagate_error(G_SIMPLE_ASYNC_RESULT(result), err))
+ return FALSE;
+
+ return TRUE;
+}
+
/**
* gvir_domain_resume:
* @dom: the domain
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 677fbe6..87b94f4 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -124,6 +124,15 @@ gint gvir_domain_get_id(GVirDomain *dom,
gboolean gvir_domain_start(GVirDomain *dom,
guint flags,
GError **err);
+void gvir_domain_start_async(GVirDomain *dom,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_domain_start_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err);
+
gboolean gvir_domain_resume(GVirDomain *dom,
GError **err);
gboolean gvir_domain_stop(GVirDomain *dom,
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index 7121794..94e441a 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -165,6 +165,9 @@ LIBVIRT_GOBJECT_0.0.9 {
gvir_connection_get_capabilities;
gvir_connection_get_capabilities_async;
gvir_connection_get_capabilities_finish;
+
+ gvir_domain_start_async;
+ gvir_domain_start_finish;
} LIBVIRT_GOBJECT_0.0.8;
# .... define new API here using predicted next version number ....
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] virsh: Improve error when trying to change vm's cpu count 0
by Peter Krempa
This patch adds a check for the count of processors the user requests
for the guest machine so that invalid values produce a more helpful
error message.
---
tools/virsh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 55cbe2b..2ec84cd 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5755,7 +5755,7 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptInt(cmd, "count", &count) < 0) {
+ if (vshCommandOptInt(cmd, "count", &count) < 0 || count <= 0) {
vshError(ctl, "%s", _("Invalid number of virtual CPUs"));
goto cleanup;
}
--
1.7.8.6
12 years, 5 months
[libvirt] [PATCH] Add support for shared sanlock leases
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
A sanlock lease can be marked as shared (rather
than exclusive) using SANLK_RES_SHARED flag. This
adds support for that flag and ensures that in auto
disk mode, any shared disks use shared leases. This
also makes any read-only disks be completely
ignored.
These changes remove the need for the option
ignore_readonly_and_shared_disks
so that is removed
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/locking/lock_driver_sanlock.c | 38 +++++++++++--------------------
src/locking/sanlock.conf | 7 ------
src/locking/test_libvirt_sanlock.aug.in | 1 -
3 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c
index 146aefd..16941c9 100644
--- a/src/locking/lock_driver_sanlock.c
+++ b/src/locking/lock_driver_sanlock.c
@@ -65,7 +65,6 @@ struct _virLockManagerSanlockDriver {
bool requireLeaseForDisks;
int hostID;
bool autoDiskLease;
- bool ignoreReadonlyShared;
char *autoDiskLeasePath;
};
@@ -115,10 +114,6 @@ static int virLockManagerSanlockLoadConfig(const char *configFile)
CHECK_TYPE("auto_disk_leases", VIR_CONF_LONG);
if (p) driver->autoDiskLease = p->l;
- p = virConfGetValue(conf, "ignore_readonly_and_shared_disks");
- CHECK_TYPE("ignore_readonly_and_shared_disks", VIR_CONF_LONG);
- if (p) driver->ignoreReadonlyShared = p->l;
-
p = virConfGetValue(conf, "disk_lease_dir");
CHECK_TYPE("disk_lease_dir", VIR_CONF_STRING);
if (p && p->str) {
@@ -428,7 +423,8 @@ static int virLockManagerSanlockDiskLeaseName(const char *path,
static int virLockManagerSanlockAddLease(virLockManagerPtr lock,
const char *name,
size_t nparams,
- virLockManagerParamPtr params)
+ virLockManagerParamPtr params,
+ bool shared)
{
virLockManagerSanlockPrivatePtr priv = lock->privateData;
int ret = -1;
@@ -440,6 +436,7 @@ static int virLockManagerSanlockAddLease(virLockManagerPtr lock,
goto cleanup;
}
+ res->flags = shared ? SANLK_RES_SHARED : 0;
res->num_disks = 1;
if (!virStrcpy(res->name, name, SANLK_NAME_LEN)) {
virLockError(VIR_ERR_INTERNAL_ERROR,
@@ -485,7 +482,8 @@ cleanup:
static int virLockManagerSanlockAddDisk(virLockManagerPtr lock,
const char *name,
size_t nparams,
- virLockManagerParamPtr params ATTRIBUTE_UNUSED)
+ virLockManagerParamPtr params ATTRIBUTE_UNUSED,
+ bool shared)
{
virLockManagerSanlockPrivatePtr priv = lock->privateData;
int ret = -1;
@@ -503,6 +501,7 @@ static int virLockManagerSanlockAddDisk(virLockManagerPtr lock,
goto cleanup;
}
+ res->flags = shared ? SANLK_RES_SHARED : 0;
res->num_disks = 1;
if (virLockManagerSanlockDiskLeaseName(name, res->name, SANLK_NAME_LEN) < 0)
goto cleanup;
@@ -630,27 +629,15 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
return -1;
}
- if ((flags & (VIR_LOCK_MANAGER_RESOURCE_READONLY |
- VIR_LOCK_MANAGER_RESOURCE_SHARED)) &&
- driver->ignoreReadonlyShared) {
- return 0;
- }
-
- if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY) {
- virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Readonly leases are not supported"));
- return -1;
- }
- if (flags & VIR_LOCK_MANAGER_RESOURCE_SHARED) {
- virLockError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Shareable leases are not supported"));
- return -1;
- }
+ /* Treat R/O resources as a no-op lock request */
+ if (flags & VIR_LOCK_MANAGER_RESOURCE_READONLY)
+ return 0;
switch (type) {
case VIR_LOCK_MANAGER_RESOURCE_TYPE_DISK:
if (driver->autoDiskLease) {
- if (virLockManagerSanlockAddDisk(lock, name, nparams, params) < 0)
+ if (virLockManagerSanlockAddDisk(lock, name, nparams, params,
+ !!(flags & VIR_LOCK_MANAGER_RESOURCE_SHARED)) < 0)
return -1;
if (virLockManagerSanlockCreateLease(priv->res_args[priv->res_count-1]) < 0)
@@ -664,7 +651,8 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
break;
case VIR_LOCK_MANAGER_RESOURCE_TYPE_LEASE:
- if (virLockManagerSanlockAddLease(lock, name, nparams, params) < 0)
+ if (virLockManagerSanlockAddLease(lock, name, nparams, params,
+ !!(flags & VIR_LOCK_MANAGER_RESOURCE_SHARED)) < 0)
return -1;
break;
diff --git a/src/locking/sanlock.conf b/src/locking/sanlock.conf
index 19ab2b3..efc35ee 100644
--- a/src/locking/sanlock.conf
+++ b/src/locking/sanlock.conf
@@ -52,10 +52,3 @@
# to enabled, otherwise it defaults to disabled.
#
#require_lease_for_disks = 1
-
-#
-# Enable this flag to have sanlock ignore readonly and shared disks.
-# If disabled, then this rejects attempts to share resources until
-# sanlock gains support for shared locks.
-#
-#ignore_readonly_and_shared_disks = 1
diff --git a/src/locking/test_libvirt_sanlock.aug.in b/src/locking/test_libvirt_sanlock.aug.in
index 1f05558..288f329 100644
--- a/src/locking/test_libvirt_sanlock.aug.in
+++ b/src/locking/test_libvirt_sanlock.aug.in
@@ -6,4 +6,3 @@ module Test_libvirt_sanlock =
{ "disk_lease_dir" = "/var/lib/libvirt/sanlock" }
{ "host_id" = "1" }
{ "require_lease_for_disks" = "1" }
-{ "ignore_readonly_and_shared_disks" = "1" }
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] Allow NOCONFIGURE=1 to make autogen.sh skip ./configure
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Sometimes it is useful to re-bootstrap libvirt without running
through a ./configure invocation immediately. eg if you want
to run ./configure for Mingw32 rather than native.
---
autogen.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/autogen.sh b/autogen.sh
index f1591d8..95598e2 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -70,6 +70,8 @@ if test -d .git; then
fi
fi
+test -n "$NOCONFIGURE" && exit 0
+
cd "$THEDIR"
if test "x$OBJ_DIR" != x; then
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] Fix unused parameters / functions in virsh on Win32
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The vshPrintRaw function is not used on Win32, and neither
is the 'msg' parameter of vshAskReedit. Change the nesting
of #ifdef WIN32 conditionals to address this
---
tools/virsh.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 1b4f771..b84c4bc 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -655,6 +655,7 @@ vshReconnect(vshControl *ctl)
ctl->useSnapshotOld = false;
}
+#ifndef WIN32
static void
vshPrintRaw(vshControl *ctl, ...)
{
@@ -684,7 +685,6 @@ vshPrintRaw(vshControl *ctl, ...)
static int
vshAskReedit(vshControl *ctl, const char *msg)
{
-#ifndef WIN32
int c = -1;
struct termios ttyattr;
@@ -720,12 +720,16 @@ vshAskReedit(vshControl *ctl, const char *msg)
vshPrint(ctl, "\r\n");
return c;
+}
#else
+static int
+vshAskReedit(vshControl *ctl, const char *msg ATTRIBUTE_UNUSED)
+{
vshDebug(ctl, VSH_ERR_WARNING, "%s", _("This function is not "
"supported on WIN32 platform"));
return 0;
-#endif
}
+#endif
/* ---------------
* Commands
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] winsock2.h must always be included before windows.h
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Some GNULIB headers (eg unistd.h) will often need to include
winsock2.h for various symbols. There is a rule that winsock2.h
must be included before windows.h. This means that any file
which does
#ifdef WIN32
#include <windows.h>
#endif
#include <unistd.h>
is potentially broken. A simple rule is that /all/ includes of
windows.h must be matched with a preceeding include of winsock2.h
regardless of whether unistd.h is used currently
---
src/util/util.c | 3 +++
src/vbox/vbox_MSCOMGlue.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/util/util.c b/src/util/util.c
index 28a4fe7..a71b0d6 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -65,6 +65,9 @@
#endif
#ifdef WIN32
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
# include <shlobj.h>
#endif
diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c
index b07d6a7..68810fb 100644
--- a/src/vbox/vbox_MSCOMGlue.c
+++ b/src/vbox/vbox_MSCOMGlue.c
@@ -22,6 +22,9 @@
#include <config.h>
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
#include <windows.h>
#define nsCID CLSID
--
1.7.10.2
12 years, 5 months
[libvirt] [PATCH] Update to latest GNULIB to fix compat with Mingw64 toolchain
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
On both x86_64-w64-mingw32 and i686-w64-mingw32 there were
the following warnings/errors:
CC fstat.lo
../../../gnulib/lib/fstat.c:27:0: warning: "stat" redefined [enabled by default]
In file included from ./sys/stat.h:32:0,
from ../../../gnulib/lib/fstat.c:25:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition
../../../gnulib/lib/fstat.c:28:0: warning: "fstat" redefined [enabled by default]
In file included from ./sys/stat.h:32:0,
from ../../../gnulib/lib/fstat.c:25:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:259:0: note: this is the location of the previous definition
CC stat.lo
../../../gnulib/lib/stat.c:32:0: warning: "stat" redefined [enabled by default]
In file included from ./sys/stat.h:32:0,
from ../../../gnulib/lib/stat.c:27:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h:258:0: note: this is the location of the previous definition
CC stdio-read.lo
../../../gnulib/lib/stdio-read.c:102:1: error: redefinition of 'vscanf'
In file included from ./stdio.h:43:0,
from ../../../gnulib/lib/stdio-read.c:21:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:397:7: note: previous definition of 'vscanf' was here
../../../gnulib/lib/stdio-read.c:108:1: error: redefinition of 'vfscanf'
In file included from ./stdio.h:43:0,
from ../../../gnulib/lib/stdio-read.c:21:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:384:7: note: previous definition of 'vfscanf' was here
make[3]: *** [stdio-read.lo] Error 1
make[3]: Leaving directory `/home/berrange/src/virt/libvirt/build/gnulib/lib'
While on x86_64-w64-mingw32 only there was:
In file included from ../../../gnulib/lib/regex.c:69:0:
../../../gnulib/lib/regcomp.c: In function 'parse_dup_op':
../../../gnulib/lib/regcomp.c:2624:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
../../../gnulib/lib/regcomp.c: In function 'mark_opt_subexp':
../../../gnulib/lib/regcomp.c:3859:19: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
---
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index 77cef20..a02ba4b 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 77cef2022004c4066e805da09a83b2c77f17bdd3
+Subproject commit a02ba4bf889fee4622db87f185c3d0af84d74ae7
--
1.7.10.2
12 years, 5 months
[libvirt] KVM Forum and oVirt Workshop Europe 2012 Save the Date
by KVM Forum 2012 Program Committee
KVM is an industry leading open source hypervisor that provides an ideal
platform for datacenter virtualization, virtual desktop infrastructure,
and cloud computing. Once again, it's time to bring together the
community of developers and users that define the KVM ecosystem for
our annual technical conference. We will discuss the current state of
affairs and plan for the future of KVM, its surrounding infrastructure,
and management tools. We are also excited to announce the oVirt Workshop
will run in parallel with the KVM Forum, bringing in a community focused
on enterprise datacenter virtualization management built on KVM. So mark
your calendar and join us in advancing KVM.
Once again we are colocated with The Linux Foundation's LinuxCon,
Based on feedback from last year, this time it's LinuxCon Europe!
Conference: November 7 - 9, 2012
Location: Hotel Fira Palace - Barcelona, Spain
Details regarding registration and proposal submission are forthcoming.
thanks,
your KVM Forum 2012 Program Commitee
12 years, 5 months