提交 dab5d107 编写于 作者: M Mark McLoughlin

Mon Jan 23 12:28:42 IST 2007 Mark McLoughlin <markmc@redhat.com>

        Issues pointed out by Karel Zak <kzak@redhat.com>

        * src/virsh.c: fix up some syntax strings, use BUFSIZ
        and free names returned from virConnectListDefinedDomains()
上级 d042d339
Mon Jan 23 12:28:42 IST 2007 Mark McLoughlin <markmc@redhat.com>
Issues pointed out by Karel Zak <kzak@redhat.com>
* src/virsh.c: fix up some syntax strings, use BUFSIZ
and free names returned from virConnectListDefinedDomains()
Mon Jan 22 15:41:52 EST 2007 Daniel Berrange <berrange@redhat.com> Mon Jan 22 15:41:52 EST 2007 Daniel Berrange <berrange@redhat.com>
* src/virsh.c: Fix crash in 'connect' command by ensuring * src/virsh.c: Fix crash in 'connect' command by ensuring
......
...@@ -309,7 +309,7 @@ cmdConnect(vshControl * ctl, vshCmd * cmd) ...@@ -309,7 +309,7 @@ cmdConnect(vshControl * ctl, vshCmd * cmd)
* "list" command * "list" command
*/ */
static vshCmdInfo info_list[] = { static vshCmdInfo info_list[] = {
{"syntax", "list"}, {"syntax", "list [--inactive | --all]"},
{"help", gettext_noop("list domains")}, {"help", gettext_noop("list domains")},
{"desc", gettext_noop("Returns list of domains.")}, {"desc", gettext_noop("Returns list of domains.")},
{NULL, NULL} {NULL, NULL}
...@@ -419,8 +419,10 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED) ...@@ -419,8 +419,10 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
virDomainPtr dom = virDomainLookupByName(ctl->conn, names[i]); virDomainPtr dom = virDomainLookupByName(ctl->conn, names[i]);
/* this kind of work with domains is not atomic operation */ /* this kind of work with domains is not atomic operation */
if (!dom) if (!dom) {
free(names[i]);
continue; continue;
}
ret = virDomainGetInfo(dom, &info); ret = virDomainGetInfo(dom, &info);
id = virDomainGetID(dom); id = virDomainGetID(dom);
...@@ -439,6 +441,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED) ...@@ -439,6 +441,7 @@ cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
} }
virDomainFree(dom); virDomainFree(dom);
free(names[i]);
} }
if (ids) if (ids)
free(ids); free(ids);
...@@ -546,7 +549,7 @@ cmdCreate(vshControl * ctl, vshCmd * cmd) ...@@ -546,7 +549,7 @@ cmdCreate(vshControl * ctl, vshCmd * cmd)
char *from; char *from;
int found; int found;
int ret = TRUE; int ret = TRUE;
char buffer[4096]; char buffer[BUFSIZ];
int fd, l; int fd, l;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
...@@ -601,7 +604,7 @@ cmdDefine(vshControl * ctl, vshCmd * cmd) ...@@ -601,7 +604,7 @@ cmdDefine(vshControl * ctl, vshCmd * cmd)
char *from; char *from;
int found; int found;
int ret = TRUE; int ret = TRUE;
char buffer[4096]; char buffer[BUFSIZ];
int fd, l; int fd, l;
if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
...@@ -677,7 +680,7 @@ cmdUndefine(vshControl * ctl, vshCmd * cmd) ...@@ -677,7 +680,7 @@ cmdUndefine(vshControl * ctl, vshCmd * cmd)
* "start" command * "start" command
*/ */
static vshCmdInfo info_start[] = { static vshCmdInfo info_start[] = {
{"syntax", "start a domain "}, {"syntax", "start <domain>"},
{"help", gettext_noop("start a (previously defined) inactive domain")}, {"help", gettext_noop("start a (previously defined) inactive domain")},
{"desc", gettext_noop("Start a domain.")}, {"desc", gettext_noop("Start a domain.")},
{NULL, NULL} {NULL, NULL}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册