add output on attach and detach success
* src/virsh.c: patch from Cole Robinson to add output on attach and detach success daniel
This commit is contained in:
parent
d9d3478a89
commit
54a4f8d44d
@ -1,3 +1,8 @@
|
|||||||
|
Wed Sep 3 14:37:06 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/virsh.c: patch from Cole Robinson to add output on attach
|
||||||
|
and detach success
|
||||||
|
|
||||||
Wed Sep 3 14:23:48 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
Wed Sep 3 14:23:48 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* AUTHORS: add Cole Robinson as commiter
|
* AUTHORS: add Cole Robinson as commiter
|
||||||
|
19
src/virsh.c
19
src/virsh.c
@ -4627,6 +4627,8 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
|
|||||||
vshError(ctl, FALSE, _("Failed to attach device from %s"), from);
|
vshError(ctl, FALSE, _("Failed to attach device from %s"), from);
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
vshPrint(ctl, _("Device attached successfully\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
@ -4684,6 +4686,8 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
|
|||||||
vshError(ctl, FALSE, _("Failed to detach device from %s"), from);
|
vshError(ctl, FALSE, _("Failed to detach device from %s"), from);
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
} else {
|
||||||
|
vshPrint(ctl, _("Device detached successfully\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
virDomainFree(dom);
|
virDomainFree(dom);
|
||||||
@ -4792,8 +4796,11 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (!buf) goto cleanup;
|
if (!buf) goto cleanup;
|
||||||
strcat(buf, " </interface>\n");
|
strcat(buf, " </interface>\n");
|
||||||
|
|
||||||
if (virDomainAttachDevice(dom, buf))
|
if (virDomainAttachDevice(dom, buf)) {
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
} else {
|
||||||
|
vshPrint(ctl, _("Interface attached successfully\n"));
|
||||||
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
@ -4909,8 +4916,10 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
|
|||||||
ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
|
ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
else
|
else {
|
||||||
|
vshPrint(ctl, _("Interface detached successfully\n"));
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
if (dom)
|
if (dom)
|
||||||
@ -5076,6 +5085,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
if (virDomainAttachDevice(dom, buf))
|
if (virDomainAttachDevice(dom, buf))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
else
|
||||||
|
vshPrint(ctl, _("Disk attached successfully\n"));
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
@ -5183,8 +5194,10 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
|
|||||||
ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
|
ret = virDomainDetachDevice(dom, (char *)xmlBufferContent(xml_buf));
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
else
|
else {
|
||||||
|
vshPrint(ctl, _("Disk detached successfully\n"));
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
xmlXPathFreeObject(obj);
|
xmlXPathFreeObject(obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user