mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fri Jun 15 08:53:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/internal.h, src/virsh.c: Replace _N with N_ so that
Solaris builds work (Mark Johnson).
* src/virsh.c: Add a couple of missing error messages (Mark
Johnson).
* python/types.c: Fix NULL pointer deref on DEBUG build
(Mark Johnson).
* src/virsh.c: Spelling fix (Mark Johnson).
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
|||||||
|
Fri Jun 15 08:53:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
|
||||||
|
|
||||||
|
* src/internal.h, src/virsh.c: Replace _N with N_ so that
|
||||||
|
Solaris builds work (Mark Johnson).
|
||||||
|
* src/virsh.c: Add a couple of missing error messages (Mark
|
||||||
|
Johnson).
|
||||||
|
* python/types.c: Fix NULL pointer deref on DEBUG build
|
||||||
|
(Mark Johnson).
|
||||||
|
* src/virsh.c: Spelling fix (Mark Johnson).
|
||||||
|
|
||||||
Thu Jun 14 21:30:28 EST 2007 Daniel Berrange <berrange@redhat.com>
|
Thu Jun 14 21:30:28 EST 2007 Daniel Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* libvirt.spec.in: Change way extra_release is inserted to
|
* libvirt.spec.in: Change way extra_release is inserted to
|
||||||
|
|||||||
@@ -62,13 +62,13 @@ libvirt_charPtrWrap(char *str)
|
|||||||
{
|
{
|
||||||
PyObject *ret;
|
PyObject *ret;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
|
||||||
#endif
|
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return (Py_None);
|
return (Py_None);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
||||||
|
#endif
|
||||||
ret = PyString_FromString(str);
|
ret = PyString_FromString(str);
|
||||||
free(str);
|
free(str);
|
||||||
return (ret);
|
return (ret);
|
||||||
@@ -79,13 +79,13 @@ libvirt_constcharPtrWrap(const char *str)
|
|||||||
{
|
{
|
||||||
PyObject *ret;
|
PyObject *ret;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
|
||||||
#endif
|
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return (Py_None);
|
return (Py_None);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
||||||
|
#endif
|
||||||
ret = PyString_FromString(str);
|
ret = PyString_FromString(str);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@@ -95,13 +95,13 @@ libvirt_charPtrConstWrap(const char *str)
|
|||||||
{
|
{
|
||||||
PyObject *ret;
|
PyObject *ret;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
|
||||||
#endif
|
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return (Py_None);
|
return (Py_None);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("libvirt_xmlcharPtrWrap: str = %s\n", str);
|
||||||
|
#endif
|
||||||
ret = PyString_FromString(str);
|
ret = PyString_FromString(str);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _(str) dgettext(GETTEXT_PACKAGE, (str))
|
#define _(str) dgettext(GETTEXT_PACKAGE, (str))
|
||||||
#define _N(str) dgettext(GETTEXT_PACKAGE, (str))
|
#define N_(str) dgettext(GETTEXT_PACKAGE, (str))
|
||||||
#define gettext_noop(str) (str)
|
#define gettext_noop(str) (str)
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|||||||
29
src/virsh.c
29
src/virsh.c
@@ -324,7 +324,7 @@ cmdHelp(vshControl * ctl, vshCmd * cmd)
|
|||||||
vshPrint(ctl, _("Commands:\n\n"));
|
vshPrint(ctl, _("Commands:\n\n"));
|
||||||
for (def = commands; def->name; def++)
|
for (def = commands; def->name; def++)
|
||||||
vshPrint(ctl, " %-15s %s\n", def->name,
|
vshPrint(ctl, " %-15s %s\n", def->name,
|
||||||
_N(vshCmddefGetInfo(def, "help")));
|
N_(vshCmddefGetInfo(def, "help")));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
return vshCmddefHelp(ctl, cmdname, FALSE);
|
return vshCmddefHelp(ctl, cmdname, FALSE);
|
||||||
@@ -581,7 +581,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
|
|||||||
if (virDomainGetInfo(dom, &info) < 0)
|
if (virDomainGetInfo(dom, &info) < 0)
|
||||||
state = _("no state");
|
state = _("no state");
|
||||||
else
|
else
|
||||||
state = _N(vshDomainStateToString(info.state));
|
state = N_(vshDomainStateToString(info.state));
|
||||||
|
|
||||||
vshPrint(ctl, "%3d %-20s %s\n",
|
vshPrint(ctl, "%3d %-20s %s\n",
|
||||||
virDomainGetID(dom),
|
virDomainGetID(dom),
|
||||||
@@ -603,7 +603,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
|
|||||||
if (virDomainGetInfo(dom, &info) < 0)
|
if (virDomainGetInfo(dom, &info) < 0)
|
||||||
state = _("no state");
|
state = _("no state");
|
||||||
else
|
else
|
||||||
state = _N(vshDomainStateToString(info.state));
|
state = N_(vshDomainStateToString(info.state));
|
||||||
|
|
||||||
vshPrint(ctl, "%3s %-20s %s\n", "-", names[i], state);
|
vshPrint(ctl, "%3s %-20s %s\n", "-", names[i], state);
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ cmdDomstate(vshControl * ctl, vshCmd * cmd)
|
|||||||
|
|
||||||
if (virDomainGetInfo(dom, &info) == 0)
|
if (virDomainGetInfo(dom, &info) == 0)
|
||||||
vshPrint(ctl, "%s\n",
|
vshPrint(ctl, "%s\n",
|
||||||
_N(vshDomainStateToString(info.state)));
|
N_(vshDomainStateToString(info.state)));
|
||||||
else
|
else
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
|
||||||
@@ -705,7 +705,7 @@ static vshCmdInfo info_create[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static vshCmdOptDef opts_create[] = {
|
static vshCmdOptDef opts_create[] = {
|
||||||
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("file conatining an XML domain description")},
|
{"file", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("file containing an XML domain description")},
|
||||||
{NULL, 0, 0, NULL}
|
{NULL, 0, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1383,7 +1383,7 @@ cmdDominfo(vshControl * ctl, vshCmd * cmd)
|
|||||||
|
|
||||||
if (virDomainGetInfo(dom, &info) == 0) {
|
if (virDomainGetInfo(dom, &info) == 0) {
|
||||||
vshPrint(ctl, "%-15s %s\n", _("State:"),
|
vshPrint(ctl, "%-15s %s\n", _("State:"),
|
||||||
_N(vshDomainStateToString(info.state)));
|
N_(vshDomainStateToString(info.state)));
|
||||||
|
|
||||||
vshPrint(ctl, "%-15s %d\n", _("CPU(s):"), info.nrVirtCpu);
|
vshPrint(ctl, "%-15s %d\n", _("CPU(s):"), info.nrVirtCpu);
|
||||||
|
|
||||||
@@ -1469,7 +1469,7 @@ cmdVcpuinfo(vshControl * ctl, vshCmd * cmd)
|
|||||||
vshPrint(ctl, "%-15s %d\n", _("VCPU:"), n);
|
vshPrint(ctl, "%-15s %d\n", _("VCPU:"), n);
|
||||||
vshPrint(ctl, "%-15s %d\n", _("CPU:"), cpuinfo[n].cpu);
|
vshPrint(ctl, "%-15s %d\n", _("CPU:"), cpuinfo[n].cpu);
|
||||||
vshPrint(ctl, "%-15s %s\n", _("State:"),
|
vshPrint(ctl, "%-15s %s\n", _("State:"),
|
||||||
_N(vshDomainVcpuStateToString(cpuinfo[n].state)));
|
N_(vshDomainVcpuStateToString(cpuinfo[n].state)));
|
||||||
if (cpuinfo[n].cpuTime != 0) {
|
if (cpuinfo[n].cpuTime != 0) {
|
||||||
double cpuUsed = cpuinfo[n].cpuTime;
|
double cpuUsed = cpuinfo[n].cpuTime;
|
||||||
|
|
||||||
@@ -1487,6 +1487,10 @@ cmdVcpuinfo(vshControl * ctl, vshCmd * cmd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (info.state == VIR_DOMAIN_SHUTOFF) {
|
||||||
|
vshError(ctl, FALSE,
|
||||||
|
_("Domain shut off, virtual CPUs not present."));
|
||||||
|
}
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1618,6 +1622,7 @@ cmdSetvcpus(vshControl * ctl, vshCmd * cmd)
|
|||||||
|
|
||||||
count = vshCommandOptInt(cmd, "count", &count);
|
count = vshCommandOptInt(cmd, "count", &count);
|
||||||
if (!count) {
|
if (!count) {
|
||||||
|
vshError(ctl, FALSE, _("Invalid number of virtual CPUs."));
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -1629,7 +1634,7 @@ cmdSetvcpus(vshControl * ctl, vshCmd * cmd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count > maxcpu) {
|
if (count > maxcpu) {
|
||||||
vshError(ctl, FALSE, _("Too many virtual CPU's."));
|
vshError(ctl, FALSE, _("Too many virtual CPUs."));
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -2865,8 +2870,8 @@ vshCmddefHelp(vshControl * ctl, const char *cmdname, int withprog)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
vshCmdOptDef *opt;
|
vshCmdOptDef *opt;
|
||||||
const char *desc = _N(vshCmddefGetInfo(def, "desc"));
|
const char *desc = N_(vshCmddefGetInfo(def, "desc"));
|
||||||
const char *help = _N(vshCmddefGetInfo(def, "help"));
|
const char *help = N_(vshCmddefGetInfo(def, "help"));
|
||||||
const char *syntax = vshCmddefGetInfo(def, "syntax");
|
const char *syntax = vshCmddefGetInfo(def, "syntax");
|
||||||
|
|
||||||
fputs(_(" NAME\n"), stdout);
|
fputs(_(" NAME\n"), stdout);
|
||||||
@@ -2897,7 +2902,7 @@ vshCmddefHelp(vshControl * ctl, const char *cmdname, int withprog)
|
|||||||
else if (opt->type == VSH_OT_DATA)
|
else if (opt->type == VSH_OT_DATA)
|
||||||
snprintf(buf, sizeof(buf), "<%s>", opt->name);
|
snprintf(buf, sizeof(buf), "<%s>", opt->name);
|
||||||
|
|
||||||
fprintf(stdout, " %-15s %s\n", buf, _N(opt->help));
|
fprintf(stdout, " %-15s %s\n", buf, N_(opt->help));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fputc('\n', stdout);
|
fputc('\n', stdout);
|
||||||
@@ -3803,7 +3808,7 @@ vshUsage(vshControl * ctl, const char *cmdname)
|
|||||||
|
|
||||||
for (cmd = commands; cmd->name; cmd++)
|
for (cmd = commands; cmd->name; cmd++)
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
" %-15s %s\n", cmd->name, _N(vshCmddefGetInfo(cmd,
|
" %-15s %s\n", cmd->name, N_(vshCmddefGetInfo(cmd,
|
||||||
"help")));
|
"help")));
|
||||||
|
|
||||||
fprintf(stdout,
|
fprintf(stdout,
|
||||||
|
|||||||
Reference in New Issue
Block a user