return rc;
}
-#define CHECK_CONN(client) \
- if (!client->conn) { \
- remoteDispatchFormatError(rerr, "%s", _("connection not open")); \
- return -1; \
- }
static int
remoteDispatchClose(struct qemud_server *server ATTRIBUTE_UNUSED,
remote_error *rerr,
remote_supports_feature_args *args, remote_supports_feature_ret *ret)
{
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
ret->supported = virDrvSupportsFeature(conn, args->feature);
if (ret->supported == -1) {
{
const char *type;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
type = virConnectGetType(conn);
if (type == NULL) {
remoteDispatchConnError(rerr, conn);
{
unsigned long hvVer;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (virConnectGetVersion(conn, &hvVer) == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
{
unsigned long libVer;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (virConnectGetLibVersion(conn, &libVer) == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
{
char *hostname;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
hostname = virConnectGetHostname(conn);
if (hostname == NULL) {
remoteDispatchConnError(rerr, conn);
remote_get_uri_ret *ret)
{
char *uri;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
uri = virConnectGetURI(conn);
if (uri == NULL) {
unsigned int flags;
char *sysinfo;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
flags = args->flags;
sysinfo = virConnectGetSysinfo(conn, flags);
if (sysinfo == NULL) {
{
char *type;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
type = args->type ? *args->type : NULL;
ret->max_vcpus = virConnectGetMaxVcpus(conn, type);
if (ret->max_vcpus == -1) {
{
virNodeInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (virNodeGetInfo(conn, &info) == -1) {
remoteDispatchConnError(rerr, conn);
return -1;
{
char *caps;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
caps = virConnectGetCapabilities(conn);
if (caps == NULL) {
remoteDispatchConnError(rerr, conn);
{
int err;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->maxCells > REMOTE_NODE_MAX_CELLS) {
remoteDispatchFormatError(rerr,
"%s", _("maxCells > REMOTE_NODE_MAX_CELLS"));
{
unsigned long long freeMem;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
freeMem = virNodeGetFreeMemory(conn);
if (freeMem == 0) {
remoteDispatchConnError(rerr, conn);
char *type;
int nparams;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
virSchedParameterPtr params;
int i, r, nparams;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->nparams;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
int i, r, nparams;
virSchedParameterPtr params;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->params.params_len;
if (nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) {
char *path;
struct _virDomainBlockStats stats;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
char *path;
struct _virDomainInterfaceStats stats;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
struct _virDomainMemoryStat *stats;
unsigned int nr_stats, i;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->maxStats > REMOTE_DOMAIN_MEMORY_STATS_MAX) {
remoteDispatchFormatError(rerr, "%s",
_("maxStats > REMOTE_DOMAIN_MEMORY_STATS_MAX"));
size_t size;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
size_t size;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = virDomainCreateXML(conn, args->xml_desc, args->flags);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = virDomainDefineXML(conn, args->xml);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
remote_domain_xml_from_native_args *args,
remote_domain_xml_from_native_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
/* remoteDispatchClientRequest will free this. */
ret->domainXml = virConnectDomainXMLFromNative(conn,
args->nativeFormat,
remote_domain_xml_to_native_args *args,
remote_domain_xml_to_native_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
/* remoteDispatchClientRequest will free this. */
ret->nativeConfig = virConnectDomainXMLToNative(conn,
args->nativeFormat,
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainPtr dom;
virDomainInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainPtr dom;
virSecurityLabelPtr seclabel;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecurityModel secmodel;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
memset(&secmodel, 0, sizeof secmodel);
if (virNodeGetSecurityModel(conn, &secmodel) == -1) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
unsigned char *cpumaps = NULL;
int info_len, i;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
char **uri_out;
char *dname;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
uri_in = args->uri_in == NULL ? NULL : *args->uri_in;
dname = args->dname == NULL ? NULL : *args->dname;
virDomainPtr dom;
char *dname;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
remote_domain_migrate_finish_ret *ret)
{
virDomainPtr ddom;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ddom = virDomainMigrateFinish(conn, args->dname,
args->cookie.cookie_val,
char *uri_in;
char **uri_out;
char *dname;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
uri_in = args->uri_in == NULL ? NULL : *args->uri_in;
dname = args->dname == NULL ? NULL : *args->dname;
remote_domain_migrate_finish2_ret *ret)
{
virDomainPtr ddom;
- CHECK_CONN (client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ddom = virDomainMigrateFinish2(conn, args->dname,
args->cookie.cookie_val,
int r;
char *dname;
struct qemud_client_stream *stream;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dname = args->dname == NULL ? NULL : *args->dname;
remote_list_defined_domains_args *args,
remote_list_defined_domains_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_DOMAIN_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = virDomainLookupByID(conn, args->id);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = virDomainLookupByName(conn, args->name);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = virDomainLookupByUUID(conn, (unsigned char *) args->uuid);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_num_of_defined_domains_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfDefinedDomains(conn);
if (ret->num == -1) {
virDomainPtr dom;
int rv;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
remote_domain_restore_args *args,
void *ret ATTRIBUTE_UNUSED)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (virDomainRestore(conn, args->from) == -1) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
virMemoryParameterPtr params;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->params.params_len;
flags = args->flags;
int i, r, nparams;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->nparams;
flags = args->flags;
virBlkioParameterPtr params;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->params.params_len;
flags = args->flags;
int i, r, nparams;
unsigned int flags;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nparams = args->nparams;
flags = args->flags;
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
remote_list_defined_networks_args *args,
remote_list_defined_networks_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
remote_list_domains_args *args,
remote_list_domains_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxids > REMOTE_DOMAIN_ID_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
remote_list_networks_args *args,
remote_list_networks_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = virNetworkCreateXML(conn, args->xml);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = virNetworkDefineXML(conn, args->xml);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = virNetworkLookupByName(conn, args->name);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = virNetworkLookupByUUID(conn, (unsigned char *) args->uuid);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr net;
- net = get_nonnull_network(conn, args->net);
- if (net == NULL) {
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
+ net = get_nonnull_network(conn, args->net);
+ if (net == NULL) {
remoteDispatchConnError(rerr, conn);
return -1;
}
{
virNetworkPtr net;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
net = get_nonnull_network(conn, args->net);
if (net == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_num_of_defined_networks_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfDefinedNetworks(conn);
if (ret->num == -1) {
void *args ATTRIBUTE_UNUSED,
remote_num_of_domains_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfDomains(conn);
if (ret->num == -1) {
void *args ATTRIBUTE_UNUSED,
remote_num_of_networks_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfNetworks(conn);
if (ret->num == -1) {
void *args ATTRIBUTE_UNUSED,
remote_num_of_interfaces_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfInterfaces(conn);
if (ret->num == -1) {
remote_list_interfaces_args *args,
remote_list_interfaces_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_INTERFACE_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
void *args ATTRIBUTE_UNUSED,
remote_num_of_defined_interfaces_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfDefinedInterfaces(conn);
if (ret->num == -1) {
remote_list_defined_interfaces_args *args,
remote_list_defined_interfaces_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_DEFINED_INTERFACE_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = virInterfaceLookupByName(conn, args->name);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = virInterfaceLookupByMACString(conn, args->mac);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = virInterfaceDefineXML(conn, args->xml, args->flags);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
remote_list_defined_storage_pools_args *args,
remote_list_defined_storage_pools_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_NETWORK_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr, "%s",
remote_list_storage_pools_args *args,
remote_list_storage_pools_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_STORAGE_POOL_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
remote_find_storage_pool_sources_args *args,
remote_find_storage_pool_sources_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
ret->xml =
virConnectFindStoragePoolSources(conn,
args->type,
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = virStoragePoolCreateXML(conn, args->xml, args->flags);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = virStoragePoolDefineXML(conn, args->xml, args->flags);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
virStoragePoolPtr pool;
virStoragePoolInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = virStoragePoolLookupByName(conn, args->name);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = virStoragePoolLookupByUUID(conn, (unsigned char *) args->uuid);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
virStoragePoolPtr pool;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_num_of_storage_pools_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfStoragePools(conn);
if (ret->num == -1) {
void *args ATTRIBUTE_UNUSED,
remote_num_of_defined_storage_pools_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfDefinedStoragePools(conn);
if (ret->num == -1) {
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
"%s", _("maxnames > REMOTE_STORAGE_VOL_NAME_LIST_MAX"));
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
virStoragePoolPtr pool;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
virStoragePoolPtr pool;
virStorageVolPtr clonevol, newvol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
int retval = -1;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
virStorageVolPtr vol;
virStorageVolInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
virStoragePoolPtr pool;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = virStorageVolLookupByKey(conn, args->key);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = virStorageVolLookupByPath(conn, args->path);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
remote_node_num_of_devices_args *args,
remote_node_num_of_devices_ret *ret)
{
- CHECK_CONN(client);
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virNodeNumOfDevices(conn,
args->cap ? *args->cap : NULL,
remote_node_list_devices_args *args,
remote_node_list_devices_ret *ret)
{
- CHECK_CONN(client);
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_NODE_DEVICE_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remote_node_device_dump_xml_ret *ret)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
{
virNodeDevicePtr dev;
const char *parent;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remote_node_device_num_of_caps_ret *ret)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remote_node_device_list_caps_ret *ret)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
void *ret ATTRIBUTE_UNUSED)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
void *ret ATTRIBUTE_UNUSED)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
void *ret ATTRIBUTE_UNUSED)
{
virNodeDevicePtr dev;
- CHECK_CONN(client);
+
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
{
virNodeDevicePtr dev;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dev = virNodeDeviceCreateXML(conn, args->xml_desc, args->flags);
if (dev == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNodeDevicePtr dev;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dev = virNodeDeviceLookupByName(conn, args->name);
if (dev == NULL) {
remoteDispatchConnError(rerr, conn);
struct qemud_client_stream *stream = NULL;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
struct qemud_client_stream *stream = NULL;
virStorageVolPtr vol;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
vol = get_nonnull_storage_vol(conn, args->vol);
if (vol == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_domain_events_register_ret *ret ATTRIBUTE_UNUSED)
{
- CHECK_CONN(client);
int callbackID;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] != -1) {
remoteDispatchFormatError(rerr, _("domain event %d already registered"), VIR_DOMAIN_EVENT_ID_LIFECYCLE);
return -1;
void *args ATTRIBUTE_UNUSED,
remote_domain_events_deregister_ret *ret ATTRIBUTE_UNUSED)
{
- CHECK_CONN(client);
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (client->domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LIFECYCLE] == -1) {
remoteDispatchFormatError(rerr, _("domain event %d not registered"), VIR_DOMAIN_EVENT_ID_LIFECYCLE);
void *args ATTRIBUTE_UNUSED,
remote_num_of_secrets_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
ret->num = virConnectNumOfSecrets(conn);
if (ret->num == -1) {
remoteDispatchConnError(rerr, conn);
remote_list_secrets_args *args,
remote_list_secrets_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->maxuuids > REMOTE_SECRET_UUID_LIST_MAX) {
remoteDispatchFormatError(rerr, "%s",
_("maxuuids > REMOTE_SECRET_UUID_LIST_MAX"));
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = virSecretDefineXML(conn, args->xml, args->flags);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
size_t value_size;
unsigned char *value;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = get_nonnull_secret(conn, args->secret);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = get_nonnull_secret(conn, args->secret);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = virSecretLookupByUUID(conn, (unsigned char *)args->uuid);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = get_nonnull_secret(conn, args->secret);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = get_nonnull_secret(conn, args->secret);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virSecretPtr secret;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
secret = virSecretLookupByUsage(conn, args->usageType, args->usageID);
if (secret == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->dom);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
{
virInterfacePtr iface;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
iface = get_nonnull_interface(conn, args->iface);
if (iface == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr network;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
network = get_nonnull_network(conn, args->net);
if (network == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNetworkPtr network;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
network = get_nonnull_network(conn, args->net);
if (network == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
{
virStoragePoolPtr pool;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
pool = get_nonnull_storage_pool(conn, args->pool);
if (pool == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_is_secure_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
ret->secure = virConnectIsSecure(conn);
if (ret->secure < 0) {
{
int result;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
result = virConnectCompareCPU(conn, args->xml, args->flags);
if (result == VIR_CPU_COMPARE_ERROR) {
remoteDispatchConnError(rerr, conn);
{
char *cpu;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
cpu = virConnectBaselineCPU(conn,
(const char **) args->xmlCPUs.xmlCPUs_val,
args->xmlCPUs.xmlCPUs_len,
virDomainPtr dom;
virDomainJobInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr dom;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainSnapshotPtr snapshot;
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainSnapshotPtr snapshot = NULL;
int rc = -1;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->snap.domain);
if (domain == NULL)
goto cleanup;
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->nameslen > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX) {
remoteDispatchFormatError(rerr, "%s",
_("nameslen > REMOTE_DOMAIN_SNAPSHOT_LIST_NAMES_MAX"));
virDomainSnapshotPtr snapshot;
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainPtr domain;
int result;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainSnapshotPtr snapshot;
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
virDomainSnapshotPtr snapshot = NULL;
int rc = -1;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->snap.domain);
if (domain == NULL)
goto cleanup;
virDomainSnapshotPtr snapshot = NULL;
int rc = -1;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->snap.domain);
if (domain == NULL)
goto cleanup;
remote_domain_events_register_any_args *args,
void *ret ATTRIBUTE_UNUSED)
{
- CHECK_CONN(client);
int callbackID;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->eventID >= VIR_DOMAIN_EVENT_ID_LAST ||
args->eventID < 0) {
remoteDispatchFormatError(rerr, _("unsupported event ID %d"), args->eventID);
remote_domain_events_deregister_any_args *args,
void *ret ATTRIBUTE_UNUSED)
{
- CHECK_CONN(client);
int callbackID = -1;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
if (args->eventID >= VIR_DOMAIN_EVENT_ID_LAST ||
args->eventID < 0) {
remoteDispatchFormatError(rerr, _("unsupported event ID %d"), args->eventID);
{
virNWFilterPtr nwfilter;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nwfilter = virNWFilterLookupByName(conn, args->name);
if (nwfilter == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNWFilterPtr nwfilter;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nwfilter = virNWFilterLookupByUUID(conn, (unsigned char *) args->uuid);
if (nwfilter == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNWFilterPtr nwfilter;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nwfilter = virNWFilterDefineXML(conn, args->xml);
if (nwfilter == NULL) {
remoteDispatchConnError(rerr, conn);
{
virNWFilterPtr nwfilter;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
if (nwfilter == NULL) {
remoteDispatchConnError(rerr, conn);
remote_list_nwfilters_args *args,
remote_list_nwfilters_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
if (args->maxnames > REMOTE_NWFILTER_NAME_LIST_MAX) {
remoteDispatchFormatError(rerr,
{
virNWFilterPtr nwfilter;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
nwfilter = get_nonnull_nwfilter(conn, args->nwfilter);
if (nwfilter == NULL) {
remoteDispatchConnError(rerr, conn);
void *args ATTRIBUTE_UNUSED,
remote_num_of_nwfilters_ret *ret)
{
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
ret->num = virConnectNumOfNWFilters(conn);
if (ret->num == -1) {
virDomainPtr dom;
virDomainBlockInfo info;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
dom = get_nonnull_domain(conn, args->dom);
if (dom == NULL) {
remoteDispatchConnError(rerr, conn);
{
virDomainPtr domain;
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
+
domain = get_nonnull_domain(conn, args->domain);
if (domain == NULL) {
remoteDispatchConnError(rerr, conn);
struct qemud_client_stream *stream;
virDomainPtr dom;
- CHECK_CONN (client);
+ if (!conn) {
+ remoteDispatchFormatError(rerr, "%s", _("connection not open"));
+ return -1;
+ }
dom = get_nonnull_domain(conn, args->domain);
if (dom == NULL) {