Fix compiler warnings in virsh.c

No functional change. These all generated compiler warnings which, for
some reason weren't converted to errors by
--enable-compiler-warnings=error.

* tools/virsh.c:
  - change return type from int to void on two functions that don't
    return a value.
  - remove unused variables/labels from two functions
  - eliminate non-literal format strings
  - typecast char* into xmlChar* when calling
  - xmlParseBalancedChunkMemory
This commit is contained in:
Laine Stump 2010-03-12 11:39:24 +01:00 committed by Daniel Veillard
parent ca842a6bcb
commit 7fbc2e37b8

View File

@ -421,7 +421,7 @@ static void vshCatchDisconnect(int sig, siginfo_t * siginfo,
* Catch SIGPIPE signals which may arise when disconnection * Catch SIGPIPE signals which may arise when disconnection
* from libvirtd occurs * from libvirtd occurs
*/ */
static int static void
vshSetupSignals(void) { vshSetupSignals(void) {
struct sigaction sig_action; struct sigaction sig_action;
@ -435,10 +435,10 @@ vshSetupSignals(void) {
/* /*
* vshReconnect: * vshReconnect:
* *
* Reconnect after an * Reconnect after a disconnect from libvirtd
* *
*/ */
static int static void
vshReconnect(vshControl *ctl) { vshReconnect(vshControl *ctl) {
if (ctl->conn != NULL) if (ctl->conn != NULL)
virConnectClose(ctl->conn); virConnectClose(ctl->conn);
@ -1896,9 +1896,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
{ {
virDomainJobInfo info; virDomainJobInfo info;
virDomainPtr dom; virDomainPtr dom;
int ret = TRUE, autostart; int ret = TRUE;
unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN];
if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE; return FALSE;
@ -1980,8 +1978,6 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
{ {
virDomainPtr dom; virDomainPtr dom;
int ret = TRUE; int ret = TRUE;
unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN];
if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE; return FALSE;
@ -1992,7 +1988,6 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
if (virDomainAbortJob(dom) < 0) if (virDomainAbortJob(dom) < 0)
ret = FALSE; ret = FALSE;
cleanup:
virDomainFree(dom); virDomainFree(dom);
return ret; return ret;
} }
@ -6705,7 +6700,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
} }
if (ret != 0) { if (ret != 0) {
vshError(ctl, _("Failed to attach interface")); vshError(ctl, "%s", _("Failed to attach interface"));
ret = FALSE; ret = FALSE;
} else { } else {
vshPrint(ctl, "%s", _("Interface attached successfully\n")); vshPrint(ctl, "%s", _("Interface attached successfully\n"));
@ -6834,7 +6829,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
} }
if (ret != 0) { if (ret != 0) {
vshError(ctl, _("Failed to detach interface")); vshError(ctl, "%s", _("Failed to detach interface"));
ret = FALSE; ret = FALSE;
} else { } else {
vshPrint(ctl, "%s", _("Interface detached successfully\n")); vshPrint(ctl, "%s", _("Interface detached successfully\n"));
@ -7007,7 +7002,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
} }
if (ret != 0) { if (ret != 0) {
vshError(ctl, _("Failed to attach disk")); vshError(ctl, "%s", _("Failed to attach disk"));
ret = FALSE; ret = FALSE;
} else { } else {
vshPrint(ctl, "%s", _("Disk attached successfully\n")); vshPrint(ctl, "%s", _("Disk attached successfully\n"));
@ -7128,7 +7123,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
} }
if (ret != 0) { if (ret != 0) {
vshError(ctl, _("Failed to detach disk")); vshError(ctl, "%s", _("Failed to detach disk"));
ret = FALSE; ret = FALSE;
} else { } else {
vshPrint(ctl, "%s", _("Disk detached successfully\n")); vshPrint(ctl, "%s", _("Disk detached successfully\n"));
@ -7257,7 +7252,8 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
if (doc == NULL) if (doc == NULL)
goto no_memory; goto no_memory;
res = xmlParseBalancedChunkMemory(doc, NULL, NULL, 0, buffer, &node_list); res = xmlParseBalancedChunkMemory(doc, NULL, NULL, 0,
(const xmlChar *)buffer, &node_list);
if (res != 0) { if (res != 0) {
vshError(ctl, _("Failed to parse XML fragment %s"), from); vshError(ctl, _("Failed to parse XML fragment %s"), from);
ret = FALSE; ret = FALSE;