[libvirt] [PATCH] Fix undefined reference to 'close_used_without_including_unistd_h'
by Matthias Bolte
Found while trying to cross-compile libvirt on Fedora 12 for Windows.
gnulib redefines 'close' to 'close_used_without_including_unistd_h'
in sys/socket.h if winsock2.h is present and unistd.h has not been
included before sys/socket.h. Reorder some includes to fix this.
---
src/conf/network_conf.c | 2 +-
src/remote/remote_driver.c | 10 +++++-----
src/util/util.h | 1 +
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index ab76f21..a64adf9 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -25,10 +25,10 @@
#include <config.h>
+#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <dirent.h>
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 23fd0e3..be51366 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -23,10 +23,6 @@
#include <config.h>
-/* Windows socket compatibility functions. */
-#include <errno.h>
-#include <sys/socket.h>
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -37,7 +33,11 @@
#include <sys/stat.h>
#include <fcntl.h>
-#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */
+/* Windows socket compatibility functions. */
+#include <errno.h>
+#include <sys/socket.h>
+
+#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */
# include <sys/un.h>
# include <net/if.h>
# include <netinet/in.h>
diff --git a/src/util/util.h b/src/util/util.h
index 49b27f2..d556daa 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -27,6 +27,7 @@
#include "verify.h"
#include "internal.h"
+#include <unistd.h>
#include <sys/select.h>
#include <sys/types.h>
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Fix argument type of virProcessInfoSetAffinity dummy function
by Matthias Bolte
---
src/util/processinfo.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/processinfo.c b/src/util/processinfo.c
index a0dac34..397848e 100644
--- a/src/util/processinfo.c
+++ b/src/util/processinfo.c
@@ -164,7 +164,7 @@ realloc:
#else /* HAVE_SCHED_GETAFFINITY */
int virProcessInfoSetAffinity(pid_t pid ATTRIBUTE_UNUSED,
- unsigned char *map ATTRIBUTE_UNUSED,
+ const unsigned char *map ATTRIBUTE_UNUSED,
size_t maplen ATTRIBUTE_UNUSED,
int maxcpu ATTRIBUTE_UNUSED)
{
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Fix compilation with configure --disable-nls
by Matthias Bolte
---
src/cpu/cpu.c | 4 ++--
src/cpu/cpu_map.c | 2 +-
src/qemu/qemu_monitor_json.c | 20 ++++++++++----------
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index e822f22..975ca28 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -48,7 +48,7 @@ cpuGetSubDriver(virConnectPtr conn,
if (arch == NULL) {
virCPUReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("undefined hardware architecture"));
+ "%s", _("undefined hardware architecture"));
return NULL;
}
@@ -130,7 +130,7 @@ cpuDecode(virConnectPtr conn,
if (cpu == NULL) {
virCPUReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("invalid CPU definition"));
+ "%s", _("invalid CPU definition"));
return -1;
}
diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c
index 067f6ff..d615e15 100644
--- a/src/cpu/cpu_map.c
+++ b/src/cpu/cpu_map.c
@@ -79,7 +79,7 @@ int cpuMapLoad(const char *arch,
if (arch == NULL) {
virCPUReportError(NULL, VIR_ERR_INTERNAL_ERROR,
- _("undefined hardware architecture"));
+ "%s", _("undefined hardware architecture"));
return -1;
}
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 03562e8..b96f4ac 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -645,7 +645,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
devices = virJSONValueObjectGet(reply, "return");
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats reply was missing device list"));
goto cleanup;
}
@@ -655,13 +655,13 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValuePtr stats;
const char *thisdev;
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
@@ -672,7 +672,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
found = 1;
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
stats->type != VIR_JSON_TYPE_OBJECT) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats stats entry was not in expected format"));
goto cleanup;
}
@@ -919,13 +919,13 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
char *statusstr;
if (!(ret = virJSONValueObjectGet(reply, "return"))) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("info migration reply was missing return data"));
return -1;
}
if (!(statusstr = virJSONValueObjectGetString(ret, "status"))) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("info migration reply was missing return status"));
return -1;
}
@@ -1214,25 +1214,25 @@ qemuMonitorJSONGetGuestAddress(virJSONValuePtr reply,
addr = virJSONValueObjectGet(reply, "return");
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add reply was missing device address"));
return -1;
}
if (virJSONValueObjectGetNumberUint(addr, "domain", guestDomain) < 0) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add reply was missing device domain number"));
return -1;
}
if (virJSONValueObjectGetNumberUint(addr, "bus", guestBus) < 0) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add reply was missing device bus number"));
return -1;
}
if (virJSONValueObjectGetNumberUint(addr, "slot", guestSlot) < 0) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add reply was missing device slot number"));
return -1;
}
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Fix configure check for SASL
by Matthias Bolte
The option --with-sasl defaults to 'check', but an inverted test logic
lets the SASL check fail with an error instead of disabling SASL.
Fix the test logic so SASL support gets disabled if SASL is missing and
--with-sasl is set to check.
---
configure.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index a86b8ca..c401111 100644
--- a/configure.in
+++ b/configure.in
@@ -613,7 +613,7 @@ if test "x$with_sasl" != "xno"; then
CFLAGS="$CFLAGS $SASL_CFLAGS"
LIBS="$LIBS $SASL_LIBS"
AC_CHECK_HEADER([sasl/sasl.h],[],[
- if test "x$with_sasl" != "xcheck" ; then
+ if test "x$with_sasl" = "xcheck" ; then
with_sasl=no
else
fail=1
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Fix GnuTLS pkg-config check
by Matthias Bolte
The testlogic for $PKG_CONFIG was inverted, checking for an empty string
before using PKG_CHECK_MODULES. Use -x instead of -z and add an else branch
to the if checking for $GNUTLS_FOUND = no to add -lgcrypt in case the
GnuTLS libraries are detected by pkg-config.
---
configure.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/configure.in b/configure.in
index 81548b8..a86b8ca 100644
--- a/configure.in
+++ b/configure.in
@@ -555,7 +555,7 @@ dnl GnuTLS library
GNUTLS_CFLAGS=
GNUTLS_LIBS=
GNUTLS_FOUND=no
-if test -z "$PKG_CONFIG" ; then
+if test -x "$PKG_CONFIG" ; then
PKG_CHECK_MODULES(GNUTLS, gnutls >= $GNUTLS_REQUIRED,
[GNUTLS_FOUND=yes], [GNUTLS_FOUND=no])
fi
@@ -572,6 +572,8 @@ if test "$GNUTLS_FOUND" = "no"; then
dnl it explicitly for the calls to gcry_control/check_version
GNUTLS_LIBS="$LIBS -lgcrypt"
LIBS="$old_libs"
+else
+ GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
fi
AC_SUBST([GNUTLS_CFLAGS])
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Define ATTRIBUTE_SENTINEL for GCC < 4.0 too
by Matthias Bolte
ATTRIBUTE_SENTINEL was defined for GCC >= 4.0 only, resulting in
compile errors when using GCC < 4.0.
---
src/internal.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/internal.h b/src/internal.h
index 09c19ea..5ca1fa3 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -100,6 +100,8 @@
#ifndef ATTRIBUTE_SENTINEL
#if __GNUC_PREREQ (4, 0)
#define ATTRIBUTE_SENTINEL __attribute__((__sentinel__))
+#else
+#define ATTRIBUTE_SENTINEL
#endif
#endif
--
1.6.0.4
14 years, 11 months
[libvirt] [PATCH] Disable JSON mode monitor until QEMU is more mature
by Daniel P. Berrange
* src/qemu/qemu_conf.h: Remove QEMU_CMD_FLAG_0_12 and just leave
the lone JSON flag
* src/qemu/qemu_conf.c: Enable JSON on QEMU 0.13 or later, but
leave it disabled for now
---
src/qemu/qemu_conf.c | 8 ++++++--
src/qemu/qemu_conf.h | 3 +--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 36bf9a2..0e66dd7 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1146,8 +1146,12 @@ static unsigned int qemudComputeCmdFlags(const char *help,
if (version >= 10000)
flags |= QEMUD_CMD_FLAG_0_10;
- if (version >= 12000)
- flags |= QEMUD_CMD_FLAG_0_12;
+ /* Keep disabled till we're actually ready to turn on JSON mode
+ * The plan is todo it in 0.13.0 QEMU, but lets wait & see... */
+#if 0
+ if (version >= 13000)
+ flags |= QEMUD_CMD_FLAG_MONITOR_JSON;
+#endif
return flags;
}
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index e958850..209cd31 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -76,8 +76,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_MIGRATE_QEMU_UNIX = (1 << 21), /* Does qemu support unix domain sockets for migration? */
QEMUD_CMD_FLAG_CHARDEV = (1 << 22), /* Is the new -chardev arg available */
QEMUD_CMD_FLAG_ENABLE_KVM = (1 << 23), /* Is the -enable-kvm flag available to "enable KVM full virtualization support" */
- QEMUD_CMD_FLAG_0_12 = (1 << 24),
- QEMUD_CMD_FLAG_MONITOR_JSON = QEMUD_CMD_FLAG_0_12, /* JSON mode for monitor */
+ QEMUD_CMD_FLAG_MONITOR_JSON = (1 << 24), /* JSON mode for monitor */
};
/* Main driver state */
--
1.6.5.2
14 years, 11 months
[libvirt] [PATCH] Add cpu_map.xml to libvirt.spec
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
libvirt.spec.in | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index dd067ad..e1d4e53 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -687,6 +687,8 @@ fi
%{_datadir}/libvirt/networks/default.xml
%endif
+%{_datadir}/libvirt/cpu_map.xml
+
%dir %{_localstatedir}/run/libvirt/
%dir %{_localstatedir}/lib/libvirt/
--
1.6.6.rc4
14 years, 11 months
[libvirt] [PATCH]: Make Xen VT-d PCI attach/detach work
by Chris Lalancette
All,
The Xen code for making HVM VT-d PCI passthrough attach and detach is
currently not properly working. There are 2 problems:
1) In xenDaemonAttachDevice(), we were always trying to reconfigure
a PCI passthrough device, even the first time we added it. This was
because the code in virDomainXMLDevID() was not checking xenstore for
the existence of the device, and always returning 0 (meaning that
the device already existed).
2) In xenDaemonDetachDevice(), we were trying to use "device_destroy"
to detach a PCI device. While you would think that is the right
method to call, it's actually wrong for PCI devices. In particular,
in upstream Xen (and soon in RHEL-5 Xen), device_configure is actually
used to destroy a PCI device.
The attached patch fixes both of these problems. To fix the attach
problem I add a lookup into xenstore to see if the device we are
trying to attach already exists. To fix the detach problem I change
it so that for PCI detach (only), we use device_configure with the
appropriate sxpr to do the detachment.
Tested by me on RHEL-5 on a VT-d capable machine, and, in combination
with the RHEL-5 xen patch, fixes the problem for me in testing.
(note: this solves https://bugzilla.redhat.com/show_bug.cgi?id=546671)
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
14 years, 11 months
Re: [libvirt] Author: Adam Litke <agl@us.ibm.com>
by Daniel Veillard
On Mon, Dec 21, 2009 at 09:21:43AM -0500, Adam Litke wrote:
> virsh: Document the dommemstat command in the virsh man page
>
> Provide a basic mention of the dommemstat command in the virsh man page. At
> first I thought it would be handy to describe the stats and their semantics,
> but the rest of the man page does not go into that kind of detail so I have
> omitted it here. In any case it is documented in the libvirt API.
>
> Signed-off-by: Adam Litke <agl(a)us.ibm.com>
> To: Daniel Veillard <veillard(a)redhat.com>
> Cc: libvir-list(a)redhat.com
>
> diff --git a/tools/virsh.pod b/tools/virsh.pod
> index 3830464..ee8cc11 100644
> --- a/tools/virsh.pod
> +++ b/tools/virsh.pod
> @@ -257,6 +257,10 @@ Get device block stats for a running domain.
>
> Get network interface stats for a running domain.
>
> +=item B<dommemstat> I<domain>
> +
> +Get memory stats for a running domain.
> +
> =item B<dominfo> I<domain-id>
>
> Returns basic information about the domain.
Okay, thanks ! applied :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 11 months