Re: [libvirt] OSX 10.6 build failures
by Osier
----- "Justin Clift" <jclift(a)redhat.com> wrote:
> From: "Justin Clift" <jclift(a)redhat.com>
> To: "Libvirt Developers Mailing List" <libvir-list(a)redhat.com>
> Sent: Wednesday, September 15, 2010 7:42:48 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
> Subject: [libvirt] OSX 10.6 build failures
>
> Hi us,
>
> Going through the process of getting libvirt to compile on OSX, making
>
> notes of the failures on the way through (from a clean system) to be
> fixed.
>
> a) libtool -> glibtool
> libtoolize -> glibtoolize
>
> It turns out that autogen.sh is hard coded to use "libtool", and
> wants the GNU version.
>
> OSX supplies has it's own version, without a --version option, so
> autogen.sh fails.
>
> Installing GNU libtool through MacPorts, makes it available as
> glibtool, with libtoolize being glibtoolize.
>
> Adjusting autogen.sh to detect that, then set LIBTOOL and
> LIBTOOLIZE
> appropriately was fairly trivial.
>
> Will submit a patch to fix that in a bit.
>
>
> b) pkg-config
>
> The next thing to barf was autoconf, complaining about
> AC_MSG_ERROR
> not being a defined macro.
>
> Googling with some persistence showed this is caused by
> pkg-config
> not being installed. Fixed that.
>
> Will submit a patch for that too. Probably "pkg-config
> --version"
> based, copying the approach used for the other autogen.sh checks.
>
>
> c) This is a compilation failure, one I don't readily know how to
> fix:
>
> ...
> Making all in src
> make all-am
> CC libvirt_util_la-network.lo
> util/network.c: In function 'getIPv6Addr':
> util/network.c:50: error: 'struct in6_addr' has no member named
> 's6_addr16'
> util/network.c:50: error: 'struct in6_addr' has no member named
> 's6_addr16'
> util/network.c:50: error: 'struct in6_addr' has no member named
> 's6_addr16'
> util/network.c:50: error: 'struct in6_addr' has no member named
> 's6_addr16'
> make[3]: *** [libvirt_util_la-network.lo] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> $
>
> They're the only problems so far, though most things have been
> disabled
> on the ./configure line so it's only the client libraries being
> built.
>
> Anyone know how to address that third one?
>
% man ipv6
Address Format
struct sockaddr_in6 {
sa_family_t sin6_family; /* AF_INET6 */
in_port_t sin6_port; /* port number */
uint32_t sin6_flowinfo; /* IPv6 flow information */
struct in6_addr sin6_addr; /* IPv6 address */
uint32_t sin6_scope_id; /* Scope ID (new in 2.4) */
};
struct in6_addr {
unsigned char s6_addr[16]; /* IPv6 address */
};
% vim libvirt/src/util/network.c
43 static int getIPv6Addr(virSocketAddrPtr addr, virIPv6AddrPtr tab) {
44 int i;
45
46 if ((addr == NULL) || (tab == NULL) || (addr->stor.ss_family != AF_INET6 ))
47 return(-1);
48
49 for (i = 0;i < 8;i++) {
50 (*tab)[i] = ntohs(addr->inet6.sin6_addr.s6_addr16[i]);
51 }
52
53 return(0);
54 }
I guess it's a typo, should be "addr->inet6.sin6_addr.s6_addr[i]", but not
"addr->inet6.sin6_addr.s6_addr16[i]".. :-)
- Osier
> Regards and best wishes,
>
> Justin Clift
>
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
14 years, 8 months
Re: [libvirt] [PATCH] autogen.sh: added glibtool and pkg-config checks
by Bruce Korb
Please don't use my project name when talking
about bootstrap process. "autogen.sh" has become
a popular misnomer, so at least keep the ".sh" suffix. Thanks.
On Wed, Sep 15, 2010 at 10:02 AM, Eric Blake <eblake(a)redhat.com> wrote:
> [adding bug-gnulib]
>
> On 09/15/2010 06:36 AM, Justin Clift wrote:
>>
>> OSX MacPorts has libtool named as glibtool, with libtoolize
>> named as glibtoolize. This patch adds support for this, and also
>> adds a check for pkg-config, to warn when it is missing.
>
> Hmm - would it be easier to make bootstrap.conf list pkg-config as a
> prerequisite, rather than having to hack up autogen.sh to do that?
>
> Also, if I'm reading the code right, changing bootstrap.conf to list
> 'libtoolize' instead of 'libtool' as the prerequisite will let you get by
> with overriding just $LIBTOOLIZE instead of both $LIBTOOL and $LIBTOOLIZE.
>
> Additionally it may be sufficient to just teach upstream
> gnulib/build-aux/bootstrap to use 'find_tool LIBTOOLIZE libtoolize
> glibtoolize', at which point re-syncing to upstream bootstrap will
> automatically pick up on the right libtool for MacOS without you having to
> hack libvirt's autogen.sh in the first place :)
>
> So, NACK to this version of the libvirt patch, and instead let me do some
> gnulib work... Not to mention that Gary is working on some upstream patches
> to improve bootstrap modularity, and there is also a request to add
> 'bootstrap --skip-git' that I need to respond to...
>
> --
> Eric Blake eblake(a)redhat.com +1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
>
14 years, 8 months
[libvirt] [PATCH] libvirtd: improve the error message displayed on tls client auth failure
by Justin Clift
This address BZ # 556599:
https://bugzilla.redhat.com/show_bug.cgi?id=556599
---
daemon/libvirtd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 711360b..46e22bd 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -1226,7 +1226,7 @@ remoteCheckCertificate (gnutls_session_t session)
if (i == 0) {
if (!remoteCheckDN (cert)) {
/* This is the most common error: make it informative. */
- VIR_ERROR0(_("remoteCheckCertificate: client's Distinguished Name is not on the list of allowed clients (tls_allowed_dn_list). Use 'openssl x509 -in clientcert.pem -text' to view the Distinguished Name field in the client certificate, or run this daemon with --verbose option."));
+ VIR_ERROR0(_("remoteCheckCertificate: client's Distinguished Name is not on the list of allowed clients (tls_allowed_dn_list). Use 'certtool -i --infile clientcert.pem' to view the Distinguished Name field in the client certificate, or run this daemon with --verbose option."));
gnutls_x509_crt_deinit (cert);
return -1;
}
--
1.7.2.2
14 years, 8 months
[libvirt] [PATCH] maint: silence warning from libtool
by Eric Blake
I got tired of seeing this:
config.status: executing libtool commands
/bin/rm: cannot remove `libtoolT': No such file or directory
config.status: executing po-directories commands
While I was at it, there were a couple other unused variables.
* configure.ac (RM, MV, TAR): Drop; nothing in libvirt directly uses
this, and assigning RM interferes with libtool.
---
configure.ac | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index a71f5e8..5ded22b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,9 +122,6 @@ AM_CONDITIONAL([HAVE_GLIBC_RPCGEN],
$ac_cv_path_RPCGEN -t </dev/null >/dev/null 2>&1])
dnl Miscellaneous external programs.
-AC_PATH_PROG([RM], [rm], [/bin/rm])
-AC_PATH_PROG([MV], [mv], [/bin/mv])
-AC_PATH_PROG([TAR], [tar], [/bin/tar])
AC_PATH_PROG([XMLLINT], [xmllint], [/usr/bin/xmllint])
AC_PATH_PROG([XMLCATALOG], [xmlcatalog], [/usr/bin/xmlcatalog])
AC_PATH_PROG([XSLTPROC], [xsltproc], [/usr/bin/xsltproc])
--
1.7.2.2
14 years, 8 months
[libvirt] [PATCH] Rebuild network filter for UML guests on updates
by Soren Hansen
When nwfilter support was added to UML, I didn't realise the UML driver
needed instrumentation to make updating nwfilters on the fly work. This
patch adds this bit of glue.
Signed-off-by: Soren Hansen <soren(a)linux2go.dk>
---
src/uml/uml_driver.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 40345d5..9101928 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2198,6 +2198,18 @@ static virDriver umlDriver = {
NULL, /* qemuDomainMonitorCommand */
};
+static int
+umlVMFilterRebuild(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virHashIterator iter, void *data)
+{
+ struct uml_driver *driver = uml_driver;
+
+ umlDriverLock(driver);
+ virHashForEach(uml_driver->domains.objs, iter, data);
+ umlDriverUnlock(driver);
+
+ return 0;
+}
static virStateDriver umlStateDriver = {
.name = "UML",
@@ -2207,8 +2219,14 @@ static virStateDriver umlStateDriver = {
.active = umlActive,
};
+static virNWFilterCallbackDriver umlCallbackDriver = {
+ .name = "UML",
+ .vmFilterRebuild = umlVMFilterRebuild,
+};
+
int umlRegister(void) {
virRegisterDriver(¨Driver);
virRegisterStateDriver(¨StateDriver);
+ virNWFilterRegisterCallbackDriver(¨CallbackDriver);
return 0;
}
--
1.7.1
14 years, 8 months
[libvirt] [PATCH] virsh: Use virBuffer for generating XML
by Jiri Denemark
cmdAttachInterface and cmdAttachDisk still used vshRealloc and sprintf
for generating XML, which is hardly maintainable. Let's get rid of this
old code.
---
tools/virsh.c | 152 ++++++++++++++++++++------------------------------------
1 files changed, 54 insertions(+), 98 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 57ea618..9eb1e51 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -7874,8 +7874,9 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom = NULL;
char *mac, *target, *script, *type, *source;
int typ, ret = FALSE;
- char *buf = NULL, *tmp = NULL;
unsigned int flags;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ char *xml;
if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
@@ -7903,52 +7904,40 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
}
/* Make XML of interface */
- tmp = vshMalloc(ctl, 1);
- buf = vshMalloc(ctl, strlen(type) + 25);
- sprintf(buf, " <interface type='%s'>\n" , type);
+ virBufferVSprintf(&buf, "<interface type='%s'>\n" , type);
- tmp = vshRealloc(ctl, tmp, strlen(source) + 28);
- if (typ == 1) {
- sprintf(tmp, " <source network='%s'/>\n", source);
- } else if (typ == 2) {
- sprintf(tmp, " <source bridge='%s'/>\n", source);
- }
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
+ if (typ == 1)
+ virBufferVSprintf(&buf, " <source network='%s'/>\n", source);
+ else if (typ == 2)
+ virBufferVSprintf(&buf, " <source bridge='%s'/>\n", source);
- if (target != NULL) {
- tmp = vshRealloc(ctl, tmp, strlen(target) + 24);
- sprintf(tmp, " <target dev='%s'/>\n", target);
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
- }
+ if (target != NULL)
+ virBufferVSprintf(&buf, " <target dev='%s'/>\n", target);
+ if (mac != NULL)
+ virBufferVSprintf(&buf, " <mac address='%s'/>\n", mac);
+ if (script != NULL)
+ virBufferVSprintf(&buf, " <script path='%s'/>\n", script);
- if (mac != NULL) {
- tmp = vshRealloc(ctl, tmp, strlen(mac) + 25);
- sprintf(tmp, " <mac address='%s'/>\n", mac);
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
- }
+ virBufferAddLit(&buf, "</interface>\n");
- if (script != NULL) {
- tmp = vshRealloc(ctl, tmp, strlen(script) + 25);
- sprintf(tmp, " <script path='%s'/>\n", script);
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
+ if (virBufferError(&buf)) {
+ vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+ return FALSE;
}
- buf = vshRealloc(ctl, buf, strlen(buf) + 19);
- strcat(buf, " </interface>\n");
+ xml = virBufferContentAndReset(&buf);
if (vshCommandOptBool(cmd, "persistent")) {
flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
if (virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
- ret = virDomainAttachDeviceFlags(dom, buf, flags);
+ ret = virDomainAttachDeviceFlags(dom, xml, flags);
} else {
- ret = virDomainAttachDevice(dom, buf);
+ ret = virDomainAttachDevice(dom, xml);
}
+ VIR_FREE(xml);
+
if (ret != 0) {
vshError(ctl, "%s", _("Failed to attach interface"));
ret = FALSE;
@@ -7960,8 +7949,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
cleanup:
if (dom)
virDomainFree(dom);
- VIR_FREE(buf);
- VIR_FREE(tmp);
+ virBufferFreeAndReset(&buf);
return ret;
}
@@ -8126,9 +8114,10 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom = NULL;
char *source, *target, *driver, *subdriver, *type, *mode;
int isFile = 0, ret = FALSE;
- char *buf = NULL, *tmp = NULL;
unsigned int flags;
char *stype;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ char *xml;
if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
@@ -8167,77 +8156,45 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
}
/* Make XML of disk */
- tmp = vshMalloc(ctl, 1);
- buf = vshMalloc(ctl, 23);
- if (isFile) {
- sprintf(buf, " <disk type='file'");
- } else {
- sprintf(buf, " <disk type='block'");
- }
-
- if (type) {
- tmp = vshRealloc(ctl, tmp, strlen(type) + 13);
- sprintf(tmp, " device='%s'>\n", type);
- } else {
- tmp = vshRealloc(ctl, tmp, 3);
- sprintf(tmp, ">\n");
- }
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
-
- if (driver) {
- tmp = vshRealloc(ctl, tmp, strlen(driver) + 22);
- sprintf(tmp, " <driver name='%s'", driver);
- } else {
- tmp = vshRealloc(ctl, tmp, 25);
- sprintf(tmp, " <driver name='phy'");
- }
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
-
- if (subdriver) {
- tmp = vshRealloc(ctl, tmp, strlen(subdriver) + 12);
- sprintf(tmp, " type='%s'/>\n", subdriver);
- } else {
- tmp = vshRealloc(ctl, tmp, 4);
- sprintf(tmp, "/>\n");
- }
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
-
- tmp = vshRealloc(ctl, tmp, strlen(source) + 25);
- if (isFile) {
- sprintf(tmp, " <source file='%s'/>\n", source);
- } else {
- sprintf(tmp, " <source dev='%s'/>\n", source);
- }
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
-
- tmp = vshRealloc(ctl, tmp, strlen(target) + 24);
- sprintf(tmp, " <target dev='%s'/>\n", target);
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
+ virBufferVSprintf(&buf, "<disk type='%s'",
+ (isFile) ? "file" : "block");
+ if (type)
+ virBufferVSprintf(&buf, " device='%s'", type);
+ virBufferAddLit(&buf, ">\n");
+
+ virBufferVSprintf(&buf, " <driver name='%s'",
+ (driver) ? driver : "phy");
+ if (subdriver)
+ virBufferVSprintf(&buf, " type='%s'", subdriver);
+ virBufferAddLit(&buf, "/>\n");
+
+ virBufferVSprintf(&buf, " <source %s='%s'/>\n",
+ (isFile) ? "file" : "dev",
+ source);
+ virBufferVSprintf(&buf, " <target dev='%s'/>\n", target);
+ if (mode)
+ virBufferVSprintf(&buf, " <%s/>\n", mode);
+
+ virBufferAddLit(&buf, "</disk>\n");
- if (mode != NULL) {
- tmp = vshRealloc(ctl, tmp, strlen(mode) + 11);
- sprintf(tmp, " <%s/>\n", mode);
- buf = vshRealloc(ctl, buf, strlen(buf) + strlen(tmp) + 1);
- strcat(buf, tmp);
+ if (virBufferError(&buf)) {
+ vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
+ return FALSE;
}
- buf = vshRealloc(ctl, buf, strlen(buf) + 13);
- strcat(buf, " </disk>\n");
+ xml = virBufferContentAndReset(&buf);
if (vshCommandOptBool(cmd, "persistent")) {
flags = VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
if (virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_DEVICE_MODIFY_LIVE;
- ret = virDomainAttachDeviceFlags(dom, buf, flags);
+ ret = virDomainAttachDeviceFlags(dom, xml, flags);
} else {
- ret = virDomainAttachDevice(dom, buf);
+ ret = virDomainAttachDevice(dom, xml);
}
+ VIR_FREE(xml);
+
if (ret != 0) {
vshError(ctl, "%s", _("Failed to attach disk"));
ret = FALSE;
@@ -8249,8 +8206,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
cleanup:
if (dom)
virDomainFree(dom);
- VIR_FREE(buf);
- VIR_FREE(tmp);
+ virBufferFreeAndReset(&buf);
return ret;
}
--
1.7.2.3
14 years, 8 months
[libvirt] [PATCH] Use SED variable for `sed` binary in src/Makefile
by Mitchell Hashimoto
Hi,
I've been trying to get libvirt (client) to cleanly/easily compile on
BSD-based systems (in this case OS X). "./configure" runs fine but the
"make" caused an error with `sed` since BSD sed was reporting some sort of
regex error. I realized that the "SED" variable was populated with "gsed"
which worked properly. This made the make continue (failed again later, will
address that when I can).
This is my first contribution to a C-based project and I don't have much
experience with autotools other than using them as a consumer. Let me know
if anything can be improved.
Thank you,
Mitchell
14 years, 8 months
[libvirt] [PATCH 0/3] test cases for spoofing prevention
by gstenzel@linux.vnet.ibm.com
The following patches add a set of test cases to verify that several spoofing attacks are prevented by the nwfilter subsystem.
In order to have a well defined test machine a virtual disk is installed from scratch over the network.
I am currently trying to find a suitable location for the kickstart file.
--
Best regards,
Gerhard Stenzel,
-----------------------------------------------------------------------------------------------------------------------------------
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
14 years, 8 months