Nobody was using it anyway.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
tools/virsh.c | 270 ++++++++++++++++++++++++++++-----------------------------
1 files changed, 134 insertions(+), 136 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 1f33256..ee55a20 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -299,8 +299,7 @@ static void vshDebug(vshControl *ctl, int level, const char *format,
...)
static const char *vshDomainStateToString(int state);
static const char *vshDomainVcpuStateToString(int state);
-static int vshConnectionUsability(vshControl *ctl, virConnectPtr conn,
- int showerror);
+static int vshConnectionUsability(vshControl *ctl, virConnectPtr conn);
static char *editWriteToTempFile (vshControl *ctl, const char *doc);
static int editFile (vshControl *ctl, const char *filename);
@@ -526,7 +525,7 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd)
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -680,7 +679,7 @@ cmdConsole(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
int ret;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -722,7 +721,7 @@ cmdList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
int maxname = 0;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
@@ -833,7 +832,7 @@ cmdDomstate(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -870,7 +869,7 @@ cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
char *name, *device;
struct _virDomainBlockStats stats;
- if (!vshConnectionUsability (ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability (ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain (ctl, cmd, &name)))
@@ -927,7 +926,7 @@ cmdDomIfstat (vshControl *ctl, const vshCmd *cmd)
char *name, *device;
struct _virDomainInterfaceStats stats;
- if (!vshConnectionUsability (ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability (ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain (ctl, cmd, &name)))
@@ -994,7 +993,7 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd)
struct _virDomainMemoryStat stats[VIR_DOMAIN_MEMORY_STAT_NR];
unsigned int nr_stats, i;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1049,7 +1048,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
const char *device;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -1094,7 +1093,7 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd)
char *name;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1142,7 +1141,7 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd)
#endif
unsigned int flags = VIR_DOMAIN_NONE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -1196,7 +1195,7 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -1243,7 +1242,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
int found;
int id;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
name = vshCommandOptString(cmd, "domain", &found);
@@ -1304,7 +1303,7 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
#endif
unsigned int flags = VIR_DOMAIN_NONE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL, VSH_BYNAME)))
@@ -1359,7 +1358,7 @@ cmdSave(vshControl *ctl, const vshCmd *cmd)
char *to;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(to = vshCommandOptString(cmd, "file", NULL)))
@@ -1400,7 +1399,7 @@ cmdManagedSave(vshControl *ctl, const vshCmd *cmd)
char *name;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1439,7 +1438,7 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd)
int ret = FALSE;
int hassave;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1596,7 +1595,7 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
int i, ret;
int ret_val = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -1708,7 +1707,7 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd)
int found;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -1750,7 +1749,7 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(to = vshCommandOptString(cmd, "file", NULL)))
@@ -1796,7 +1795,7 @@ cmdResume(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1834,7 +1833,7 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1872,7 +1871,7 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1910,7 +1909,7 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
@@ -1953,7 +1952,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd)
unsigned int id;
char *str, uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2067,7 +2066,7 @@ cmdDomjobinfo(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2148,7 +2147,7 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2182,7 +2181,7 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
int cell, cell_given;
unsigned long long memory;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
cell = vshCommandOptInt(cmd, "cellno", &cell_given);
@@ -2230,7 +2229,7 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd)
size_t cpumaplen;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2321,7 +2320,7 @@ cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
int i;
enum { expect_num, expect_num_or_comma } state;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2450,7 +2449,7 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
int maxcpu;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2506,7 +2505,7 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd)
int kilobytes;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2563,7 +2562,7 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd)
int kilobytes;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2613,7 +2612,7 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
virNodeInfo info;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (virNodeGetInfo(ctl->conn, &info) < 0) {
@@ -2646,7 +2645,7 @@ cmdCapabilities (vshControl *ctl, const vshCmd *cmd
ATTRIBUTE_UNUSED)
{
char *caps;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if ((caps = virConnectGetCapabilities (ctl->conn)) == NULL) {
@@ -2694,7 +2693,7 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
if (update)
flags |= VIR_DOMAIN_XML_UPDATE_CPU;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -2737,7 +2736,7 @@ cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd)
char *xmlData;
int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
format = vshCommandOptString(cmd, "format", NULL);
@@ -2782,7 +2781,7 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd)
char *xmlData;
int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
format = vshCommandOptString(cmd, "format", NULL);
@@ -2821,7 +2820,7 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL,
VSH_BYID|VSH_BYUUID)))
@@ -2852,7 +2851,7 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
unsigned int id;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL,
VSH_BYNAME|VSH_BYUUID)))
@@ -2887,7 +2886,7 @@ cmdDomuuid(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomainBy(ctl, cmd, NULL,
VSH_BYNAME|VSH_BYID)))
@@ -2937,7 +2936,7 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd)
const char *dname;
int flags = 0, found, ret = FALSE;
- if (!vshConnectionUsability (ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability (ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain (ctl, cmd, NULL)))
@@ -3030,7 +3029,7 @@ cmdMigrateSetMaxDowntime(vshControl *ctl, const vshCmd *cmd)
int found;
int ret = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -3075,7 +3074,7 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd)
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
@@ -3124,7 +3123,7 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -3172,7 +3171,7 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -3218,7 +3217,7 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
@@ -3257,7 +3256,7 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, NULL)))
@@ -3301,7 +3300,7 @@ cmdInterfaceEdit (vshControl *ctl, const vshCmd *cmd)
char *doc_reread = NULL;
int flags = VIR_INTERFACE_XML_INACTIVE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
iface = vshCommandOptInterface (ctl, cmd, NULL);
@@ -3398,7 +3397,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
char **activeNames = NULL, **inactiveNames = NULL;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
@@ -3519,7 +3518,7 @@ cmdNetworkName(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetworkBy(ctl, cmd, NULL,
VSH_BYUUID)))
@@ -3551,7 +3550,7 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd)
virNetworkPtr network;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetworkBy(ctl, cmd, NULL, VSH_BYNAME)))
@@ -3591,7 +3590,7 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
@@ -3629,7 +3628,7 @@ cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd)
virNetworkPtr network;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetworkBy(ctl, cmd, NULL,
@@ -3671,7 +3670,7 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd
ATTRIBUTE_UNUSED)
char **activeNames = NULL, **inactiveNames = NULL;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
@@ -3778,7 +3777,7 @@ cmdInterfaceName(vshControl *ctl, const vshCmd *cmd)
{
virInterfacePtr iface;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterfaceBy(ctl, cmd, NULL,
VSH_BYMAC)))
@@ -3808,7 +3807,7 @@ cmdInterfaceMAC(vshControl *ctl, const vshCmd *cmd)
{
virInterfacePtr iface;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterfaceBy(ctl, cmd, NULL,
VSH_BYNAME)))
@@ -3846,7 +3845,7 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd)
if (inactive)
flags |= VIR_INTERFACE_XML_INACTIVE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, NULL)))
@@ -3887,7 +3886,7 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -3932,7 +3931,7 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
@@ -3970,7 +3969,7 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
@@ -4008,7 +4007,7 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
@@ -4049,7 +4048,7 @@ cmdNWFilterDefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -4095,7 +4094,7 @@ cmdNWFilterUndefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(nwfilter = vshCommandOptNWFilter(ctl, cmd, &name)))
@@ -4134,7 +4133,7 @@ cmdNWFilterDumpXML(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(nwfilter = vshCommandOptNWFilter(ctl, cmd, NULL)))
@@ -4172,7 +4171,7 @@ cmdNWFilterList(vshControl *ctl, const vshCmd *cmd
ATTRIBUTE_UNUSED)
char **names;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
numfilters = virConnectNumOfNWFilters(ctl->conn);
@@ -4243,7 +4242,7 @@ cmdNWFilterEdit (vshControl *ctl, const vshCmd *cmd)
char *doc_edited = NULL;
char *doc_reread = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
nwfilter = vshCommandOptNWFilter (ctl, cmd, NULL);
@@ -4340,7 +4339,7 @@ cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd)
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -4390,7 +4389,7 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -4442,7 +4441,7 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -4493,7 +4492,7 @@ cmdNodeDeviceDestroy(vshControl *ctl, const vshCmd *cmd)
int found = 0;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) {
+ if (!vshConnectionUsability(ctl, ctl->conn)) {
return FALSE;
}
@@ -4607,7 +4606,7 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd)
char *xml, *name;
int printXML = vshCommandOptBool(cmd, "print-xml");
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!buildPoolXML(cmd, &name, &xml))
@@ -4655,7 +4654,7 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -4696,7 +4695,7 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd)
char *xml, *name;
int printXML = vshCommandOptBool(cmd, "print-xml");
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!buildPoolXML(cmd, &name, &xml))
@@ -4742,7 +4741,7 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -4782,7 +4781,7 @@ cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -4821,7 +4820,7 @@ cmdPoolDelete(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -4860,7 +4859,7 @@ cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -4899,7 +4898,7 @@ cmdPoolDumpXML(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
@@ -4963,7 +4962,7 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
inactive |= all;
/* Check the connection to libvirtd daemon is still working */
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
/* Retrieve the number of active storage pools */
@@ -5358,7 +5357,7 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd
ATTRIBUTE_UNUSED)
if (!found)
host = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (host) {
@@ -5437,7 +5436,7 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd
ATTRIBUTE_UNUSED)
if (!found)
srcSpecFile = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (srcSpecFile && virFileReadAll(srcSpecFile, VIRSH_MAX_XML_FILE,
&srcSpec) < 0)
@@ -5480,7 +5479,7 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
@@ -5572,7 +5571,7 @@ cmdPoolName(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
VSH_BYUUID)))
@@ -5604,7 +5603,7 @@ cmdPoolStart(vshControl *ctl, const vshCmd *cmd)
virStoragePoolPtr pool;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, VSH_BYNAME)))
@@ -5683,7 +5682,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
unsigned long long capacity, allocation = 0;
virBuffer buf = VIR_BUFFER_INITIALIZER;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
@@ -5823,7 +5822,7 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
@@ -5861,7 +5860,7 @@ cmdPoolUuid(vshControl *ctl, const vshCmd *cmd)
virStoragePoolPtr pool;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
@@ -5903,7 +5902,7 @@ cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
@@ -5964,7 +5963,7 @@ cmdVolCreateFrom(vshControl *ctl, const vshCmd *cmd)
int ret = FALSE;
char *buffer = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, VSH_BYNAME)))
@@ -6063,7 +6062,7 @@ cmdVolClone(vshControl *ctl, const vshCmd *cmd)
int found;
int ret = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(origvol = vshCommandOptVol(ctl, cmd, "vol", "pool",
NULL)))
@@ -6136,7 +6135,7 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool",
&name))) {
@@ -6177,7 +6176,7 @@ cmdVolWipe(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool",
&name))) {
@@ -6218,7 +6217,7 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
virStorageVolPtr vol;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
@@ -6269,7 +6268,7 @@ cmdVolDumpXML(vshControl *ctl, const vshCmd *cmd)
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
@@ -6309,7 +6308,7 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
int maxactive = 0, i;
char **activeNames = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", NULL)))
@@ -6385,7 +6384,7 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
@@ -6421,7 +6420,7 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd)
char uuid[VIR_UUID_STRING_BUFLEN];
/* Check the connection to libvirtd daemon is still working */
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
/* Use the supplied string to locate the volume */
@@ -6475,7 +6474,7 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
@@ -6509,7 +6508,7 @@ cmdVolPath(vshControl *ctl, const vshCmd *cmd)
virStorageVolPtr vol;
char *name = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool",
&name))) {
@@ -6543,7 +6542,7 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
virSecretPtr res;
char uuid[VIR_UUID_STRING_BUFLEN];
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", NULL);
@@ -6591,7 +6590,7 @@ cmdSecretDumpXML(vshControl *ctl, const vshCmd *cmd)
int ret = FALSE;
char *xml;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, NULL);
@@ -6633,7 +6632,7 @@ cmdSecretSetValue(vshControl *ctl, const vshCmd *cmd)
char *base64, *value;
int found, res, ret = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, NULL);
@@ -6692,7 +6691,7 @@ cmdSecretGetValue(vshControl *ctl, const vshCmd *cmd)
size_t value_size;
int ret = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, NULL);
@@ -6742,7 +6741,7 @@ cmdSecretUndefine(vshControl *ctl, const vshCmd *cmd)
int ret = FALSE;
char *uuid;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, &uuid);
@@ -6776,7 +6775,7 @@ cmdSecretList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
int maxuuids = 0, i;
char **uuids = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
maxuuids = virConnectNumOfSecrets(ctl->conn);
@@ -6852,7 +6851,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
unsigned int minor;
unsigned int rel;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
hvType = virConnectGetType(ctl->conn);
@@ -7011,7 +7010,7 @@ cmdNodeListDevices (vshControl *ctl, const vshCmd *cmd
ATTRIBUTE_UNUSED)
int found, num_devices, i;
int tree = vshCommandOptBool(cmd, "tree");
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
cap = vshCommandOptString(cmd, "cap", &found);
@@ -7098,7 +7097,7 @@ cmdNodeDeviceDumpXML (vshControl *ctl, const vshCmd *cmd)
virNodeDevicePtr device;
char *xml;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(name = vshCommandOptString(cmd, "device", NULL)))
return FALSE;
@@ -7141,7 +7140,7 @@ cmdNodeDeviceDettach (vshControl *ctl, const vshCmd *cmd)
virNodeDevicePtr device;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(name = vshCommandOptString(cmd, "device", NULL)))
return FALSE;
@@ -7182,7 +7181,7 @@ cmdNodeDeviceReAttach (vshControl *ctl, const vshCmd *cmd)
virNodeDevicePtr device;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(name = vshCommandOptString(cmd, "device", NULL)))
return FALSE;
@@ -7223,7 +7222,7 @@ cmdNodeDeviceReset (vshControl *ctl, const vshCmd *cmd)
virNodeDevicePtr device;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(name = vshCommandOptString(cmd, "device", NULL)))
return FALSE;
@@ -7256,7 +7255,7 @@ cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
char *hostname;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
hostname = virConnectGetHostname (ctl->conn);
@@ -7285,7 +7284,7 @@ cmdURI (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
char *uri;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
uri = virConnectGetURI (ctl->conn);
@@ -7325,7 +7324,7 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
int port = 0;
char *doc;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7399,7 +7398,7 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
int ret = FALSE;
char *doc;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7462,7 +7461,7 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7530,7 +7529,7 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7598,7 +7597,7 @@ cmdUpdateDevice(vshControl *ctl, const vshCmd *cmd)
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7669,7 +7668,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
char *buf = NULL, *tmp = NULL;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7800,7 +7799,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
int i = 0, diff_mac, ret = FALSE;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -7931,7 +7930,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
char *buf = NULL, *tmp = NULL;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -8102,7 +8101,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
int i = 0, diff_tgt, ret = FALSE;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
@@ -8220,7 +8219,7 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd)
char *buffer;
int result;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -8293,7 +8292,7 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
xmlXPathObjectPtr obj = NULL;
int res, i;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
@@ -8605,7 +8604,7 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd)
char *doc_reread = NULL;
int flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain (ctl, cmd, NULL);
@@ -8755,7 +8754,7 @@ cmdSnapshotCreate(vshControl *ctl, const vshCmd *cmd)
char *doc = NULL;
char *name = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -8848,7 +8847,7 @@ cmdSnapshotCurrent(vshControl *ctl, const vshCmd *cmd)
int current;
virDomainSnapshotPtr snapshot = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -8915,7 +8914,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
char timestr[100];
struct tm time_info;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -9024,7 +9023,7 @@ cmdSnapshotDumpXML(vshControl *ctl, const vshCmd *cmd)
virDomainSnapshotPtr snapshot = NULL;
char *xml = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -9082,7 +9081,7 @@ cmdDomainSnapshotRevert(vshControl *ctl, const vshCmd *cmd)
char *name;
virDomainSnapshotPtr snapshot = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -9138,7 +9137,7 @@ cmdSnapshotDelete(vshControl *ctl, const vshCmd *cmd)
virDomainSnapshotPtr snapshot = NULL;
unsigned int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
@@ -10273,14 +10272,13 @@ vshDomainVcpuStateToString(int state)
}
static int
-vshConnectionUsability(vshControl *ctl, virConnectPtr conn, int showerror)
+vshConnectionUsability(vshControl *ctl, virConnectPtr conn)
{
/* TODO: use something like virConnectionState() to
* check usability of the connection
*/
if (!conn) {
- if (showerror)
- vshError(ctl, "%s", _("no valid connection"));
+ vshError(ctl, "%s", _("no valid connection"));
return FALSE;
}
return TRUE;
--
1.7.1.1