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);
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
virDomainPtr dom;
int ret;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int maxname = 0;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
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)))
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)))
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)))
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)))
char *name;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
#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);
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int found;
int id;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
name = vshCommandOptString(cmd, "domain", &found);
#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)))
char *to;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(to = vshCommandOptString(cmd, "file", NULL)))
char *name;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
int ret = FALSE;
int hassave;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
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)))
int found;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
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)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
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)))
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
virDomainPtr dom;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
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);
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)))
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)))
int maxcpu;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int kilobytes;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int kilobytes;
int ret = TRUE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
{
virNodeInfo info;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (virNodeGetInfo(ctl->conn, &info) < 0) {
{
char *caps;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if ((caps = virConnectGetCapabilities (ctl->conn)) == NULL) {
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)))
char *xmlData;
int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
format = vshCommandOptString(cmd, "format", NULL);
char *xmlData;
int flags = 0;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
format = vshCommandOptString(cmd, "format", NULL);
{
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)))
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)))
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)))
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)))
int found;
int ret = FALSE;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, NULL)))
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);
char **activeNames = NULL, **inactiveNames = NULL;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
{
virNetworkPtr network;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetworkBy(ctl, cmd, NULL,
VSH_BYUUID)))
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)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(network = vshCommandOptNetwork(ctl, cmd, &name)))
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,
char **activeNames = NULL, **inactiveNames = NULL;
inactive |= all;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (active) {
{
virInterfacePtr iface;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterfaceBy(ctl, cmd, NULL,
VSH_BYMAC)))
{
virInterfacePtr iface;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterfaceBy(ctl, cmd, NULL,
VSH_BYNAME)))
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)))
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(iface = vshCommandOptInterface(ctl, cmd, &name)))
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int ret = TRUE;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(nwfilter = vshCommandOptNWFilter(ctl, cmd, &name)))
int ret = TRUE;
char *dump;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(nwfilter = vshCommandOptNWFilter(ctl, cmd, NULL)))
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);
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);
char *name;
int autostart;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPool(ctl, cmd, "pool", &name)))
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
int found = 0;
char *name;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) {
+ if (!vshConnectionUsability(ctl, ctl->conn)) {
return FALSE;
}
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))
int ret = TRUE;
char *buffer;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
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))
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)))
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)))
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)))
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)))
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)))
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 */
if (!found)
host = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (host) {
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)
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)))
{
virStoragePoolPtr pool;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL,
VSH_BYUUID)))
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)))
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,
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)))
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,
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,
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)))
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)))
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))) {
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))) {
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)))
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)))
struct volInfoText *volInfoTexts = NULL;
/* Check the connection to libvirtd daemon is still working */
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
/* Look up the pool information given to us by the user */
{
virStorageVolPtr vol;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
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 */
{
virStorageVolPtr vol;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
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))) {
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);
int ret = FALSE;
char *xml;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, NULL);
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);
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);
int ret = FALSE;
char *uuid;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
secret = vshCommandOptSecret(ctl, cmd, &uuid);
int maxuuids = 0, i;
char **uuids = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
maxuuids = virConnectNumOfSecrets(ctl->conn);
unsigned int minor;
unsigned int rel;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
hvType = virConnectGetType(ctl->conn);
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);
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;
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;
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;
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;
{
char *hostname;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
hostname = virConnectGetHostname (ctl->conn);
{
char *uri;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
uri = virConnectGetURI (ctl->conn);
int port = 0;
char *doc;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int ret = FALSE;
char *doc;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
int found;
unsigned int flags;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
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)))
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)))
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)))
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)))
char *buffer;
int result;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
xmlXPathObjectPtr obj = NULL;
int res, i;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
return FALSE;
from = vshCommandOptString(cmd, "file", &found);
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);
char *doc = NULL;
char *name = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
int current;
virDomainSnapshotPtr snapshot = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
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);
virDomainSnapshotPtr snapshot = NULL;
char *xml = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
char *name;
virDomainSnapshotPtr snapshot = NULL;
- if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
+ if (!vshConnectionUsability(ctl, ctl->conn))
goto cleanup;
dom = vshCommandOptDomain(ctl, cmd, NULL);
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);
}
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;