[libvirt] [PATCH] build: port vbox to cygwin
by Eric Blake
I have no idea if a Cygwin app can be made to directly interact with
VBoxXPCOMC.dll, but this at least lets compilation of vbox finish
rather than requiring me to ./configure --without-vbox.
* src/vbox/vbox_XPCOMCGlue.c (DYNLIB_NAME): Assume .dll under cygwin.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Although I'm tempted to push this under the build-breaker rule, and
although I suspect no one else is trying to build libvirt on cygwin,
I'll wait for a review on this one. An alternative, more conservative,
patch might be to hack configure.ac to declare vbox and cygwin as
incompatible.
src/vbox/vbox_XPCOMCGlue.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index 9719014..9cc41b0 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -3,6 +3,7 @@
*/
/*
+ * Copyright (C) 2013 Red Hat, Inc.
* Copyright (C) 2008-2009 Sun Microsystems, Inc.
*
* This file is part of a free software library; you can redistribute
@@ -54,7 +55,7 @@
# define DYNLIB_NAME "VBoxXPCOMC.so"
#elif defined(__APPLE__)
# define DYNLIB_NAME "VBoxXPCOMC.dylib"
-#elif defined(_MSC_VER) || defined(__OS2__)
+#elif defined(_MSC_VER) || defined(__OS2__) || defined(__CYGWIN__)
# define DYNLIB_NAME "VBoxXPCOMC.dll"
#else
# error "Port me"
--
1.8.1.4
11 years, 10 months
[libvirt] [PATCH 1/3] qemu: migration: Improve p2p error if we can't open conn
by Cole Robinson
By actually showing the Open() error to the user
---
src/qemu/qemu_migration.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 19b1236..9ac9be4 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3472,7 +3472,8 @@ static int doPeer2PeerMigrate(virQEMUDriverPtr driver,
qemuDomainObjExitRemote(vm);
if (dconn == NULL) {
virReportError(VIR_ERR_OPERATION_FAILED,
- _("Failed to connect to remote libvirt URI %s"), dconnuri);
+ _("Failed to connect to remote libvirt URI %s: %s"),
+ dconnuri, virGetLastErrorMessage());
virObjectUnref(cfg);
return -1;
}
--
1.8.2.1
11 years, 10 months
[libvirt] [PATCH] build: work around broken sasl header
by Eric Blake
Compilation on cygwin failed due to a bug in the sasl headers
present on that platform (libsasl2-devel 2.1.26):
In file included from rpc/virnetserverclient.c:27:0:
/usr/include/sasl/sasl.h:230:38: error: expected declaration specifiers or '...' before 'size_t'
* src/rpc/virnetserverclient.c (includes): Ensure size_t is
defined before using sasl.h.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
src/rpc/virnetserverclient.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 0bd88ad..2fc4838 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -1,7 +1,7 @@
/*
* virnetserverclient.c: generic network RPC server client
*
- * Copyright (C) 2006-2011 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
@@ -23,6 +23,7 @@
#include <config.h>
+#include "internal.h"
#if WITH_SASL
# include <sasl/sasl.h>
#endif
--
1.8.1.4
11 years, 10 months
[libvirt] [PATCH] build: fix build without libvirtd
by Eric Blake
Building when configured --with-libvirtd=no fails with:
In file included from ../src/qemu/qemu_command.h:30:0,
from testutilsqemu.h:4,
from networkxml2xmltest.c:14:
../src/qemu/qemu_conf.h:175:5: error: expected specifier-qualifier-list before 'virStateInhibitCallback'
* src/libvirt_internal.h (virStateInhibitCallback): Move outside
of conditional.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under build-breaker rule
src/libvirt_internal.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h
index 5c83ffa..29f2043 100644
--- a/src/libvirt_internal.h
+++ b/src/libvirt_internal.h
@@ -1,7 +1,7 @@
/*
- * libvirt.h: publically exported APIs, not for public use
+ * libvirt_internal.h: internally exported APIs, not for public use
*
- * Copyright (C) 2006-2008, 2011 Red Hat, Inc.
+ * Copyright (C) 2006-2013 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -27,10 +27,10 @@
# include "internal.h"
-# ifdef WITH_LIBVIRTD
typedef void (*virStateInhibitCallback)(bool inhibit,
void *opaque);
+# ifdef WITH_LIBVIRTD
int virStateInitialize(bool privileged,
virStateInhibitCallback inhibit,
void *opaque);
--
1.8.1.4
11 years, 10 months
[libvirt] [PATCH] build: fix build with newer gnutls
by Eric Blake
Building with gnutls 3.2.0 (such as shipped with current cygwin) fails
with:
rpc/virnettlscontext.c: In function 'virNetTLSSessionGetKeySize':
rpc/virnettlscontext.c:1358:5: error: implicit declaration of function 'gnutls_cipher_get_key_size' [-Wimplicit-function-declaration]
Yeah, it's stupid that gnutls broke API by moving their declaration
into a new header without including that header from the old one,
but it's easy enough to work around, all without breaking on gnutls
1.4.1 (hello RHEL 5) that lacked the new header.
* src/rpc/virnettlscontext.c (includes): Include additional header.
* configure.ac (gnutls): Check for <gnutls/crypto.h>.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule, once my testing completes
across multiple systems with various gnutls versions (1.4.1 in
RHEL5, 2.12.23 in Fedora 18, 3.2.0 in Cygwin).
configure.ac | 1 +
src/rpc/virnettlscontext.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/configure.ac b/configure.ac
index 7041710..0b3d028 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1087,6 +1087,7 @@ if test "x$with_gnutls" != "xno"; then
if test "$GNUTLS_FOUND" = "no"; then
fail=0
AC_CHECK_HEADER([gnutls/gnutls.h], [], [fail=1])
+ AC_CHECK_HEADERS([gnutls/crypto.h])
AC_CHECK_LIB([gnutls], [gnutls_handshake],[], [fail=1], [-lgcrypt])
test $fail = 0 && GNUTLS_FOUND=yes
diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
index e29c439..f2ac551 100644
--- a/src/rpc/virnettlscontext.c
+++ b/src/rpc/virnettlscontext.c
@@ -25,6 +25,9 @@
#include <stdlib.h>
#include <gnutls/gnutls.h>
+#if HAVE_GNULTLS_CRYPTO_H
+# include <gnutls/crypto.h>
+#endif
#include <gnutls/x509.h>
#include "gnutls_1_0_compat.h"
--
1.8.1.4
11 years, 10 months
Re: [libvirt] [PATCH] target-i386: Disable CPUID_EXT_MONITOR when KVM is enabled
by Eduardo Habkost
(CCing libvirt people)
On Tue, May 28, 2013 at 06:48:52PM +0200, Andreas Färber wrote:
> Am 28.05.2013 18:46, schrieb Paolo Bonzini:
> > Il 28/05/2013 18:34, Bandan Das ha scritto:
> >> Eduardo Habkost <ehabkost(a)redhat.com> writes:
> >>
> >>> On Mon, May 27, 2013 at 02:21:36PM +0200, Paolo Bonzini wrote:
> >>>> Il 27/05/2013 14:09, Eduardo Habkost ha scritto:
> >>>>> On Sat, May 25, 2013 at 08:25:49AM +0200, Paolo Bonzini wrote:
> >>>>>> Il 25/05/2013 03:21, Bandan Das ha scritto:
> >>>>>>> There is one user-visible effect: "-cpu ...,enforce" will stop failing
> >>>>>>> because of missing KVM support for CPUID_EXT_MONITOR. But that's exactly
> >>>>>>> the point: there's no point in having CPU model definitions that would
> >>>>>>> never work as-is with neither TCG or KVM. This patch is changing the
> >>>>>>> meaning of (e.g.) "-machine ...,accel=kvm -cpu Opteron_G3" to match what
> >>>>>>> was already happening in practice.
> >>>>>>
> >>>>>> But then -cpu Opteron_G3 does not match a "real" Opteron G3. Is it
> >>>>>> worth it?
> >>>>>
> >>>>> No models match a "real" CPU this way, because neither TCG or KVM
> >>>>> support all features supported by a real CPU. I ask the opposite
> >>>>> question: is it worth maintaining an "accurate" CPU model definition
> >>>>> that would never work without feature-bit tweaking in the command-line?
> >>>>
> >>>> It would work with TCG. Changing TCG to KVM should not change hardware
> >>>> if you use "-cpu ...,enforce", so it is right that it fails when
> >>>> starting with KVM.
> >>>>
> >>>
> >>> Changing between KVM and TCG _does_ change hardware, today (with or
> >>> without check/enforce). All CPU models on TCG have features not
> >>> supported by TCG automatically removed. See the "if (!kvm_enabled())"
> >>> block at x86_cpu_realizefn().
> >>
> >> Yes, this is exactly why I was inclined to remove the monitor flag.
> >> We already have uses of kvm_enabled() to set (or remove) kvm specific stuff,
> >> and this change is no different.
> >
> > Do any of these affect something that is part of x86_def_t?
>
> The vendor comes to mind.
I believe we can still consider the "vendor" field a special one: if
other components care about the TCG/KVM difference regarding the
"vendor" field, they can simply set "vendor" explicitly on the
command-line.
> >> I can see Paolo's point though, having
> >> a common definition probably makes sense too.
> >
Paolo is convincing me that keeping the rest of the features exactly the
same on TCG and KVM modes (and making check/enforce work for TCG as
well) would simplify the logic a lot. This will add a little extra work
for libvirt, that will probably need to use "-cpu Opteron_G3,-monitor"
once it implements enforce-mode (to make sure the results really match
existing libvirt assumptions about the Opteron_G* models), but it is
probably worth it.
I will give it a try and send a proposal soon.
> >>> (That's why I argue that we need separate classes/names for TCG and KVM
> >>> modes. Otherwise our predefined models get less useful as they will
> >>> require low-level feature-bit fiddling on the libvirt side to make them
> >>> work as expected.)
> >>
> >> Agreed. From a user's perspective, I think the more a CPU model "just works",
> >> whether it's KVM or TCG, the better.
> >
> > Yes, that's right. But I think extending the same expectation to "-cpu
> > ...,enforce" is not necessary, and perhaps even wrong for "-cpu
> > ...,check" since it's only a warning rather than a fatal error.
> >
> > Paolo
> >
>
>
> --
> SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
--
Eduardo
11 years, 10 months
[libvirt] [PATCH] qemu: match vcpu topology to maximum vcpu numbers.
by Guannan Ren
For qemu, if the -smp N or the value of maxcpus is given, it define
the number of vcpu of guest whenever the vcpu topology is defined or
not. But if the -smp N and maxcpus are missing, the topology can
compute and define vcpus for guest automatically by math:
vcpu number = sockets*cores*threads
For libvirt, as <vcpu> is always mandatory, so we can ask topology
to match maximum vcpu numbers.
---
src/conf/domain_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a9656af..ffdc6da 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11815,10 +11815,10 @@ virDomainDefParseXML(xmlDocPtr xml,
goto error;
if (def->cpu->sockets &&
- def->maxvcpus >
+ def->maxvcpus !=
def->cpu->sockets * def->cpu->cores * def->cpu->threads) {
virReportError(VIR_ERR_XML_DETAIL, "%s",
- _("Maximum CPUs greater than topology limit"));
+ _("Topology limit does not match maximum CPUs"));
goto error;
}
--
1.8.1.4
11 years, 10 months
[libvirt] [PATCH 00/12 v2] storage_conf: left cleanup/fixes/improvement patches
by Osier Yang
Part of v1 are pushed, the left patches are splitted
Osier Yang (12):
storage_conf: Fix the wrong error message
storage_conf: Don't leak "uuid" in virStoragePoolDefParseAuthCephx
storage_conf: Remove the useless casting
storage_conf: Use xmlStrEqual instead of STREQ
storage_conf: Put "%s" at the same line with error type
storage_conf: Fix the error type
storage_conf: Improve the memory deallocation of pool def parsing
storage_conf: Improve the memory deallocation of
virStorageVolDefParseXML
storage_conf: Use NULLSTR instead
storage_conf: Use VIR_STRDUP instead of strdup
storage_conf: Improve error messages
storage_conf: Use uid_t/gid_t instead of int to cast the value
src/conf/storage_conf.c | 242 ++++++++++++++++++++++++------------------------
1 file changed, 122 insertions(+), 120 deletions(-)
--
1.8.1.4
11 years, 10 months
[libvirt] Put the audio work on Windows 2008 Server 64bits
by Carlos Rodrigues
Hello,
I am trying to put the audio audio work on Windows 2008 Server with
64bits but without success.
I have tested with sound model ac97 and hda, and i always get the same error:
the devices appears on Windows Device Manager with following message -
"Windows cannot load the device driver for this hardware.
The driver may be corrupted or missing. (Code 39)".
I have qemu-kvm 1.2 and libvirt 0.10.2.
I also tried different drivers with different sound model combinations
but no success.
Any suggestion of drivers that can i use and how can i get audio device
working?
Best Regards,
--
Carlos Rodrigues <cmar(a)eurotux.com>
Engenheiro de Software Sénior
Eurotux Informática, S.A. | www.eurotux.com
(t) +351 253 680 300
11 years, 10 months
[libvirt] [PATCH v2] qemuOpenVhostNet: Decrease vhostfdSize on open failure
by Michal Privoznik
Currently, if there's an error opening /dev/vhost-net (e.g. because
it doesn't exist) but it's not required we proceed with vhostfd array
filled with -1 and vhostfdSize unchanged. Later, when constructing
the qemu command line only non-negative items within vhostfd array
are taken into account. This means, vhostfdSize may be greater than
the actual count of non-negative items in vhostfd array. This results
in improper command line arguments being generated, e.g.:
-netdev tap,fd=21,id=hostnet0,vhost=on,vhostfd=(null)
---
src/qemu/qemu_command.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0373626..c4a162a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -486,6 +486,10 @@ qemuOpenVhostNet(virDomainDefPtr def,
"but is unavailable"));
goto error;
}
+ VIR_WARN("Unable to open vhost-net. Opened so far %d, requested %d",
+ i, *vhostfdSize);
+ *vhostfdSize = i;
+ break;
}
}
virDomainAuditNetDevice(def, net, "/dev/vhost-net", *vhostfdSize);
@@ -6560,12 +6564,10 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
}
for (i = 0; i < vhostfdSize; i++) {
- if (vhostfd[i] >= 0) {
- virCommandTransferFD(cmd, vhostfd[i]);
- if (virAsprintf(&vhostfdName[i], "%d", vhostfd[i]) < 0) {
- virReportOOMError();
- goto cleanup;
- }
+ virCommandTransferFD(cmd, vhostfd[i]);
+ if (virAsprintf(&vhostfdName[i], "%d", vhostfd[i]) < 0) {
+ virReportOOMError();
+ goto cleanup;
}
}
--
1.8.2.1
11 years, 10 months