return rv;
}
-static int
-remoteDispatchGetMaxVcpus(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_get_max_vcpus_args *args,
- remote_get_max_vcpus_ret *ret)
-{
- char *type;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- type = args->type ? *args->type : NULL;
- if ((ret->max_vcpus = virConnectGetMaxVcpus(conn, type)) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- return rv;
-}
-
static int
remoteDispatchNodeGetInfo(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
return rv;
}
-static int
-remoteDispatchDomainMigratePerform(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_domain_migrate_perform_args *args,
- void *ret ATTRIBUTE_UNUSED)
-{
- virDomainPtr dom = NULL;
- char *dname;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- if (!(dom = get_nonnull_domain(conn, args->dom)))
- goto cleanup;
-
- dname = args->dname == NULL ? NULL : *args->dname;
-
- if (virDomainMigratePerform(dom,
- args->cookie.cookie_val,
- args->cookie.cookie_len,
- args->uri,
- args->flags, dname, args->resource) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- if (dom)
- virDomainFree(dom);
- return rv;
-}
-
static int
remoteDispatchDomainMigratePrepare2(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
return rv;
}
-static int
-remoteDispatchFindStoragePoolSources(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_find_storage_pool_sources_args *args,
- remote_find_storage_pool_sources_ret *ret)
-{
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- if (!(ret->xml =
- virConnectFindStoragePoolSources(conn,
- args->type,
- args->srcSpec ? *args->srcSpec : NULL,
- args->flags)))
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- return rv;
-}
-
static int
remoteDispatchStoragePoolGetInfo(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
* NODE INFO APIS
**************************************************************/
-static int
-remoteDispatchNodeNumOfDevices(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_node_num_of_devices_args *args,
- remote_node_num_of_devices_ret *ret)
-{
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- if ((ret->num = virNodeNumOfDevices(conn,
- args->cap ? *args->cap : NULL,
- args->flags)) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- return rv;
-}
-
-
static int
remoteDispatchNodeListDevices(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
return rv;
}
-/* remoteDispatchDomainMigratePerform has to be implemented manually */
+static int
+remoteDispatchDomainMigratePerform(
+ struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_domain_migrate_perform_args *args,
+ void *ret ATTRIBUTE_UNUSED)
+{
+ int rv = -1;
+ virDomainPtr dom = NULL;
+ char *dname;
+
+ if (!conn) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ if (!(dom = get_nonnull_domain(conn, args->dom)))
+ goto cleanup;
+
+ dname = args->dname ? *args->dname : NULL;
+
+ if (virDomainMigratePerform(dom, args->cookie.cookie_val, args->cookie.cookie_len, args->uri, args->flags, dname, args->resource) < 0)
+ goto cleanup;
+
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ remoteDispatchError(rerr);
+ if (dom)
+ virDomainFree(dom);
+ return rv;
+}
/* remoteDispatchDomainMigratePrepare has to be implemented manually */
return rv;
}
-/* remoteDispatchFindStoragePoolSources has to be implemented manually */
+static int
+remoteDispatchFindStoragePoolSources(
+ struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_find_storage_pool_sources_args *args,
+ remote_find_storage_pool_sources_ret *ret)
+{
+ int rv = -1;
+ char *srcSpec;
+ char *xml;
+
+ if (!conn) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ srcSpec = args->srcSpec ? *args->srcSpec : NULL;
+
+ if ((xml = virConnectFindStoragePoolSources(conn, args->type, srcSpec, args->flags)) == NULL)
+ goto cleanup;
+
+ ret->xml = xml;
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ remoteDispatchError(rerr);
+ return rv;
+}
static int
remoteDispatchGetCapabilities(
return rv;
}
-/* remoteDispatchGetMaxVcpus has to be implemented manually */
+static int
+remoteDispatchGetMaxVcpus(
+ struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_get_max_vcpus_args *args,
+ remote_get_max_vcpus_ret *ret)
+{
+ int rv = -1;
+ char *type;
+ int max_vcpus;
+
+ if (!conn) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ type = args->type ? *args->type : NULL;
+
+ if ((max_vcpus = virConnectGetMaxVcpus(conn, type)) < 0)
+ goto cleanup;
+
+ ret->max_vcpus = max_vcpus;
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ remoteDispatchError(rerr);
+ return rv;
+}
static int
remoteDispatchGetSysinfo(
/* remoteDispatchNodeListDevices has to be implemented manually */
-/* remoteDispatchNodeNumOfDevices has to be implemented manually */
+static int
+remoteDispatchNodeNumOfDevices(
+ struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client ATTRIBUTE_UNUSED,
+ virConnectPtr conn,
+ remote_message_header *hdr ATTRIBUTE_UNUSED,
+ remote_error *rerr,
+ remote_node_num_of_devices_args *args,
+ remote_node_num_of_devices_ret *ret)
+{
+ int rv = -1;
+ char *cap;
+ int num;
+
+ if (!conn) {
+ virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
+ goto cleanup;
+ }
+
+ cap = args->cap ? *args->cap : NULL;
+
+ if ((num = virNodeNumOfDevices(conn, cap, args->flags)) < 0)
+ goto cleanup;
+
+ ret->num = num;
+ rv = 0;
+
+cleanup:
+ if (rv < 0)
+ remoteDispatchError(rerr);
+ return rv;
+}
static int
remoteDispatchNumOfDefinedDomains(
@ungeneratable = ("Close",
"DomainEventsDeregisterAny",
"DomainEventsRegisterAny",
- "DomainMigratePerform",
"DomainMigratePrepareTunnel",
"DomainOpenConsole",
"DomainPinVcpu",
"DomainMigratePrepare",
"DomainMigratePrepare2",
"DomainSnapshotListNames",
- "FindStoragePoolSources",
- "GetMaxVcpus",
"GetType",
"ListDefinedDomains",
"ListDefinedInterfaces",
"NodeGetInfo",
"NodeGetSecurityModel",
"NodeListDevices",
- "NodeNumOfDevices",
"SecretGetValue",
"StoragePoolGetInfo",
"StoragePoolListVolumes",
my $has_node_device = 0;
my @vars_list = ();
+ my @optionals_list = ();
my @getters_list = ();
my @args_list = ();
my @ret_list = ();
if ($1 eq "remote_uuid") {
push(@args_list, "(unsigned char *) args->$2");
+ } elsif ($1 eq "remote_string") {
+ push(@vars_list, "char *$2");
+ push(@optionals_list, "$2");
+ push(@args_list, "$2");
} else {
push(@args_list, "args->$2");
}
print "\n";
}
+ foreach my $optional (@optionals_list) {
+ print " $optional = args->$optional ? *args->$optional : NULL;\n";
+ }
+
+ if (@optionals_list) {
+ print "\n";
+ }
+
if ($calls{$_}->{ret} eq "void") {
print " if (vir$calls{$_}->{ProcName}(";
print join(', ', @args_list);
}
if ($calls{$_}->{ProcName} eq "GetSysinfo" or
+ $calls{$_}->{ProcName} eq "GetMaxVcpus" or
$calls{$_}->{ProcName} eq "DomainXMLFromNative" or
- $calls{$_}->{ProcName} eq "DomainXMLToNative") {
+ $calls{$_}->{ProcName} eq "DomainXMLToNative" or
+ $calls{$_}->{ProcName} eq "FindStoragePoolSources") {
$prefix = "Connect"
} elsif ($calls{$_}->{ProcName} eq "SupportsFeature") {
$prefix = "Drv"