mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Fri Feb 23 10:26:24 IST 2007 Mark McLoughlin <markmc@redhat.com>
* src/virsh.c: in "start" and "net-start" use e.g. vshCommandOptDomainBy() so that we actually get an error message if the domain/network isn't found.
This commit is contained in:
parent
91e461ffdd
commit
992176b177
@ -1,3 +1,9 @@
|
||||
Fri Feb 23 10:26:24 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||
|
||||
* src/virsh.c: in "start" and "net-start" use e.g.
|
||||
vshCommandOptDomainBy() so that we actually get an
|
||||
error message if the domain/network isn't found.
|
||||
|
||||
Fri Feb 23 09:11:53 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||
|
||||
* qemud/conf.c: actually autostart guests/networks at startup
|
||||
|
30
src/virsh.c
30
src/virsh.c
@ -814,19 +814,12 @@ static int
|
||||
cmdStart(vshControl * ctl, vshCmd * cmd)
|
||||
{
|
||||
virDomainPtr dom;
|
||||
char *name;
|
||||
int found;
|
||||
int ret = TRUE;
|
||||
|
||||
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||
return FALSE;
|
||||
|
||||
name = vshCommandOptString(cmd, "name", &found);
|
||||
if (!found)
|
||||
return FALSE;
|
||||
|
||||
dom = virDomainLookupByName(ctl->conn, name);
|
||||
if (!dom)
|
||||
if (!(dom = vshCommandOptDomainBy(ctl, cmd, "name", NULL, VSH_BYNAME)))
|
||||
return FALSE;
|
||||
|
||||
if (virDomainGetID(dom) != (unsigned int)-1) {
|
||||
@ -836,9 +829,10 @@ cmdStart(vshControl * ctl, vshCmd * cmd)
|
||||
|
||||
if (virDomainCreate(dom) == 0) {
|
||||
vshPrint(ctl, _("Domain %s started\n"),
|
||||
name);
|
||||
virDomainGetName(dom));
|
||||
} else {
|
||||
vshError(ctl, FALSE, _("Failed to start domain %s"), name);
|
||||
vshError(ctl, FALSE, _("Failed to start domain %s"),
|
||||
virDomainGetName(dom));
|
||||
ret = FALSE;
|
||||
}
|
||||
return ret;
|
||||
@ -2085,26 +2079,20 @@ static int
|
||||
cmdNetworkStart(vshControl * ctl, vshCmd * cmd)
|
||||
{
|
||||
virNetworkPtr network;
|
||||
char *name;
|
||||
int found;
|
||||
int ret = TRUE;
|
||||
|
||||
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||
return FALSE;
|
||||
|
||||
name = vshCommandOptString(cmd, "name", &found);
|
||||
if (!found)
|
||||
return FALSE;
|
||||
|
||||
network = virNetworkLookupByName(ctl->conn, name);
|
||||
if (!network)
|
||||
return FALSE;
|
||||
if (!(network = vshCommandOptNetworkBy(ctl, cmd, "name", NULL, VSH_BYNAME)))
|
||||
return FALSE;
|
||||
|
||||
if (virNetworkCreate(network) == 0) {
|
||||
vshPrint(ctl, _("Network %s started\n"),
|
||||
name);
|
||||
virNetworkGetName(network));
|
||||
} else {
|
||||
vshError(ctl, FALSE, _("Failed to start network %s"), name);
|
||||
vshError(ctl, FALSE, _("Failed to start network %s"),
|
||||
virNetworkGetName(network));
|
||||
ret = FALSE;
|
||||
}
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user