[Libvir] 3/8 Enable the duplicate-"the" test; fix violations
by Jim Meyering
Enable the duplicate-"the" test; fix violations
* Makefile.cfg (local-checks-to-skip) [sc_the_the]: Enable.
* docs/virsh.pod: Remove a duplicate "the".
* libvirt.spec.in: Likewise.
* virsh.1: Likewise.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.cfg | 1 -
docs/virsh.pod | 2 +-
libvirt.spec.in | 2 +-
virsh.1 | 2 +-
4 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/Makefile.cfg b/Makefile.cfg
index f1194d1..ba59f29 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -54,7 +54,6 @@ local-checks-to-skip = \
sc_space_tab \
sc_sun_os_names \
sc_system_h_headers \
- sc_the_the \
sc_two_space_separator_in_usage \
sc_useless_cpp_parens \
patch-check \
diff --git a/docs/virsh.pod b/docs/virsh.pod
index 8166db7..8f4086c 100644
--- a/docs/virsh.pod
+++ b/docs/virsh.pod
@@ -327,7 +327,7 @@ anymore.
=item B<resume> I<domain-id>
Moves a domain out of the suspended state. This will allow a previously
-suspended domain to now be eligible for scheduling by the the underlying
+suspended domain to now be eligible for scheduling by the underlying
hypervisor.
=item B<ttyconsole> I<domain-id>
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 9b3fa67..8e918b9 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -75,7 +75,7 @@ Obsoletes: libvir-python
%description python
The libvirt-python package contains a module that permits applications
written in the Python programming language to use the interface
-supplied by the libvirt library to use the the virtualization capabilities
+supplied by the libvirt library to use the virtualization capabilities
of recent versions of Linux (and other OSes).
%prep
diff --git a/virsh.1 b/virsh.1
index 09df396..fa4675c 100644
--- a/virsh.1
+++ b/virsh.1
@@ -409,7 +409,7 @@ anymore.
.IP "\fBresume\fR \fIdomain-id\fR" 4
.IX Item "resume domain-id"
Moves a domain out of the suspended state. This will allow a previously
-suspended domain to now be eligible for scheduling by the the underlying
+suspended domain to now be eligible for scheduling by the underlying
hypervisor.
.IP "\fBttyconsole\fR \fIdomain-id\fR" 4
.IX Item "ttyconsole domain-id"
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 1/8 remove useless "if (foo)" tests
by Jim Meyering
Given code like if (foo) free (foo); remove the useless "if (foo) " part.
Likewise, given if (foo != NULL) free (foo); remove the useless "if" test.
* proxy/libvirt_proxy.c: Remove unnecessary "if" test before free.
* python/generator.py: Likewise.
* qemud/qemud.c: Likewise.
* src/buf.c: Likewise.
* src/conf.c: Likewise.
* src/hash.c: Likewise.
* src/iptables.c: Likewise.
* src/libvirt.c: Likewise.
* src/openvz_conf.c: Likewise.
* src/qemu_conf.c: Likewise.
* src/qemu_driver.c: Likewise.
* src/remote_internal.c: Likewise.
* src/test.c: Likewise.
* src/virsh.c: Likewise.
* src/virterror.c: Likewise.
* src/xen_internal.c: Likewise.
* src/xen_unified.c: Likewise.
* src/xend_internal.c: Likewise.
* src/xm_internal.c: Likewise.
* src/xml.c: Likewise.
* src/xmlrpc.c: Likewise.
* src/xs_internal.c: Likewise.
* tests/testutils.c: Likewise.
* tests/xencapstest.c: Likewise.
* tests/xmconfigtest.c: Likewise.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
proxy/libvirt_proxy.c | 3 +-
python/generator.py | 2 +-
qemud/qemud.c | 5 +--
src/buf.c | 3 +-
src/conf.c | 7 +----
src/hash.c | 15 ++++---------
src/iptables.c | 6 +---
src/libvirt.c | 6 ++--
src/openvz_conf.c | 3 +-
src/qemu_conf.c | 8 ++----
src/qemu_driver.c | 18 +++++-----------
src/remote_internal.c | 26 ++++++++++++------------
src/test.c | 24 +++++++--------------
src/virsh.c | 53 ++++++++++++++++--------------------------------
src/virterror.c | 12 +++-------
src/xen_internal.c | 9 ++-----
src/xen_unified.c | 12 +++-------
src/xend_internal.c | 44 +++++++++++++---------------------------
src/xm_internal.c | 15 ++++---------
src/xml.c | 21 ++++++-------------
src/xmlrpc.c | 20 +++++-------------
src/xs_internal.c | 2 -
tests/testutils.c | 3 +-
tests/xencapstest.c | 3 +-
tests/xmconfigtest.c | 3 +-
25 files changed, 112 insertions(+), 211 deletions(-)
diff --git a/proxy/libvirt_proxy.c b/proxy/libvirt_proxy.c
index d8f2e64..5ccf855 100644
--- a/proxy/libvirt_proxy.c
+++ b/proxy/libvirt_proxy.c
@@ -505,8 +505,7 @@ retry2:
memcpy(&request.extra.str[0], uuid, VIR_UUID_BUFLEN);
strcpy(&request.extra.str[VIR_UUID_BUFLEN], name);
}
- if (name)
- free(name);
+ free(name);
break;
}
case VIR_PROXY_LOOKUP_UUID: {
diff --git a/python/generator.py b/python/generator.py
index 7625a93..30b03fd 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -375,7 +375,7 @@ def print_function_wrapper(name, output, export, include):
if ret[0] == 'void':
if file == "python_accessor":
if args[1][1] == "char *":
- c_call = "\n if (%s->%s != NULL) free(%s->%s);\n" % (
+ c_call = "\n free(%s->%s);\n" % (
args[0][0], args[1][0], args[0][0], args[1][0])
c_call = c_call + " %s->%s = (%s)strdup((const xmlChar *)%s);\n" % (args[0][0],
args[1][0], args[1][1], args[1][0])
diff --git a/qemud/qemud.c b/qemud/qemud.c
index 7d25b9d..5f3c875 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -1133,7 +1133,7 @@ static void qemudDispatchClientFailure(struct qemud_server *server, struct qemud
#if HAVE_SASL
if (client->saslconn) sasl_dispose(&client->saslconn);
- if (client->saslUsername) free(client->saslUsername);
+ free(client->saslUsername);
#endif
if (client->tlssession) gnutls_deinit (client->tlssession);
close(client->fd);
@@ -1639,8 +1639,7 @@ static void qemudCleanup(struct qemud_server *server) {
if (server->saslUsernameWhitelist) {
char **list = server->saslUsernameWhitelist;
while (*list) {
- if (*list)
- free(*list);
+ free(*list);
list++;
}
}
diff --git a/src/buf.c b/src/buf.c
index 5f58027..188d040 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -150,8 +150,7 @@ void
virBufferFree(virBufferPtr buf)
{
if (buf) {
- if (buf->content)
- free(buf->content);
+ free(buf->content);
free(buf);
}
}
diff --git a/src/conf.c b/src/conf.c
index 62c42ff..8e66d84 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -490,7 +490,6 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
ret = calloc(1, sizeof(*ret));
if (ret == NULL) {
virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), 0);
- if (str != NULL)
free(str);
return(NULL);
}
@@ -642,8 +641,7 @@ virConfParseStatement(virConfParserCtxtPtr ctxt)
if (virConfAddEntry(ctxt->conf, name, value, comm) == NULL) {
free(name);
virConfFreeValue(value);
- if (comm != NULL)
- free(comm);
+ free(comm);
return(-1);
}
return(0);
@@ -776,8 +774,7 @@ __virConfFree(virConfPtr conf)
virConfEntryPtr next;
free(tmp->name);
virConfFreeValue(tmp->value);
- if (tmp->comment)
- free(tmp->comment);
+ free(tmp->comment);
next = tmp->next;
free(tmp);
tmp = next;
diff --git a/src/hash.c b/src/hash.c
index d95eea9..4e4ce60 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -226,8 +226,7 @@ virHashFree(virHashTablePtr table, virHashDeallocator f)
next = iter->next;
if ((f != NULL) && (iter->payload != NULL))
f(iter->payload, iter->name);
- if (iter->name)
- free(iter->name);
+ free(iter->name);
iter->payload = NULL;
if (!inside_table)
free(iter);
@@ -453,8 +452,7 @@ virHashRemoveEntry(virHashTablePtr table, const char *name,
if ((f != NULL) && (entry->payload != NULL))
f(entry->payload, entry->name);
entry->payload = NULL;
- if (entry->name)
- free(entry->name);
+ free(entry->name);
if (prev) {
prev->next = entry->next;
free(entry);
@@ -538,8 +536,7 @@ int virHashRemoveSet(virHashTablePtr table, virHashSearcher iter, virHashDealloc
if (iter(entry->payload, entry->name, data)) {
count++;
f(entry->payload, entry->name);
- if (entry->name)
- free(entry->name);
+ free(entry->name);
if (prev) {
prev->next = entry->next;
free(entry);
@@ -812,8 +809,7 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
error:
pthread_mutex_unlock(&conn->lock);
if (ret != NULL) {
- if (ret->name != NULL)
- free(ret->name );
+ free(ret->name );
free(ret);
}
return(NULL);
@@ -946,8 +942,7 @@ __virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid)
error:
pthread_mutex_unlock(&conn->lock);
if (ret != NULL) {
- if (ret->name != NULL)
- free(ret->name );
+ free(ret->name );
free(ret);
}
return(NULL);
diff --git a/src/iptables.c b/src/iptables.c
index 5ac9be6..b59faa4 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -254,8 +254,7 @@ iptRulesSave(iptRules *rules)
static void
iptRuleFree(iptRule *rule)
{
- if (rule->rule)
- free(rule->rule);
+ free(rule->rule);
rule->rule = NULL;
if (rule->argv) {
@@ -488,8 +487,7 @@ iptablesAddRemoveRule(iptRules *rules, int action, const char *arg, ...)
}
error:
- if (rule)
- free(rule);
+ free(rule);
if (argv) {
n = 0;
diff --git a/src/libvirt.c b/src/libvirt.c
index 31e1278..f4ee2e0 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -615,7 +615,7 @@ do_open (const char *name,
return ret;
failed:
- if (ret->name) free (ret->name);
+ free (ret->name);
if (ret->driver) ret->driver->close (ret);
if (uri) xmlFreeURI(uri);
virUnrefConnect(ret);
@@ -1974,8 +1974,8 @@ virDomainMigrate (virDomainPtr domain,
ddomain = virDomainLookupByName (dconn, dname);
done:
- if (uri_out) free (uri_out);
- if (cookie) free (cookie);
+ free (uri_out);
+ free (cookie);
return ddomain;
}
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index a886001..4e4019c 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -494,8 +494,7 @@ static struct openvz_vm_def
return def;
bail_out:
- if (prop)
- free(prop);
+ free(prop);
if (obj)
xmlXPathFreeObject(obj);
if (ctxt)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 922223e..0de641d 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -1379,8 +1379,7 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn,
return def;
error:
- if (prop)
- free(prop);
+ free(prop);
if (obj)
xmlXPathFreeObject(obj);
if (ctxt)
@@ -1468,8 +1467,7 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
no_memory:
qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, "tapfds");
error:
- if (retval)
- free(retval);
+ free(retval);
if (tapfd != -1)
close(tapfd);
return NULL;
@@ -1941,7 +1939,7 @@ qemudParseVMDeviceDef(virConnectPtr conn,
error:
if (xml) xmlFreeDoc(xml);
- if (dev) free(dev);
+ free(dev);
return NULL;
}
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 566fb76..71a3125 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -228,7 +228,7 @@ qemudStartup(void) {
out_of_memory:
qemudLog (QEMUD_ERR, "qemudStartup: out of memory");
- if (base) free (base);
+ free (base);
free(qemu_driver);
qemu_driver = NULL;
return -1;
@@ -330,17 +330,11 @@ qemudShutdown(void) {
qemu_driver->nactivenetworks = 0;
qemu_driver->ninactivenetworks = 0;
- if (qemu_driver->configDir)
- free(qemu_driver->configDir);
- if (qemu_driver->autostartDir)
- free(qemu_driver->autostartDir);
- if (qemu_driver->networkConfigDir)
- free(qemu_driver->networkConfigDir);
- if (qemu_driver->networkAutostartDir)
- free(qemu_driver->networkAutostartDir);
-
- if (qemu_driver->vncTLSx509certdir)
- free(qemu_driver->vncTLSx509certdir);
+ free(qemu_driver->configDir);
+ free(qemu_driver->autostartDir);
+ free(qemu_driver->networkConfigDir);
+ free(qemu_driver->networkAutostartDir);
+ free(qemu_driver->vncTLSx509certdir);
if (qemu_driver->brctl)
brShutdown(qemu_driver->brctl);
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 860b4d8..4d855ab 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -735,13 +735,13 @@ doRemoteOpen (virConnectPtr conn,
cleanup:
/* Free up the URL and strings. */
- if (name) free (name);
- if (command) free (command);
- if (sockname) free (sockname);
- if (authtype) free (authtype);
- if (netcat) free (netcat);
- if (username) free (username);
- if (port) free (port);
+ free (name);
+ free (command);
+ free (sockname);
+ free (authtype);
+ free (netcat);
+ free (username);
+ free (port);
if (cmd_argv) {
char **cmd_argv_ptr = cmd_argv;
while (*cmd_argv_ptr) {
@@ -1139,10 +1139,10 @@ doRemoteClose (virConnectPtr conn, struct private_data *priv)
#endif
/* Free hostname copy */
- if (priv->hostname) free (priv->hostname);
+ free (priv->hostname);
/* See comment for remoteType. */
- if (priv->type) free (priv->type);
+ free (priv->type);
/* Free private data. */
priv->magic = DEAD;
@@ -3267,7 +3267,7 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
/* This server call shows complete, and earlier client step was OK */
if (complete && err == SASL_OK) {
- if (serverin) free(serverin);
+ free(serverin);
break;
}
}
@@ -3297,9 +3297,9 @@ remoteAuthSASL (virConnectPtr conn, struct private_data *priv, int in_open,
ret = 0;
cleanup:
- if (localAddr) free(localAddr);
- if (remoteAddr) free(remoteAddr);
- if (serverin) free(serverin);
+ free(localAddr);
+ free(remoteAddr);
+ free(serverin);
free(saslcb);
remoteAuthFreeCredentials(cred, ncred);
diff --git a/src/test.c b/src/test.c
index d228b31..d39207f 100644
--- a/src/test.c
+++ b/src/test.c
@@ -354,8 +354,7 @@ static int testLoadDomain(virConnectPtr conn,
return (handle);
error:
- if (name)
- free(name);
+ free(name);
return (-1);
}
@@ -525,16 +524,11 @@ static int testLoadNetwork(virConnectPtr conn,
return (handle);
error:
- if (ipaddress)
- free(ipaddress);
- if (ipnetmask)
- free(ipnetmask);
- if (dhcpstart)
- free(dhcpstart);
- if (dhcpend)
- free(dhcpend);
- if (name)
- free(name);
+ free(ipaddress);
+ free(ipnetmask);
+ free(dhcpstart);
+ free(dhcpend);
+ free(name);
return (-1);
}
@@ -838,10 +832,8 @@ static int testOpenFromFile(virConnectPtr conn,
return (0);
error:
- if (domains != NULL)
- free(domains);
- if (networks != NULL)
- free(networks);
+ free(domains);
+ free(networks);
if (xml)
xmlFreeDoc(xml);
if (fd != -1)
diff --git a/src/virsh.c b/src/virsh.c
index 78c7c85..d081008 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -428,8 +428,7 @@ cmdConnect(vshControl * ctl, vshCmd * cmd)
ctl->conn = NULL;
}
- if (ctl->name)
- free(ctl->name);
+ free(ctl->name);
ctl->name = vshStrdup(ctl, vshCommandOptString(cmd, "name", NULL));
if (!ro) {
@@ -577,8 +576,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
maxname = virConnectNumOfDefinedDomains(ctl->conn);
if (maxname < 0) {
vshError(ctl, FALSE, "%s", _("Failed to list inactive domains"));
- if (ids)
- free(ids);
+ free(ids);
return FALSE;
}
if (maxname) {
@@ -586,8 +584,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
if ((maxname = virConnectListDefinedDomains(ctl->conn, names, maxname)) < 0) {
vshError(ctl, FALSE, "%s", _("Failed to list inactive domains"));
- if (ids)
- free(ids);
+ free(ids);
free(names);
return FALSE;
}
@@ -639,10 +636,8 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
virDomainFree(dom);
free(names[i]);
}
- if (ids)
- free(ids);
- if (names)
- free(names);
+ free(ids);
+ free(names);
return TRUE;
}
@@ -1217,8 +1212,7 @@ cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
}
}
cleanup:
- if (params)
- free(params);
+ free(params);
virDomainFree(dom);
return ret_val;
}
@@ -2513,8 +2507,7 @@ cmdNetworkList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
maxinactive = virConnectNumOfDefinedNetworks(ctl->conn);
if (maxinactive < 0) {
vshError(ctl, FALSE, "%s", _("Failed to list inactive networks"));
- if (activeNames)
- free(activeNames);
+ free(activeNames);
return FALSE;
}
if (maxinactive) {
@@ -2522,8 +2515,7 @@ cmdNetworkList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
if ((maxinactive = virConnectListDefinedNetworks(ctl->conn, inactiveNames, maxinactive)) < 0) {
vshError(ctl, FALSE, "%s", _("Failed to list inactive networks"));
- if (activeNames)
- free(activeNames);
+ free(activeNames);
free(inactiveNames);
return FALSE;
}
@@ -2581,10 +2573,8 @@ cmdNetworkList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
virNetworkFree(network);
free(inactiveNames[i]);
}
- if (activeNames)
- free(activeNames);
- if (inactiveNames)
- free(inactiveNames);
+ free(activeNames);
+ free(inactiveNames);
return TRUE;
}
@@ -3230,10 +3220,8 @@ cmdAttachInterface(vshControl * ctl, vshCmd * cmd)
cleanup:
if (dom)
virDomainFree(dom);
- if (buf)
- free(buf);
- if (tmp)
- free(tmp);
+ free(buf);
+ free(tmp);
return ret;
}
@@ -3516,10 +3504,8 @@ cmdAttachDisk(vshControl * ctl, vshCmd * cmd)
cleanup:
if (dom)
virDomainFree(dom);
- if (buf)
- free(buf);
- if (tmp)
- free(tmp);
+ free(buf);
+ free(tmp);
return ret;
}
@@ -3868,8 +3854,7 @@ vshCommandOptFree(vshCmdOpt * arg)
a = a->next;
- if (tmp->data)
- free(tmp->data);
+ free(tmp->data);
free(tmp);
}
}
@@ -4267,7 +4252,7 @@ vshCommandParse(vshControl * ctl, char *cmdstr)
c->next = NULL;
if (!vshCommandCheckOpts(ctl, c)) {
- if(c) free(c);
+ free(c);
goto syntaxError;
}
@@ -4286,8 +4271,7 @@ vshCommandParse(vshControl * ctl, char *cmdstr)
vshCommandFree(ctl->cmd);
if (first)
vshCommandOptFree(first);
- if (tkdata)
- free(tkdata);
+ free(tkdata);
return FALSE;
}
@@ -4791,8 +4775,7 @@ static int
vshDeinit(vshControl * ctl)
{
vshCloseLogFile(ctl);
- if (ctl->name)
- free(ctl->name);
+ free(ctl->name);
if (ctl->conn) {
if (virConnectClose(ctl->conn) != 0) {
ctl->conn = NULL; /* prevent recursive call from vshError() */
diff --git a/src/virterror.c b/src/virterror.c
index 0c0423b..bf4062d 100644
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -109,14 +109,10 @@ virResetError(virErrorPtr err)
{
if (err == NULL)
return;
- if (err->message != NULL)
- free(err->message);
- if (err->str1 != NULL)
- free(err->str1);
- if (err->str2 != NULL)
- free(err->str2);
- if (err->str3 != NULL)
- free(err->str3);
+ free(err->message);
+ free(err->str1);
+ free(err->str2);
+ free(err->str3);
memset(err, 0, sizeof(virError));
}
diff --git a/src/xen_internal.c b/src/xen_internal.c
index 6b3b1dc..a8cecef 100644
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -1680,8 +1680,7 @@ virXen_setvcpumap(int handle, int id, unsigned int vcpu,
op.u.setvcpumapd5.cpumap.nr_cpus = nr_cpus;
}
ret = xenHypervisorDoV2Dom(handle, &op);
- if (new)
- free(new);
+ free(new);
if (unlock_pages(cpumap, maplen) < 0) {
virXenError(NULL, VIR_ERR_XEN_CALL, " release", maplen);
@@ -2056,15 +2055,13 @@ xenHypervisorInit(void)
virXenError(NULL, VIR_ERR_XEN_CALL, " ioctl ", IOCTL_PRIVCMD_HYPERCALL);
close(fd);
in_init = 0;
- if (ipt)
- free(ipt);
+ free(ipt);
return(-1);
done:
close(fd);
in_init = 0;
- if (ipt)
- free(ipt);
+ free(ipt);
return(0);
}
diff --git a/src/xen_unified.c b/src/xen_unified.c
index 187b7f5..d46e63b 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -200,12 +200,9 @@ xenDomainUsedCpus(virDomainPtr dom)
}
done:
- if (cpulist != NULL)
- free(cpulist);
- if (cpumap != NULL)
- free(cpumap);
- if (cpuinfo != NULL)
- free(cpuinfo);
+ free(cpulist);
+ free(cpumap);
+ free(cpuinfo);
return(res);
}
@@ -912,9 +909,8 @@ xenUnifiedDomainDumpXML (virDomainPtr dom, int flags)
char *cpus, *res;
cpus = xenDomainUsedCpus(dom);
res = xenDaemonDomainDumpXML(dom, flags, cpus);
- if (cpus != NULL)
free(cpus);
- return(res);
+ return(res);
}
if (priv->opened[XEN_UNIFIED_PROXY_OFFSET])
return xenProxyDomainDumpXML(dom, flags);
diff --git a/src/xend_internal.c b/src/xend_internal.c
index a9fc332..61af69b 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -620,8 +620,7 @@ xend_op_ext2(virConnectPtr xend, const char *path, char *error,
}
ret = http2unix(xend, xend_post(xend, path, buf.content, error, n_error));
- if (buf.content != NULL)
- free(buf.content);
+ free(buf.content);
return ret;
}
@@ -1640,10 +1639,8 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
virBufferAdd(&buf, " </disk>\n", 12);
bad_parse:
- if (drvName)
- free(drvName);
- if (drvType)
- free(drvType);
+ free(drvName);
+ free(drvType);
} else if (sexpr_lookup(node, "device/vif")) {
const char *tmp2;
tmp2 = sexpr_node(node, "device/vif/script");
@@ -1809,8 +1806,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root,
return (buf.content);
error:
- if (buf.content != NULL)
- free(buf.content);
+ free(buf.content);
return (NULL);
}
@@ -2809,7 +2805,6 @@ xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids)
}
error:
- if (root != NULL)
sexpr_free(root);
return(ret);
}
@@ -2843,7 +2838,6 @@ xenDaemonNumOfDomains(virConnectPtr conn)
}
error:
- if (root != NULL)
sexpr_free(root);
return(ret);
}
@@ -2877,8 +2871,7 @@ xenDaemonLookupByID(virConnectPtr conn, int id) {
return (ret);
error:
- if (name != NULL)
- free(name);
+ free(name);
return (NULL);
}
@@ -3152,10 +3145,8 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
sexpr = virDomainParseXMLDesc(conn, xmlDesc, &name, priv->xendConfigVersion);
if ((sexpr == NULL) || (name == NULL)) {
virXendError(conn, VIR_ERR_XML_ERROR, "domain");
- if (sexpr != NULL)
- free(sexpr);
- if (name != NULL)
- free(name);
+ free(sexpr);
+ free(name);
return (NULL);
}
@@ -3187,8 +3178,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
xenDaemonDomainDestroy(dom);
virUnrefDomain(dom);
}
- if (name != NULL)
- free(name);
+ free(name);
return (NULL);
}
@@ -3228,8 +3218,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml)
str = virDomainGetOSType(domain);
if (strcmp(str, "linux"))
hvm = 1;
- if (str)
- free(str);
+ free(str);
sexpr = virParseXMLDevice(domain->conn, xml, hvm, priv->xendConfigVersion);
if (sexpr == NULL)
return (-1);
@@ -3460,10 +3449,8 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) {
sexpr = virDomainParseXMLDesc(conn, xmlDesc, &name, priv->xendConfigVersion);
if ((sexpr == NULL) || (name == NULL)) {
virXendError(conn, VIR_ERR_XML_ERROR, "domain");
- if (sexpr != NULL)
- free(sexpr);
- if (name != NULL)
- free(name);
+ free(sexpr);
+ free(name);
return (NULL);
}
@@ -3482,8 +3469,7 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) {
return (dom);
error:
- if (name != NULL)
- free(name);
+ free(name);
return (NULL);
}
int xenDaemonDomainCreate(virDomainPtr domain)
@@ -3558,8 +3544,7 @@ xenDaemonNumOfDefinedDomains(virConnectPtr conn)
}
error:
- if (root != NULL)
- sexpr_free(root);
+ sexpr_free(root);
return(ret);
}
@@ -3591,8 +3576,7 @@ int xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxn
}
error:
- if (root != NULL)
- sexpr_free(root);
+ sexpr_free(root);
return(ret);
}
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 6b502d0..90dc1a4 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -1307,10 +1307,8 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
ret = 0;
cleanup:
- if(mapstr)
- free(mapstr);
- if(ranges)
- free(ranges);
+ free(mapstr);
+ free(ranges);
return (ret);
}
@@ -1865,8 +1863,7 @@ static char *xenXMParseXMLVif(virConnectPtr conn, xmlNodePtr node, int hvm) {
}
cleanup:
- if (bridge != NULL)
- free(bridge);
+ free(bridge);
if (mac != NULL)
xmlFree(mac);
if (source != NULL)
@@ -2238,8 +2235,7 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) {
if (!vif)
goto error;
if (!(thisVif = malloc(sizeof(*thisVif)))) {
- if (vif)
- free(vif);
+ free(vif);
xenXMError(conn, VIR_ERR_NO_MEMORY, "config");
goto error;
}
@@ -2410,8 +2406,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
return (ret);
error:
- if (entry)
- free(entry);
+ free(entry);
if (conf)
virConfFree(conf);
return (NULL);
diff --git a/src/xml.c b/src/xml.c
index c698889..a546002 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -397,14 +397,12 @@ virParseXenCpuTopology(virConnectPtr conn, virBufferPtr xml,
parse_error:
virXMLError(conn, VIR_ERR_XEN_CALL, _("topology syntax error"), 0);
error:
- if (cpuset != NULL)
- free(cpuset);
+ free(cpuset);
return (-1);
memory_error:
- if (cpuset != NULL)
- free(cpuset);
+ free(cpuset);
virXMLError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"), 0);
return (-1);
}
@@ -1066,16 +1064,14 @@ virDomainParseXMLOSDescHVM(virConnectPtr conn, xmlNodePtr node,
if (str != NULL && !strcmp(str, "localtime")) {
virBufferAdd(buf, "(localtime 1)", 13);
}
- if (str)
- free(str);
+ free(str);
virBufferAdd(buf, "))", 2);
return (0);
error:
- if (nodes)
- free(nodes);
+ free(nodes);
return (-1);
}
@@ -1723,8 +1719,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name,
vcpus, xendConfigVersion);
}
- if (str != NULL)
- free(str);
+ free(str);
if (res != 0)
goto error;
@@ -1797,8 +1792,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name,
return (buf.content);
error:
- if (nam != NULL)
- free(nam);
+ free(nam);
if (name != NULL)
*name = NULL;
if (ctxt != NULL)
@@ -1807,8 +1801,7 @@ virDomainParseXMLDesc(virConnectPtr conn, const char *xmldesc, char **name,
xmlFreeDoc(xml);
if (pctxt != NULL)
xmlFreeParserCtxt(pctxt);
- if (buf.content != NULL)
- free(buf.content);
+ free(buf.content);
return (NULL);
}
diff --git a/src/xmlrpc.c b/src/xmlrpc.c
index b433ef5..f956f0d 100644
--- a/src/xmlrpc.c
+++ b/src/xmlrpc.c
@@ -115,8 +115,7 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalInteger(xmlNodePtr node)
if (ret && value)
ret->value.integer = atoi(value);
- if (value)
- free(value);
+ free(value);
return ret;
}
@@ -131,8 +130,7 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalBoolean(xmlNodePtr node)
ret->value.boolean = true;
else
ret->value.boolean = false;
- if (value)
- free(value);
+ free(value);
return ret;
}
@@ -143,8 +141,7 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalDouble(xmlNodePtr node)
if (ret && value)
ret->value.real = atof(value);
- if (value)
- free(value);
+ free(value);
return ret;
}
@@ -198,8 +195,7 @@ static xmlRpcValueDictElementPtr xmlRpcValueUnmarshalDictElement(xmlNodePtr node
ret->value = xmlRpcValueUnmarshal(cur);
} else {
xmlRpcError(VIR_ERR_XML_ERROR, _("unexpected dict node"), 0);
- if (ret->name)
- free(ret->name);
+ free(ret->name);
if (ret->value)
xmlRpcValueFree(ret->value);
free(ret);
@@ -679,12 +675,8 @@ xmlRpcContextPtr xmlRpcContextNew(const char *uri)
void xmlRpcContextFree(xmlRpcContextPtr context)
{
if (context) {
- if (context->uri)
- free(context->uri);
-
- if (context->faultMessage)
- free(context->faultMessage);
-
+ free(context->uri);
+ free(context->faultMessage);
free(context);
}
}
diff --git a/src/xs_internal.c b/src/xs_internal.c
index 726af30..1dbbba6 100644
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -635,9 +635,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name)
ret->id = id;
done:
- if (xenddomain != NULL)
free(xenddomain);
- if (idlist != NULL)
free(idlist);
return(ret);
diff --git a/tests/testutils.c b/tests/testutils.c
index 1141edb..4fea6b6 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -83,8 +83,7 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
else
fprintf(stderr, "%-50s ... FAILED\n", title);
- if (ts)
- free(ts);
+ free(ts);
return ret;
}
diff --git a/tests/xencapstest.c b/tests/xencapstest.c
index dd1c386..bf9ce07 100644
--- a/tests/xencapstest.c
+++ b/tests/xencapstest.c
@@ -62,8 +62,7 @@ static int testCompareFiles(const char *hostmachine,
fail:
- if (actualxml)
- free(actualxml);
+ free(actualxml);
if (fp1)
fclose(fp1);
if (fp2)
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index f49ca6c..51f4b67 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -153,8 +153,7 @@ static int testCompareFormatXML(const char *xmcfg_rel, const char *xml_rel,
fail:
if (conf)
virConfFree(conf);
- if (gotxml)
- free(gotxml);
+ free(gotxml);
if (conn) {
conn->privateData = old_priv;
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 8/8 Enable two more tests.
by Jim Meyering
Enabling these is easy, since they test for things for which
there are no violations.
--------------------
Subject: [PATCH] Enable two more tests.
* Makefile.cfg (local-checks-to-skip)
[sc_cast_of_x_alloc_return_value, sc_cast_of_argument_to_free]: Enable.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.cfg | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/Makefile.cfg b/Makefile.cfg
index dfca3fc..9e75fda 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -35,8 +35,6 @@ local-checks-to-skip = \
sc_GPL_version \
sc_always_defined_macros \
sc_cast_of_alloca_return_value \
- sc_cast_of_argument_to_free \
- sc_cast_of_x_alloc_return_value \
sc_changelog \
sc_dd_max_sym_length \
sc_error_exit_success \
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 7/8 Remove unnecessary "#include <assert.h>"s
by Jim Meyering
Enable the <assert.h>-checking test; fix violations.
* Makefile.cfg (local-checks-to-skip)
[sc_prohibit_assert_without_use]: Enable.
* qemud/mdns.c: Don't include <assert.h>; no uses of assert here.
* qemud/qemud.c: Likewise.
* qemud/remote.c: Likewise.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.cfg | 1 -
qemud/mdns.c | 1 -
qemud/qemud.c | 1 -
qemud/remote.c | 1 -
4 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/Makefile.cfg b/Makefile.cfg
index 697fde4..dfca3fc 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -42,7 +42,6 @@ local-checks-to-skip = \
sc_error_exit_success \
sc_file_system \
sc_obsolete_symbols \
- sc_prohibit_assert_without_use \
sc_prohibit_atoi_atof \
sc_prohibit_jm_in_m4 \
sc_prohibit_quote_without_use \
diff --git a/qemud/mdns.c b/qemud/mdns.c
index 1585b5b..cebf9a4 100644
--- a/qemud/mdns.c
+++ b/qemud/mdns.c
@@ -29,7 +29,6 @@
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
-#include <assert.h>
#include <avahi-client/client.h>
#include <avahi-client/publish.h>
diff --git a/qemud/qemud.c b/qemud/qemud.c
index 77a2352..e853538 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -44,7 +44,6 @@
#include <string.h>
#include <errno.h>
#include <getopt.h>
-#include <assert.h>
#include <fnmatch.h>
#include <grp.h>
#include <signal.h>
diff --git a/qemud/remote.c b/qemud/remote.c
index b5b0ef6..57f8f29 100644
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -43,7 +43,6 @@
#include <errno.h>
#include <getopt.h>
#include <ctype.h>
-#include <assert.h>
#include <fnmatch.h>
#ifdef HAVE_POLKIT
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 4/8 Enable the <config.h>-requiring test; fix violations
by Jim Meyering
Enable the <config.h>-requiring test; fix violations
Use <config.h>, not "config.h", per autoconf documentation.
* Makefile.cfg (local-checks-to-skip) [sc_require_config_h]: Enable.
* .x-sc_require_config_h: New file, to list exempted files.
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
.x-sc_require_config_h | 5 +++++
ChangeLog | 8 ++++----
Makefile.am | 3 ++-
Makefile.cfg | 1 -
proxy/libvirt_proxy.c | 2 +-
python/libvir.c | 2 +-
python/types.c | 2 +-
qemud/event.c | 2 +-
qemud/qemud.c | 2 +-
src/bridge.h | 2 +-
src/buf.c | 2 +-
src/conf.c | 2 +-
src/console.c | 2 +-
src/event.c | 2 +-
src/gnutls_1_0_compat.h | 2 +-
src/hash.c | 2 +-
src/iptables.c | 2 +-
src/libvirt.c | 2 +-
src/nodeinfo.c | 2 +-
src/openvz_conf.c | 2 +-
src/proxy_internal.c | 2 +-
src/qemu_conf.c | 2 +-
src/qemu_conf.h | 2 +-
src/qemu_driver.c | 2 +-
src/qemu_driver.h | 2 +-
src/remote_internal.c | 2 +-
src/sexpr.c | 2 +-
src/stats_linux.c | 2 +-
src/test.c | 2 +-
src/util.c | 2 +-
src/uuid.c | 2 +-
src/virsh.c | 2 +-
src/virterror.c | 2 +-
src/xen_internal.c | 2 +-
src/xen_unified.c | 2 +-
src/xend_internal.c | 2 +-
src/xm_internal.c | 2 +-
src/xml.c | 2 +-
src/xmlrpc.c | 2 +-
src/xs_internal.c | 2 +-
tests/conftest.c | 2 +-
tests/nodeinfotest.c | 2 +-
tests/qemuxml2argvtest.c | 2 +-
tests/qemuxml2xmltest.c | 2 +-
tests/reconnect.c | 2 +-
tests/sexpr2xmltest.c | 2 +-
tests/testutils.c | 2 +-
tests/virshtest.c | 2 +-
tests/xencapstest.c | 2 +-
tests/xmconfigtest.c | 2 +-
tests/xml2sexprtest.c | 2 +-
tests/xmlrpctest.c | 2 +-
52 files changed, 59 insertions(+), 54 deletions(-)
create mode 100644 .x-sc_require_config_h
diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h
new file mode 100644
index 0000000..e0903ac
--- /dev/null
+++ b/.x-sc_require_config_h
@@ -0,0 +1,5 @@
+^docs/examples/info1\.c$
+^docs/examples/suspend\.c$
+^gnulib/lib/dummy\.c$
+^gnulib/tests/dummy\.c$
+^qemud/remote_protocol\.c$
diff --git a/ChangeLog b/ChangeLog
index 5493e51..7d5e058 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -555,7 +555,7 @@ Fri Dec 7 14:27:00 UTC 2007 Richard W.M. Jones <rjones(a)redhat.com>
Fri Dec 7 11:06:58 CET 2007 Jim Meyering <meyering(a)redhat.com>
- Include "config.h" in remaining non-generated files.
+ Include <config.h> in remaining non-generated files.
* proxy/libvirt_proxy.c: Likewise.
* python/libvir.c: Likewise.
* python/types.c: Likewise.
@@ -619,7 +619,7 @@ Wed Dec 5 23:57:53 CET 2007 Jim Meyering <meyering(a)redhat.com>
Wed Dec 5 22:38:18 CET 2007 Jim Meyering <meyering(a)redhat.com>
- Include "config.h".
+ Include <config.h>.
* qemud/event.c: Likewise.
* src/buf.c: Likewise.
* src/hash.c: Likewise.
@@ -673,10 +673,10 @@ Wed Dec 5 22:30:03 CET 2007 Jim Meyering <meyering(a)redhat.com>
* tests/nodeinfodata/linux-nodeinfo-5.txt:
* tests/nodeinfodata/linux-nodeinfo-6.txt:
* src/test.c [WITH_TEST]: Remove definition of _GNU_SOURCE that
- would conflict with the one now in "config.h".
+ would conflict with the one now in <config.h>.
* autogen.sh: Add -I gnulib/m4.
* src/conf.c, src/sexpr.c: Don't define _GNU_SOURCE.
- Instead, include "config.h".
+ Instead, include <config.h>.
* qemud/qemud.c: Remove definition of _GNU_SOURCE.
* src/openvz_driver.c: Likewise.
* src/qemu_driver.c: Likewise.
diff --git a/Makefile.am b/Makefile.am
index 5154203..e32033a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,8 @@ EXTRA_DIST = \
libvirt.spec libvirt.spec.in \
libvirt.pc libvirt.pc.in \
$(man_MANS) autobuild.sh \
- .x-sc_avoid_if_before_free
+ .x-sc_avoid_if_before_free \
+ .x-sc_require_config_h
man_MANS = virsh.1
diff --git a/Makefile.cfg b/Makefile.cfg
index ba59f29..2c1c9e7 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -49,7 +49,6 @@ local-checks-to-skip = \
sc_prohibit_quote_without_use \
sc_prohibit_quotearg_without_use \
sc_prohibit_strcmp \
- sc_require_config_h \
sc_root_tests \
sc_space_tab \
sc_sun_os_names \
diff --git a/proxy/libvirt_proxy.c b/proxy/libvirt_proxy.c
index 5ccf855..83cf39d 100644
--- a/proxy/libvirt_proxy.c
+++ b/proxy/libvirt_proxy.c
@@ -9,7 +9,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifdef WITH_XEN
diff --git a/python/libvir.c b/python/libvir.c
index 0fe11f2..e2f7c5b 100644
--- a/python/libvir.c
+++ b/python/libvir.c
@@ -9,7 +9,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <Python.h>
#include "libvirt/libvirt.h"
diff --git a/python/types.c b/python/types.c
index 146bb24..c91d8da 100644
--- a/python/types.c
+++ b/python/types.c
@@ -7,7 +7,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "libvirt_wrap.h"
diff --git a/qemud/event.c b/qemud/event.c
index b7d75a0..ca7dc11 100644
--- a/qemud/event.c
+++ b/qemud/event.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/qemud/qemud.c b/qemud/qemud.c
index 5f3c875..77a2352 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/src/bridge.h b/src/bridge.h
index 52f805b..5dcca00 100644
--- a/src/bridge.h
+++ b/src/bridge.h
@@ -22,7 +22,7 @@
#ifndef __QEMUD_BRIDGE_H__
#define __QEMUD_BRIDGE_H__
-#include "config.h"
+#include <config.h>
#ifdef WITH_QEMU
diff --git a/src/buf.c b/src/buf.c
index 188d040..5bb2bd4 100644
--- a/src/buf.c
+++ b/src/buf.c
@@ -8,7 +8,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "libvirt/libvirt.h"
diff --git a/src/conf.c b/src/conf.c
index 8e66d84..8b3aae5 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -8,7 +8,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
diff --git a/src/console.c b/src/console.c
index 6b336d9..02a9c7f 100644
--- a/src/console.c
+++ b/src/console.c
@@ -20,7 +20,7 @@
* Daniel Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifndef __MINGW32__
diff --git a/src/event.c b/src/event.c
index 7dcbf32..274db9d 100644
--- a/src/event.c
+++ b/src/event.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "event.h"
diff --git a/src/gnutls_1_0_compat.h b/src/gnutls_1_0_compat.h
index 7ec8b63..38f6954 100644
--- a/src/gnutls_1_0_compat.h
+++ b/src/gnutls_1_0_compat.h
@@ -22,7 +22,7 @@
#ifndef LIBVIRT_GNUTLS_1_0_COMPAT_H__
-#include "config.h"
+#include <config.h>
#ifdef GNUTLS_1_0_COMPAT
#define gnutls_session_t gnutls_session
diff --git a/src/hash.c b/src/hash.c
index 4e4ce60..d92c92c 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -18,7 +18,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/iptables.c b/src/iptables.c
index b59faa4..1486411 100644
--- a/src/iptables.c
+++ b/src/iptables.c
@@ -19,7 +19,7 @@
* Mark McLoughlin <markmc(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#if WITH_QEMU
diff --git a/src/libvirt.c b/src/libvirt.c
index f4ee2e0..defadc1 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -9,7 +9,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "libvirt/libvirt.h"
#include <stdio.h>
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 1b0191b..65a2cf1 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index 4e4019c..9084184 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -27,7 +27,7 @@
#ifdef WITH_OPENVZ
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/proxy_internal.c b/src/proxy_internal.c
index e0e5631..a8a7962 100644
--- a/src/proxy_internal.c
+++ b/src/proxy_internal.c
@@ -10,7 +10,7 @@
#ifdef WITH_XEN
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 0de641d..9886300 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifdef WITH_QEMU
diff --git a/src/qemu_conf.h b/src/qemu_conf.h
index 7b242f7..9f09ec1 100644
--- a/src/qemu_conf.h
+++ b/src/qemu_conf.h
@@ -24,7 +24,7 @@
#ifndef __QEMUD_CONF_H
#define __QEMUD_CONF_H
-#include "config.h"
+#include <config.h>
#ifdef WITH_QEMU
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 71a3125..f80a121 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -21,7 +21,7 @@
* Author: Daniel P. Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifdef WITH_QEMU
diff --git a/src/qemu_driver.h b/src/qemu_driver.h
index 66b60b7..72b397c 100644
--- a/src/qemu_driver.h
+++ b/src/qemu_driver.h
@@ -25,7 +25,7 @@
#ifndef QEMUD_DRIVER_H
#define QEMUD_DRIVER_H
-#include "config.h"
+#include <config.h>
#ifdef WITH_QEMU
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 4d855ab..aa6bb5c 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -21,7 +21,7 @@
* Author: Richard Jones <rjones(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
/* Windows socket compatibility functions. */
#include "socketcompat.h"
diff --git a/src/sexpr.c b/src/sexpr.c
index bbf0791..e7ea6c8 100644
--- a/src/sexpr.c
+++ b/src/sexpr.c
@@ -10,7 +10,7 @@
* archive for more details.
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/stats_linux.c b/src/stats_linux.c
index de73cef..d2dda88 100644
--- a/src/stats_linux.c
+++ b/src/stats_linux.c
@@ -8,7 +8,7 @@
* Richard W.M. Jones <rjones(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
/* This file only applies on Linux. */
#ifdef __linux__
diff --git a/src/test.c b/src/test.c
index d39207f..2afd86f 100644
--- a/src/test.c
+++ b/src/test.c
@@ -21,7 +21,7 @@
* Daniel Berrange <berrange(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifdef WITH_TEST
diff --git a/src/util.c b/src/util.c
index f16aaf4..0c42124 100644
--- a/src/util.c
+++ b/src/util.c
@@ -24,7 +24,7 @@
* File created Jul 18, 2007 - Shuveb Hussain <shuveb(a)binarykarma.com>
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdarg.h>
diff --git a/src/uuid.c b/src/uuid.c
index b2022c4..ae30217 100644
--- a/src/uuid.c
+++ b/src/uuid.c
@@ -19,7 +19,7 @@
* Mark McLoughlin <markmc(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "uuid.h"
diff --git a/src/virsh.c b/src/virsh.c
index d081008..a1b3e38 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -13,7 +13,7 @@
* $Id$
*/
-#include "config.h"
+#include <config.h>
#include "libvirt/libvirt.h"
#include "libvirt/virterror.h"
diff --git a/src/virterror.c b/src/virterror.c
index bf4062d..83cf7ca 100644
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -8,7 +8,7 @@
* Author: Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/xen_internal.c b/src/xen_internal.c
index a8cecef..1292382 100644
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -10,7 +10,7 @@
#ifdef WITH_XEN
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/xen_unified.c b/src/xen_unified.c
index d46e63b..d5b2ec2 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -8,7 +8,7 @@
* Richard W.M. Jones <rjones(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#ifdef WITH_XEN
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 61af69b..814d16f 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -11,7 +11,7 @@
*/
#ifdef WITH_XEN
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <sys/types.h>
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 90dc1a4..57d0eb4 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -23,7 +23,7 @@
*/
#ifdef WITH_XEN
-#include "config.h"
+#include <config.h>
#include <dirent.h>
#include <time.h>
diff --git a/src/xml.c b/src/xml.c
index a546002..76ca91c 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -8,7 +8,7 @@
* Daniel Veillard <veillard(a)redhat.com>
*/
-#include "config.h"
+#include <config.h>
#include "libvirt/libvirt.h"
diff --git a/src/xmlrpc.c b/src/xmlrpc.c
index f956f0d..ac4ea6e 100644
--- a/src/xmlrpc.c
+++ b/src/xmlrpc.c
@@ -8,7 +8,7 @@
* Anthony Liguori <aliguori(a)us.ibm.com>
*/
-#include "config.h"
+#include <config.h>
#include "xmlrpc.h"
#include "internal.h"
diff --git a/src/xs_internal.c b/src/xs_internal.c
index 1dbbba6..6d8610c 100644
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -9,7 +9,7 @@
*/
#ifdef WITH_XEN
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/conftest.c b/tests/conftest.c
index abb68fd..637b737 100644
--- a/tests/conftest.c
+++ b/tests/conftest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
index 969b85c..c80e65c 100644
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 22e2e81..5606744 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 2ab1696..1be0e46 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/reconnect.c b/tests/reconnect.c
index 4c4d648..e9bdcdb 100644
--- a/tests/reconnect.c
+++ b/tests/reconnect.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c
index 6586e92..c55aa4b 100644
--- a/tests/sexpr2xmltest.c
+++ b/tests/sexpr2xmltest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/testutils.c b/tests/testutils.c
index 4fea6b6..80b1022 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -10,7 +10,7 @@
* $Id$
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/virshtest.c b/tests/virshtest.c
index fd6dcbb..676cb71 100644
--- a/tests/virshtest.c
+++ b/tests/virshtest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/xencapstest.c b/tests/xencapstest.c
index bf9ce07..1307d80 100644
--- a/tests/xencapstest.c
+++ b/tests/xencapstest.c
@@ -1,4 +1,4 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 51f4b67..424eae4 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -21,7 +21,7 @@
*
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <string.h>
diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c
index 2d18e60..3118379 100644
--- a/tests/xml2sexprtest.c
+++ b/tests/xml2sexprtest.c
@@ -1,5 +1,5 @@
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/xmlrpctest.c b/tests/xmlrpctest.c
index 5fa937f..eb75f64 100644
--- a/tests/xmlrpctest.c
+++ b/tests/xmlrpctest.c
@@ -10,7 +10,7 @@
* $Id$
*/
-#include "config.h"
+#include <config.h>
#include <stdio.h>
#include <stdlib.h>
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 6/8 Enable the po-check test; fix violations.
by Jim Meyering
This ensures that files with translatable strings
are listed in po/POTFILES.in.
Currently it checks only the "error" function.
Obviously we'll have to add a few more here, but I'll
do that separately.
----------------
Enable the po-check test; fix violations.
* Makefile.cfg (local-checks-to-skip) [po-check]: Enable.
* po/POTFILES.in: Add three file names. Sort.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
Makefile.cfg | 1 -
po/POTFILES.in | 21 ++++++++++++---------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/Makefile.cfg b/Makefile.cfg
index 2c1c9e7..697fde4 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -26,7 +26,6 @@ url_dir_list = \
# Tests not to run as part of "make distcheck".
local-checks-to-skip = \
- po-check \
makefile_path_separator_check \
makefile-check \
sc_no_have_config_h \
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 50422fb..b4b9cd2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,13 +1,16 @@
-src/libvirt.c
-src/virterror.c
-src/xmlrpc.c
+gnulib/lib/gai_strerror.c
+src/conf.c
+src/console.c
src/hash.c
-src/test.c
-src/xml.c
+src/libvirt.c
+src/proxy_internal.c
+src/remote_internal.c
src/sexpr.c
-src/xend_internal.c
+src/test.c
src/virsh.c
-src/conf.c
-src/xs_internal.c
-src/proxy_internal.c
+src/virterror.c
src/xen_internal.c
+src/xend_internal.c
+src/xml.c
+src/xmlrpc.c
+src/xs_internal.c
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 5/8 update from gnulib
by Jim Meyering
Checking for violations in libvirt exposed a few new ones in gnulib.
This fixes those and also pulls in a few unrelated changes.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
gnulib/lib/Makefile.am | 2 ++
gnulib/lib/poll.c | 6 +++---
gnulib/lib/string.in.h | 15 +++++++++++----
gnulib/m4/string_h.m4 | 4 +++-
gnulib/tests/test-getaddrinfo.c | 4 ++--
5 files changed, 21 insertions(+), 10 deletions(-)
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
index e7a6edf..64fc398 100644
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -509,8 +509,10 @@ string.h: string.in.h
-e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+ -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/string.in.h; \
} > $@-t
diff --git a/gnulib/lib/poll.c b/gnulib/lib/poll.c
index db7b517..aa40d8c 100644
--- a/gnulib/lib/poll.c
+++ b/gnulib/lib/poll.c
@@ -1,7 +1,7 @@
/* Emulation for poll(2)
Contributed by Paolo Bonzini.
- Copyright 2001, 2002, 2003, 2006, 2007 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of gnulib.
@@ -19,7 +19,7 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include "config.h"
+#include <config.h>
#include <sys/types.h>
#include "poll.h"
@@ -132,7 +132,7 @@ poll (pfd, nfd, timeout)
maxfd = pfd[i].fd;
/* Windows use a linear array of sockets (of size FD_SETSIZE). The
- descriptor value is not used to address the array. */
+ descriptor value is not used to address the array. */
#if defined __CYGWIN__ || (!defined _WIN32 && !defined __WIN32__)
if (maxfd > FD_SETSIZE)
{
diff --git a/gnulib/lib/string.in.h b/gnulib/lib/string.in.h
index dbbe2fd..b10a491 100644
--- a/gnulib/lib/string.in.h
+++ b/gnulib/lib/string.in.h
@@ -313,11 +313,15 @@ char *strstr (const char *haystack, const char *needle)
/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
comparison. */
-#if ! @HAVE_STRCASESTR@
+#if @GNULIB_STRCASESTR@
+# if @REPLACE_STRCASESTR@
+# define strcasestr rpl_strcasestr
+# endif
+# if ! @HAVE_STRCASESTR@ || @REPLACE_STRCASESTR@
extern char *strcasestr (const char *haystack, const char *needle)
__attribute__ ((__pure__));
-#endif
-#if defined GNULIB_POSIXCHECK
+# endif
+#elif defined GNULIB_POSIXCHECK
/* strcasestr() does not work with multibyte strings:
It is a glibc extension, and glibc implements it only for unibyte
locales. */
@@ -542,7 +546,10 @@ extern char *strerror (int);
#endif
#if @GNULIB_STRSIGNAL@
-# if ! @HAVE_DECL_STRSIGNAL@
+# if @REPLACE_STRSIGNAL@
+# define strsignal rpl_strsignal
+# endif
+# if ! @HAVE_DECL_STRSIGNAL@ || @REPLACE_STRSIGNAL@
extern char *strsignal (int __sig);
# endif
#elif defined GNULIB_POSIXCHECK
diff --git a/gnulib/m4/string_h.m4 b/gnulib/m4/string_h.m4
index 69761d7..766d7e9 100644
--- a/gnulib/m4/string_h.m4
+++ b/gnulib/m4/string_h.m4
@@ -5,7 +5,7 @@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# Written by Paul Eggert.
@@ -80,6 +80,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR])
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
+ REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
+ REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
])
diff --git a/gnulib/tests/test-getaddrinfo.c b/gnulib/tests/test-getaddrinfo.c
index 7763f43..00a980b 100644
--- a/gnulib/tests/test-getaddrinfo.c
+++ b/gnulib/tests/test-getaddrinfo.c
@@ -1,6 +1,6 @@
/* Test the getaddrinfo module.
- Copyright (C) 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2006-2008 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
/* Written by Simon Josefsson. */
-#include "config.h"
+#include <config.h>
#include "getaddrinfo.h"
#include "inet_ntop.h"
#include <stdio.h>
--
1.5.4.rc4.15.g215c5
16 years, 11 months
[Libvir] 0/8 add syntax checks
by Jim Meyering
A few days ago I wrote a patch eliminating all of the useless
if tests of the form "if (foo) free (foo);".
In general, when making such a global change, I prefer to
add a check so that it is easy to ensure mechanically that the
new violations don't sneak back in. So I wrote a script
to detect the above, then another to perform the "remove-if-cond"
part as a double check against my detect-and-manually-remove work.
Once you can mechanically detect the offending pattern,
it's good to make it as easy as possible to check for
recurrence. In other projects, I've used "make syntax-check",
because most such tests are syntax-related and detectable
using tools like grep.
The first patch simply removes the useless if tests.
Following it, I introduce a "make syntax-check" framework
similar to what I use in coreutils. In it, most tests
are disabled, except the new one that tests for the unnecessary
"if"-before-free.
In the following 6 patches, I enable new tests one by one, and
correct the violations each one exposes.
I deliberately keep these tests in a separate Makefile.maint
file, and pull them in via GNUmakefile so that they are not
subject to the burdensome portability constraints associated
with regular Makefile.am contents. I.e., if you run "make
syntax-check", you are expected to have GNU make as well
as a reasonable set of working tools. Thus, we don't have to
worry about whether egrep works or whether e.g., perl is present.
Jim
16 years, 11 months
Re: [Libvir] compilation of libvirt 0.4.0 and cvs snapshot failson SLES10sp1
by Sebastian Reitenbach
Hi,
"Richard W.M. Jones" <rjones(a)redhat.com> wrote:
> Sebastian Reitenbach wrote:
> > Hi,
> >
> > I am running sles10sp1 x86_64. I try to get xen 3.1.0 running on it, as
I
> > need a feature not in 3.0.4.
> >
> > Configure works well, but when it comes to compilation, then it fails
with
> > the following reason:
> >
> >
> >
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include
>
> -I../include -I../qemud -I/usr/include/libxml2 -DBINDIR=\"/usr/local/libexec\"
> > -DSBINDIR=\"/usr/local/sbin\" -DSYSCONF_DIR=\"/usr/local/etc\"
>
> -DLOCALEBASEDIR=\"/usr/local/share/locale\"
-DLOCAL_STATE_DIR=\"/usr/local/var\"
> > -DGETTEXT_PACKAGE=\"libvirt\" -Wall -Wformat -Wformat-security
> > -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow
>
> -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline
> > -Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
>
> -fasynchronous-unwind-tables -DWITH_QEMU -DWITH_TEST -DWITH_REMOTE -DWITH_XEN
-g
> > -O2 -MT
> >
libvirt_la-xen_unified.lo -MD -MP -MF .deps/libvirt_la-xen_unified.Tpo -c
> > xen_unified.c -fPIC -DPIC -o .libs/libvirt_la-xen_unified.o
> > In file included from /usr/include/xen/dom0_ops.h:31,
> > from xen_unified.c:29:
> > /usr/include/xen/xen.h:579: error: expected '=', ',', ';', 'asm'
> > or '__attribute__' before 'char'
> > /usr/include/xen/xen.h:580: error: expected '=', ',', ';', 'asm'
> > or '__attribute__' before 'short'
> > /usr/include/xen/xen.h:581: error: expected '=', ',', ';', 'asm'
> > or '__attribute__' before 'int'
> > /usr/include/xen/xen.h:582: error: expected '=', ',', ';', 'asm'
> > or '__attribute__' before 'long'
> > make[2]: *** [libvirt_la-xen_unified.lo] Error 1
> > make[2]: Leaving directory `/usr/local/src/libvirt-0.4.0/src'
> > make[1]: *** [all-recursive] Error 1
> > make[1]: Leaving directory `/usr/local/src/libvirt-0.4.0'
> > make: *** [all] Error 2
>
> Does src/xen_unified.c in that version '#include <config.h>' somewhere
> very close to the top of the file?
yes, it includes the config.h but it looks like this:
#include "config.h"
Sebastian
16 years, 11 months
[Libvir] compilation of libvirt 0.4.0 and cvs snapshot fails on SLES10sp1
by Sebastian Reitenbach
Hi,
I am running sles10sp1 x86_64. I try to get xen 3.1.0 running on it, as I
need a feature not in 3.0.4.
Configure works well, but when it comes to compilation, then it fails with
the following reason:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../gnulib/lib -I../gnulib/lib -I../include
-I../include -I../qemud -I/usr/include/libxml2 -DBINDIR=\"/usr/local/libexec\"
-DSBINDIR=\"/usr/local/sbin\" -DSYSCONF_DIR=\"/usr/local/etc\"
-DLOCALEBASEDIR=\"/usr/local/share/locale\" -DLOCAL_STATE_DIR=\"/usr/local/var\"
-DGETTEXT_PACKAGE=\"libvirt\" -Wall -Wformat -Wformat-security
-Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow
-Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline
-Wredundant-decls -Wno-sign-compare -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fasynchronous-unwind-tables -DWITH_QEMU -DWITH_TEST -DWITH_REMOTE -DWITH_XEN -g
-O2 -MT
libvirt_la-xen_unified.lo -MD -MP -MF .deps/libvirt_la-xen_unified.Tpo -c
xen_unified.c -fPIC -DPIC -o .libs/libvirt_la-xen_unified.o
In file included from /usr/include/xen/dom0_ops.h:31,
from xen_unified.c:29:
/usr/include/xen/xen.h:579: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'char'
/usr/include/xen/xen.h:580: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'short'
/usr/include/xen/xen.h:581: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'int'
/usr/include/xen/xen.h:582: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'long'
make[2]: *** [libvirt_la-xen_unified.lo] Error 1
make[2]: Leaving directory `/usr/local/src/libvirt-0.4.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/libvirt-0.4.0'
make: *** [all] Error 2
The same happens with xen 3.0.4 installed.
any hint what I can do about that?
kind regards
Sebastian
16 years, 11 months