--- daemon/remote_generator.pl | 122 +++-- src/remote/remote_client_bodies.c | 1097 +++++++++++++++++++++++++++++++++++-- src/remote/remote_driver.c | 1081 +------------------------------------ 3 files changed, 1120 insertions(+), 1180 deletions(-) diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl index 73d1596..a973b21 100755 --- a/daemon/remote_generator.pl +++ b/daemon/remote_generator.pl @@ -751,63 +751,42 @@ elsif ($opt_k) { "AuthPolkit", "CPUBaseline", - "CPUCompare", "DomainBlockStats", "DomainCreate", "DomainCreateXML", "DomainDefineXML", "DomainDestroy", - "DomainDumpXML", "DomainGetAutostart", "DomainGetBlockInfo", "DomainGetInfo", "StoragePoolLookupByUUID", - "StoragePoolNumOfVolumes", "NodeDeviceCreateXML", "DomainGetJobInfo", - "DomainGetMaxMemory", - "DomainGetOSType", - "DomainGetVcpusFlags", - "HasCurrentSnapshot", "DomainInterfaceStats", - "DomainIsActive", - "DomainIsPersistent", - "DomainIsUpdated", "DomainLookupByID", "DomainLookupByName", "DomainLookupByUIID", "DomainMigrateFinish", - "DomainGetMaxVcpus", - "DomainHasCurrentSnapshot", "NWFilterDefineXML", - "NumOfStoragePools", "NWFilterLookupByName", "NWFilterLookupByUUID", "SecretLookupByUUID", "SecretLookupByUsage", "StoragePoolCreateXML", - "StoragePoolIsActive", - "DomainHasManagedSaveImage", "DomainLookupByUUID", "DomainMigratePerform", "DomainMigrateFinish2", "DomainSnapshotCreateXML", - "DomainSnapshotDumpXML", - "DomainSnapshotNum", "DomainSnapshotCurrent", "DomainSnapshotListNames", - "GetCapabilities", - "GetHostname", "GetLibVersion", "GetMaxVcpus", "DomainSnapshotLookupByName", "DomainXMLFromNative", "FindStoragePoolSources", - "GetSysinfo", "GetVersion", "GetLibVersion", "InterfaceDefineXML", - "InterfaceGetXMLDesc", "InterfaceLookupByName", "IsSecure", "ListDefinedDomains", @@ -820,40 +799,22 @@ elsif ($opt_k) { "StorageVolCreateXML", "StorageVolLookupByName", "StorageVolLookupByKey", - "StoragePoolIsPersistent", "StoragePoolGetInfo", - "StorageVolGetPath", "StorageVolCreateXMLFrom", "StoragePoolLookupByName", - "SecretGetXMLDesc", - "NWFilterGetXMLDesc", - "NumOfNWFilters", - "NumOfInterfaces", - "NumOfDomains", - "NumOfDefinedStoragePools", "NodeListDevices", "NodeGetCellsFreeMemory", - "NodeDeviceDumpXML", - "NetworkIsActive", "ListDefinedNetworks", "DomainXMLToNative", - "StorageVolDumpXML", "StoragePoolListVolumes", - "StoragePoolDumpXML", "SecretDefineXML", - "NumOfDefinedNetworks", - "InterfaceIsActive", "ListDomains", "ListStoragePools", - "NetworkDumpXML", "NetworkGetAutostart", - "NetworkGetBridgeName", "StoragePoolLookupByVolume", "StoragePoolGetAutostart", "SecretSetValue", - "NumOfDefinedInterfaces", "StoragePoolDefineXML", - "NodeNumOfDevices", "NodeGetInfo", "GetURI", "InterfaceLookupByMACString", @@ -861,18 +822,13 @@ elsif ($opt_k) { "NetworkDefineXML", "NetworkLookupByName", "ListDefinedStoragePools", - "NetworkIsPersistent", "NodeDeviceDettach", "NodeDeviceLookupByName", "NodeGetFreeMemory", - "NumOfDefinedDomains", "ListNetworks", "NodeDeviceListCaps", "NodeDeviceReset", - "NumOfNetworks", "NetworkLookupByUUID", - "NodeDeviceNumOfCaps", - "NumOfSecrets", "NodeDeviceReAttach", "ListSecrets", @@ -916,13 +872,16 @@ elsif ($opt_k) { my @args_list = (); my @vars_list = (); my @setters_list = (); + my @ret_list = (); my $priv_src = "conn"; my $priv_name = "privateData"; - my $args = "&args"; - my $ret = "&ret"; + my $call_args = "&args"; + my $call_ret = "&ret"; + my $single_ret_var = "int rv = -1"; + my $single_ret_type = "int"; if ($call->{args} eq "void") { - $args = "NULL"; + $call_args = "NULL"; } else { push(@vars_list, "$call->{args} args"); @@ -930,14 +889,14 @@ elsif ($opt_k) { my $has_node_device = 0; # node device is special - if ($call->{args} =~ m/^remote_node_device_/) { + if ($call->{args} =~ m/^remote_node_/) { $has_node_device = 1; + $priv_name = "devMonPrivateData"; } foreach my $args_member (@{$call->{args_members}}) { if ($args_member =~ m/^remote_nonnull_string name;/ and $has_node_device) { $priv_src = "dev->conn"; - $priv_name = "devMonPrivateData"; push(@args_list, "virNodeDevicePtr dev"); push(@setters_list, "args.name = dev->name;"); } elsif ($args_member =~ m/^remote_nonnull_(domain|network|storage_pool|storage_vol|interface|secret|nwfilter|domain_snapshot) (\S+);/) { @@ -960,6 +919,9 @@ elsif ($opt_k) { push(@args_list, "vir${type_name}Ptr $2"); push(@setters_list, "make_nonnull_$1(&args.$2, $2);"); + } elsif ($args_member =~ m/^remote_string (\S+);/) { + push(@args_list, "const char *$1"); + push(@setters_list, "args.$1 = $1 ? (char **)&$1 : NULL;"); } elsif ($args_member =~ m/^remote_nonnull_string (\S+);/) { push(@args_list, "const char *$1"); push(@setters_list, "args.$1 = (char *)$1;"); @@ -976,7 +938,9 @@ elsif ($opt_k) { if ($type_name eq "int") { # fix bad decisions in the xdr protocol if ($arg_name eq "flags" and - $call->{ProcName} ne "DomainCoreDump") { + $call->{ProcName} ne "DomainCoreDump" and + $call->{ProcName} ne "DomainDumpXML" and + $call->{ProcName} ne "NetworkDumpXML") { $type_name = "unsigned int"; } elsif ($arg_name eq "nvcpus" and $call->{ProcName} eq "DomainSetVcpus") { @@ -1005,21 +969,52 @@ elsif ($opt_k) { } } + # fix priv_name for the NumOf* functions + if ($priv_name eq "privateData" and + !($call->{ProcName} =~ m/Domains/) and + $call->{ProcName} =~ m/NumOf(Defined|Domain)*(\S+)s/) { + my $prefix = lc $2; + $prefix =~ s/(pool|vol)$//; + $priv_name = "${prefix}PrivateData"; + } + if ($call->{ret} eq "void") { - $ret = "NULL"; + $call_ret = "NULL"; } else { push(@vars_list, "$call->{ret} ret"); + + foreach my $ret_member (@{$call->{ret_members}}) { + if ($ret_member =~ m/remote_nonnull_string (\S+);/) { + push(@ret_list, "rv = ret.$1;"); + $single_ret_var = "char *rv = NULL"; + $single_ret_type = "char *"; + } elsif ($ret_member =~ m/^int (\S+);/) { + push(@ret_list, "rv = ret.$1;"); + $single_ret_var = "int rv = -1"; + $single_ret_type = "int"; + } elsif ($ret_member =~ m/hyper (\S+);/) { + push(@ret_list, "rv = ret.$1;"); + $single_ret_var = "unsigned long rv = 0"; + $single_ret_type = "unsigned long"; + } else { + die "unhandled type for return value: $ret_member"; + } + } + } + + if (! @args_list) { + push(@args_list, "virConnectPtr conn"); } # print function - print "static int\n"; + print "static $single_ret_type\n"; print "remote$call->{ProcName}("; print join(", ", @args_list); print ")\n"; print "{\n"; - print " int rv = -1;\n"; + print " $single_ret_var;\n"; print " struct private_data *priv = $priv_src->$priv_name;\n"; foreach my $var (@vars_list) { @@ -1028,9 +1023,9 @@ elsif ($opt_k) { print "\n"; print " remoteDriverLock(priv);\n"; - print "\n"; if (@setters_list) { + print "\n"; print " "; } @@ -1040,13 +1035,26 @@ elsif ($opt_k) { print "\n"; } + if ($call->{ret} ne "void") { + print "\n"; + print " memset(&ret, 0, sizeof ret);\n"; + } + print "\n"; print " if (call($priv_src, priv, 0, ${procprefix}_PROC_$call->{UC_NAME},\n"; - print " (xdrproc_t)xdr_$call->{args}, (char *)$args,\n"; - print " (xdrproc_t)xdr_$call->{ret}, (char *)$ret) == -1)\n"; + print " (xdrproc_t)xdr_$call->{args}, (char *)$call_args,\n"; + print " (xdrproc_t)xdr_$call->{ret}, (char *)$call_ret) == -1)\n"; print " goto done;\n"; print "\n"; - print " rv = 0;\n"; + + if (@ret_list) { + print " "; + print join("\n ", @ret_list); + print "\n"; + } else { + print " rv = 0;\n"; + } + print "\n"; print "done:\n"; print " remoteDriverUnlock(priv);\n"; diff --git a/src/remote/remote_client_bodies.c b/src/remote/remote_client_bodies.c index 07ddfbf..b878832 100644 --- a/src/remote/remote_client_bodies.c +++ b/src/remote/remote_client_bodies.c @@ -16,7 +16,32 @@ /* remoteDispatchCPUBaseline has to be implemented manually */ -/* remoteDispatchCPUCompare has to be implemented manually */ +static int +remoteCPUCompare(virConnectPtr conn, const char *xml, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = conn->privateData; + remote_cpu_compare_args args; + remote_cpu_compare_ret ret; + + remoteDriverLock(priv); + + args.xml = (char *)xml; + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_CPU_COMPARE, + (xdrproc_t)xdr_remote_cpu_compare_args, (char *)&args, + (xdrproc_t)xdr_remote_cpu_compare_ret, (char *)&ret) == -1) + goto done; + + rv = ret.result; + +done: + remoteDriverUnlock(priv); + return rv; +} static int remoteDomainAbortJob(virDomainPtr dom) @@ -178,7 +203,32 @@ done: return rv; } -/* remoteDispatchDomainDumpXML has to be implemented manually */ +static char * +remoteDomainDumpXML(virDomainPtr dom, int flags) +{ + char *rv = NULL; + struct private_data *priv = dom->conn->privateData; + remote_domain_dump_xml_args args; + remote_domain_dump_xml_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_DUMP_XML, + (xdrproc_t)xdr_remote_domain_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainEventsDeregister has to be implemented manually */ @@ -198,13 +248,85 @@ done: /* remoteDispatchDomainGetJobInfo has to be implemented manually */ -/* remoteDispatchDomainGetMaxMemory has to be implemented manually */ +static unsigned long +remoteDomainGetMaxMemory(virDomainPtr dom) +{ + unsigned long rv = 0; + struct private_data *priv = dom->conn->privateData; + remote_domain_get_max_memory_args args; + remote_domain_get_max_memory_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MAX_MEMORY, + (xdrproc_t)xdr_remote_domain_get_max_memory_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_get_max_memory_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchDomainGetMaxVcpus has to be implemented manually */ + rv = ret.memory; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteDomainGetMaxVcpus(virDomainPtr dom) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_get_max_vcpus_args args; + remote_domain_get_max_vcpus_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MAX_VCPUS, + (xdrproc_t)xdr_remote_domain_get_max_vcpus_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_get_max_vcpus_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainGetMemoryParameters has to be implemented manually */ -/* remoteDispatchDomainGetOSType has to be implemented manually */ +static char * +remoteDomainGetOSType(virDomainPtr dom) +{ + char *rv = NULL; + struct private_data *priv = dom->conn->privateData; + remote_domain_get_os_type_args args; + remote_domain_get_os_type_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_OS_TYPE, + (xdrproc_t)xdr_remote_domain_get_os_type_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_get_os_type_ret, (char *)&ret) == -1) + goto done; + + rv = ret.type; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainGetSchedulerParameters has to be implemented manually */ @@ -214,19 +336,166 @@ done: /* remoteDispatchDomainGetVcpus has to be implemented manually */ -/* remoteDispatchDomainGetVcpusFlags has to be implemented manually */ +static int +remoteDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_get_vcpus_flags_args args; + remote_domain_get_vcpus_flags_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS, + (xdrproc_t)xdr_remote_domain_get_vcpus_flags_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_get_vcpus_flags_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteDomainHasCurrentSnapshot(virDomainPtr dom, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_has_current_snapshot_args args; + remote_domain_has_current_snapshot_ret ret; -/* remoteDispatchDomainHasCurrentSnapshot has to be implemented manually */ + remoteDriverLock(priv); -/* remoteDispatchDomainHasManagedSaveImage has to be implemented manually */ + make_nonnull_domain(&args.dom, dom); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_HAS_CURRENT_SNAPSHOT, + (xdrproc_t)xdr_remote_domain_has_current_snapshot_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_has_current_snapshot_ret, (char *)&ret) == -1) + goto done; + + rv = ret.result; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_has_managed_save_image_args args; + remote_domain_has_managed_save_image_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_HAS_MANAGED_SAVE_IMAGE, + (xdrproc_t)xdr_remote_domain_has_managed_save_image_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_has_managed_save_image_ret, (char *)&ret) == -1) + goto done; + + rv = ret.result; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainInterfaceStats has to be implemented manually */ -/* remoteDispatchDomainIsActive has to be implemented manually */ +static int +remoteDomainIsActive(virDomainPtr dom) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_is_active_args args; + remote_domain_is_active_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_ACTIVE, + (xdrproc_t)xdr_remote_domain_is_active_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_is_active_ret, (char *)&ret) == -1) + goto done; + + rv = ret.active; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteDomainIsPersistent(virDomainPtr dom) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_is_persistent_args args; + remote_domain_is_persistent_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_PERSISTENT, + (xdrproc_t)xdr_remote_domain_is_persistent_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_is_persistent_ret, (char *)&ret) == -1) + goto done; + + rv = ret.persistent; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteDomainIsUpdated(virDomainPtr dom) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_is_updated_args args; + remote_domain_is_updated_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_UPDATED, + (xdrproc_t)xdr_remote_domain_is_updated_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_is_updated_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchDomainIsPersistent has to be implemented manually */ + rv = ret.updated; -/* remoteDispatchDomainIsUpdated has to be implemented manually */ +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainLookupByID has to be implemented manually */ @@ -673,13 +942,63 @@ done: return rv; } -/* remoteDispatchDomainSnapshotDumpXML has to be implemented manually */ +static char * +remoteDomainSnapshotDumpXML(virDomainSnapshotPtr snap, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = snap->domain->conn->privateData; + remote_domain_snapshot_dump_xml_args args; + remote_domain_snapshot_dump_xml_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain_snapshot(&args.snap, snap); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(snap->domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SNAPSHOT_DUMP_XML, + (xdrproc_t)xdr_remote_domain_snapshot_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_snapshot_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchDomainSnapshotListNames has to be implemented manually */ /* remoteDispatchDomainSnapshotLookupByName has to be implemented manually */ -/* remoteDispatchDomainSnapshotNum has to be implemented manually */ +static int +remoteDomainSnapshotNum(virDomainPtr dom, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = dom->conn->privateData; + remote_domain_snapshot_num_args args; + remote_domain_snapshot_num_ret ret; + + remoteDriverLock(priv); + + make_nonnull_domain(&args.dom, dom); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dom->conn, priv, 0, REMOTE_PROC_DOMAIN_SNAPSHOT_NUM, + (xdrproc_t)xdr_remote_domain_snapshot_num_args, (char *)&args, + (xdrproc_t)xdr_remote_domain_snapshot_num_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} static int remoteDomainSuspend(virDomainPtr dom) @@ -758,15 +1077,81 @@ done: /* remoteDispatchFindStoragePoolSources has to be implemented manually */ -/* remoteDispatchGetCapabilities has to be implemented manually */ +static char * +remoteGetCapabilities(virConnectPtr conn) +{ + char *rv = NULL; + struct private_data *priv = conn->privateData; + remote_get_capabilities_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_GET_CAPABILITIES, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_get_capabilities_ret, (char *)&ret) == -1) + goto done; + + rv = ret.capabilities; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static char * +remoteGetHostname(virConnectPtr conn) +{ + char *rv = NULL; + struct private_data *priv = conn->privateData; + remote_get_hostname_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); -/* remoteDispatchGetHostname has to be implemented manually */ + if (call(conn, priv, 0, REMOTE_PROC_GET_HOSTNAME, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_get_hostname_ret, (char *)&ret) == -1) + goto done; + + rv = ret.hostname; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchGetLibVersion has to be implemented manually */ /* remoteDispatchGetMaxVcpus has to be implemented manually */ -/* remoteDispatchGetSysinfo has to be implemented manually */ +static char * +remoteGetSysinfo(virConnectPtr conn, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = conn->privateData; + remote_get_sysinfo_args args; + remote_get_sysinfo_ret ret; + + remoteDriverLock(priv); + + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_GET_SYSINFO, + (xdrproc_t)xdr_remote_get_sysinfo_args, (char *)&args, + (xdrproc_t)xdr_remote_get_sysinfo_ret, (char *)&ret) == -1) + goto done; + + rv = ret.sysinfo; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchGetType has to be implemented manually */ @@ -824,9 +1209,58 @@ done: return rv; } -/* remoteDispatchInterfaceGetXMLDesc has to be implemented manually */ +static char * +remoteInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = iface->conn->interfacePrivateData; + remote_interface_get_xml_desc_args args; + remote_interface_get_xml_desc_ret ret; + + remoteDriverLock(priv); + + make_nonnull_interface(&args.iface, iface); + args.flags = flags; + + memset(&ret, 0, sizeof ret); -/* remoteDispatchInterfaceIsActive has to be implemented manually */ + if (call(iface->conn, priv, 0, REMOTE_PROC_INTERFACE_GET_XML_DESC, + (xdrproc_t)xdr_remote_interface_get_xml_desc_args, (char *)&args, + (xdrproc_t)xdr_remote_interface_get_xml_desc_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteInterfaceIsActive(virInterfacePtr iface) +{ + int rv = -1; + struct private_data *priv = iface->conn->interfacePrivateData; + remote_interface_is_active_args args; + remote_interface_is_active_ret ret; + + remoteDriverLock(priv); + + make_nonnull_interface(&args.iface, iface); + + memset(&ret, 0, sizeof ret); + + if (call(iface->conn, priv, 0, REMOTE_PROC_INTERFACE_IS_ACTIVE, + (xdrproc_t)xdr_remote_interface_is_active_args, (char *)&args, + (xdrproc_t)xdr_remote_interface_is_active_ret, (char *)&ret) == -1) + goto done; + + rv = ret.active; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchInterfaceLookupByMACString has to be implemented manually */ @@ -927,15 +1361,112 @@ done: return rv; } -/* remoteDispatchNetworkDumpXML has to be implemented manually */ +static char * +remoteNetworkDumpXML(virNetworkPtr net, int flags) +{ + char *rv = NULL; + struct private_data *priv = net->conn->networkPrivateData; + remote_network_dump_xml_args args; + remote_network_dump_xml_ret ret; + + remoteDriverLock(priv); + + make_nonnull_network(&args.net, net); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(net->conn, priv, 0, REMOTE_PROC_NETWORK_DUMP_XML, + (xdrproc_t)xdr_remote_network_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_network_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNetworkGetAutostart has to be implemented manually */ -/* remoteDispatchNetworkGetBridgeName has to be implemented manually */ +static char * +remoteNetworkGetBridgeName(virNetworkPtr net) +{ + char *rv = NULL; + struct private_data *priv = net->conn->networkPrivateData; + remote_network_get_bridge_name_args args; + remote_network_get_bridge_name_ret ret; + + remoteDriverLock(priv); + + make_nonnull_network(&args.net, net); + + memset(&ret, 0, sizeof ret); + + if (call(net->conn, priv, 0, REMOTE_PROC_NETWORK_GET_BRIDGE_NAME, + (xdrproc_t)xdr_remote_network_get_bridge_name_args, (char *)&args, + (xdrproc_t)xdr_remote_network_get_bridge_name_ret, (char *)&ret) == -1) + goto done; + + rv = ret.name; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNetworkIsActive(virNetworkPtr net) +{ + int rv = -1; + struct private_data *priv = net->conn->networkPrivateData; + remote_network_is_active_args args; + remote_network_is_active_ret ret; + + remoteDriverLock(priv); + + make_nonnull_network(&args.net, net); + + memset(&ret, 0, sizeof ret); + + if (call(net->conn, priv, 0, REMOTE_PROC_NETWORK_IS_ACTIVE, + (xdrproc_t)xdr_remote_network_is_active_args, (char *)&args, + (xdrproc_t)xdr_remote_network_is_active_ret, (char *)&ret) == -1) + goto done; + + rv = ret.active; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNetworkIsPersistent(virNetworkPtr net) +{ + int rv = -1; + struct private_data *priv = net->conn->networkPrivateData; + remote_network_is_persistent_args args; + remote_network_is_persistent_ret ret; + + remoteDriverLock(priv); + + make_nonnull_network(&args.net, net); + + memset(&ret, 0, sizeof ret); -/* remoteDispatchNetworkIsActive has to be implemented manually */ + if (call(net->conn, priv, 0, REMOTE_PROC_NETWORK_IS_PERSISTENT, + (xdrproc_t)xdr_remote_network_is_persistent_args, (char *)&args, + (xdrproc_t)xdr_remote_network_is_persistent_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchNetworkIsPersistent has to be implemented manually */ + rv = ret.persistent; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNetworkLookupByName has to be implemented manually */ @@ -1015,7 +1546,32 @@ done: /* remoteDispatchNodeDeviceDettach has to be implemented manually */ -/* remoteDispatchNodeDeviceDumpXML has to be implemented manually */ +static char * +remoteNodeDeviceDumpXML(virNodeDevicePtr dev, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = dev->conn->devMonPrivateData; + remote_node_device_dump_xml_args args; + remote_node_device_dump_xml_ret ret; + + remoteDriverLock(priv); + + args.name = dev->name; + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DUMP_XML, + (xdrproc_t)xdr_remote_node_device_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_node_device_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNodeDeviceGetParent has to be implemented manually */ @@ -1023,7 +1579,31 @@ done: /* remoteDispatchNodeDeviceLookupByName has to be implemented manually */ -/* remoteDispatchNodeDeviceNumOfCaps has to be implemented manually */ +static int +remoteNodeDeviceNumOfCaps(virNodeDevicePtr dev) +{ + int rv = -1; + struct private_data *priv = dev->conn->devMonPrivateData; + remote_node_device_num_of_caps_args args; + remote_node_device_num_of_caps_ret ret; + + remoteDriverLock(priv); + + args.name = dev->name; + + memset(&ret, 0, sizeof ret); + + if (call(dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS, + (xdrproc_t)xdr_remote_node_device_num_of_caps_args, (char *)&args, + (xdrproc_t)xdr_remote_node_device_num_of_caps_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNodeDeviceReAttach has to be implemented manually */ @@ -1039,31 +1619,291 @@ done: /* remoteDispatchNodeListDevices has to be implemented manually */ -/* remoteDispatchNodeNumOfDevices has to be implemented manually */ +static int +remoteNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags) +{ + int rv = -1; + struct private_data *priv = conn->devMonPrivateData; + remote_node_num_of_devices_args args; + remote_node_num_of_devices_ret ret; + + remoteDriverLock(priv); + + args.cap = cap ? (char **)&cap : NULL; + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NODE_NUM_OF_DEVICES, + (xdrproc_t)xdr_remote_node_num_of_devices_args, (char *)&args, + (xdrproc_t)xdr_remote_node_num_of_devices_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfDefinedDomains(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->privateData; + remote_num_of_defined_domains_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_DOMAINS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_defined_domains_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfDefinedInterfaces(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->interfacePrivateData; + remote_num_of_defined_interfaces_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_INTERFACES, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_defined_interfaces_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfDefinedNetworks(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->networkPrivateData; + remote_num_of_defined_networks_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_NETWORKS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_defined_networks_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfDefinedStoragePools(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->storagePrivateData; + remote_num_of_defined_storage_pools_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_defined_storage_pools_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfDomains(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->privateData; + remote_num_of_domains_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_DOMAINS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_domains_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfInterfaces(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->interfacePrivateData; + remote_num_of_interfaces_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_INTERFACES, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_interfaces_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfNetworks(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->networkPrivateData; + remote_num_of_networks_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_NETWORKS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_networks_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; -/* remoteDispatchNumOfDefinedDomains has to be implemented manually */ +done: + remoteDriverUnlock(priv); + return rv; +} -/* remoteDispatchNumOfDefinedInterfaces has to be implemented manually */ +static int +remoteNumOfNWFilters(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->nwfilterPrivateData; + remote_num_of_nwfilters_ret ret; + + remoteDriverLock(priv); -/* remoteDispatchNumOfDefinedNetworks has to be implemented manually */ + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_NWFILTERS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_nwfilters_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchNumOfDefinedStoragePools has to be implemented manually */ + rv = ret.num; -/* remoteDispatchNumOfDomains has to be implemented manually */ +done: + remoteDriverUnlock(priv); + return rv; +} -/* remoteDispatchNumOfInterfaces has to be implemented manually */ +static int +remoteNumOfSecrets(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->secretPrivateData; + remote_num_of_secrets_ret ret; -/* remoteDispatchNumOfNetworks has to be implemented manually */ + remoteDriverLock(priv); -/* remoteDispatchNumOfNWFilters has to be implemented manually */ + memset(&ret, 0, sizeof ret); -/* remoteDispatchNumOfSecrets has to be implemented manually */ + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_SECRETS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_secrets_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchNumOfStoragePools has to be implemented manually */ + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteNumOfStoragePools(virConnectPtr conn) +{ + int rv = -1; + struct private_data *priv = conn->storagePrivateData; + remote_num_of_storage_pools_ret ret; + + remoteDriverLock(priv); + + memset(&ret, 0, sizeof ret); + + if (call(conn, priv, 0, REMOTE_PROC_NUM_OF_STORAGE_POOLS, + (xdrproc_t)xdr_void, (char *)NULL, + (xdrproc_t)xdr_remote_num_of_storage_pools_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNWFilterDefineXML has to be implemented manually */ -/* remoteDispatchNWFilterGetXMLDesc has to be implemented manually */ +static char * +remoteNWFilterGetXMLDesc(virNWFilterPtr nwfilter, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = nwfilter->conn->nwfilterPrivateData; + remote_nwfilter_get_xml_desc_args args; + remote_nwfilter_get_xml_desc_ret ret; + + remoteDriverLock(priv); + + make_nonnull_nwfilter(&args.nwfilter, nwfilter); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(nwfilter->conn, priv, 0, REMOTE_PROC_NWFILTER_GET_XML_DESC, + (xdrproc_t)xdr_remote_nwfilter_get_xml_desc_args, (char *)&args, + (xdrproc_t)xdr_remote_nwfilter_get_xml_desc_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchNWFilterLookupByName has to be implemented manually */ @@ -1098,7 +1938,32 @@ done: /* remoteDispatchSecretGetValue has to be implemented manually */ -/* remoteDispatchSecretGetXMLDesc has to be implemented manually */ +static char * +remoteSecretGetXMLDesc(virSecretPtr secret, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = secret->conn->secretPrivateData; + remote_secret_get_xml_desc_args args; + remote_secret_get_xml_desc_ret ret; + + remoteDriverLock(priv); + + make_nonnull_secret(&args.secret, secret); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(secret->conn, priv, 0, REMOTE_PROC_SECRET_GET_XML_DESC, + (xdrproc_t)xdr_remote_secret_get_xml_desc_args, (char *)&args, + (xdrproc_t)xdr_remote_secret_get_xml_desc_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchSecretLookupByUsage has to be implemented manually */ @@ -1228,15 +2093,88 @@ done: return rv; } -/* remoteDispatchStoragePoolDumpXML has to be implemented manually */ +static char * +remoteStoragePoolDumpXML(virStoragePoolPtr pool, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = pool->conn->storagePrivateData; + remote_storage_pool_dump_xml_args args; + remote_storage_pool_dump_xml_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_pool(&args.pool, pool); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_DUMP_XML, + (xdrproc_t)xdr_remote_storage_pool_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_pool_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchStoragePoolGetAutostart has to be implemented manually */ /* remoteDispatchStoragePoolGetInfo has to be implemented manually */ -/* remoteDispatchStoragePoolIsActive has to be implemented manually */ +static int +remoteStoragePoolIsActive(virStoragePoolPtr pool) +{ + int rv = -1; + struct private_data *priv = pool->conn->storagePrivateData; + remote_storage_pool_is_active_args args; + remote_storage_pool_is_active_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_pool(&args.pool, pool); + + memset(&ret, 0, sizeof ret); + + if (call(pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_IS_ACTIVE, + (xdrproc_t)xdr_remote_storage_pool_is_active_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_pool_is_active_ret, (char *)&ret) == -1) + goto done; -/* remoteDispatchStoragePoolIsPersistent has to be implemented manually */ + rv = ret.active; + +done: + remoteDriverUnlock(priv); + return rv; +} + +static int +remoteStoragePoolIsPersistent(virStoragePoolPtr pool) +{ + int rv = -1; + struct private_data *priv = pool->conn->storagePrivateData; + remote_storage_pool_is_persistent_args args; + remote_storage_pool_is_persistent_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_pool(&args.pool, pool); + + memset(&ret, 0, sizeof ret); + + if (call(pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT, + (xdrproc_t)xdr_remote_storage_pool_is_persistent_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_pool_is_persistent_ret, (char *)&ret) == -1) + goto done; + + rv = ret.persistent; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchStoragePoolListVolumes has to be implemented manually */ @@ -1246,7 +2184,31 @@ done: /* remoteDispatchStoragePoolLookupByVolume has to be implemented manually */ -/* remoteDispatchStoragePoolNumOfVolumes has to be implemented manually */ +static int +remoteStoragePoolNumOfVolumes(virStoragePoolPtr pool) +{ + int rv = -1; + struct private_data *priv = pool->conn->storagePrivateData; + remote_storage_pool_num_of_volumes_args args; + remote_storage_pool_num_of_volumes_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_pool(&args.pool, pool); + + memset(&ret, 0, sizeof ret); + + if (call(pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES, + (xdrproc_t)xdr_remote_storage_pool_num_of_volumes_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_pool_num_of_volumes_ret, (char *)&ret) == -1) + goto done; + + rv = ret.num; + +done: + remoteDriverUnlock(priv); + return rv; +} static int remoteStoragePoolRefresh(virStoragePoolPtr pool, unsigned int flags) @@ -1349,11 +2311,60 @@ done: /* remoteDispatchStorageVolDownload has to be implemented manually */ -/* remoteDispatchStorageVolDumpXML has to be implemented manually */ +static char * +remoteStorageVolDumpXML(virStorageVolPtr vol, unsigned int flags) +{ + char *rv = NULL; + struct private_data *priv = vol->conn->storagePrivateData; + remote_storage_vol_dump_xml_args args; + remote_storage_vol_dump_xml_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_vol(&args.vol, vol); + args.flags = flags; + + memset(&ret, 0, sizeof ret); + + if (call(vol->conn, priv, 0, REMOTE_PROC_STORAGE_VOL_DUMP_XML, + (xdrproc_t)xdr_remote_storage_vol_dump_xml_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_vol_dump_xml_ret, (char *)&ret) == -1) + goto done; + + rv = ret.xml; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchStorageVolGetInfo has to be implemented manually */ -/* remoteDispatchStorageVolGetPath has to be implemented manually */ +static char * +remoteStorageVolGetPath(virStorageVolPtr vol) +{ + char *rv = NULL; + struct private_data *priv = vol->conn->storagePrivateData; + remote_storage_vol_get_path_args args; + remote_storage_vol_get_path_ret ret; + + remoteDriverLock(priv); + + make_nonnull_storage_vol(&args.vol, vol); + + memset(&ret, 0, sizeof ret); + + if (call(vol->conn, priv, 0, REMOTE_PROC_STORAGE_VOL_GET_PATH, + (xdrproc_t)xdr_remote_storage_vol_get_path_args, (char *)&args, + (xdrproc_t)xdr_remote_storage_vol_get_path_ret, (char *)&ret) == -1) + goto done; + + rv = ret.name; + +done: + remoteDriverUnlock(priv); + return rv; +} /* remoteDispatchStorageVolLookupByKey has to be implemented manually */ diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index bf4d866..a67f9f6 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1745,54 +1745,6 @@ done: return rv; } -static char * -remoteGetHostname (virConnectPtr conn) -{ - char *rv = NULL; - remote_get_hostname_ret ret; - struct private_data *priv = conn->privateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_GET_HOSTNAME, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_get_hostname_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees this. */ - rv = ret.hostname; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static char * -remoteGetSysinfo (virConnectPtr conn, unsigned int flags) -{ - char *rv = NULL; - remote_get_sysinfo_args args; - remote_get_sysinfo_ret ret; - struct private_data *priv = conn->privateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - args.flags = flags; - if (call (conn, priv, 0, REMOTE_PROC_GET_SYSINFO, - (xdrproc_t) xdr_remote_get_sysinfo_args, (char *) &args, - (xdrproc_t) xdr_remote_get_sysinfo_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees this. */ - rv = ret.sysinfo; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteIsSecure(virConnectPtr conn) { int rv = -1; @@ -1914,29 +1866,6 @@ done: return rv; } -static char * -remoteGetCapabilities (virConnectPtr conn) -{ - char *rv = NULL; - remote_get_capabilities_ret ret; - struct private_data *priv = conn->privateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_GET_CAPABILITIES, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_get_capabilities_ret, (char *)&ret) == -1) - goto done; - - /* Caller frees this. */ - rv = ret.capabilities; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freeMems, @@ -2047,100 +1976,6 @@ done: return rv; } -static int -remoteNumOfDomains (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_domains_ret ret; - struct private_data *priv = conn->privateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_DOMAINS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_domains_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int -remoteDomainIsActive(virDomainPtr domain) -{ - int rv = -1; - remote_domain_is_active_args args; - remote_domain_is_active_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_ACTIVE, - (xdrproc_t) xdr_remote_domain_is_active_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_is_active_ret, (char *) &ret) == -1) - goto done; - - rv = ret.active; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int -remoteDomainIsPersistent(virDomainPtr domain) -{ - int rv = -1; - remote_domain_is_persistent_args args; - remote_domain_is_persistent_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_PERSISTENT, - (xdrproc_t) xdr_remote_domain_is_persistent_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_is_persistent_ret, (char *) &ret) == -1) - goto done; - - rv = ret.persistent; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int -remoteDomainIsUpdated(virDomainPtr domain) -{ - int rv = -1; - remote_domain_is_updated_args args; - remote_domain_is_updated_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_IS_UPDATED, - (xdrproc_t) xdr_remote_domain_is_updated_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_is_updated_ret, (char *) &ret) == -1) - goto done; - - rv = ret.updated; - -done: - remoteDriverUnlock(priv); - return rv; -} - static virDomainPtr remoteDomainCreateXML (virConnectPtr conn, const char *xmlDesc, @@ -2272,57 +2107,6 @@ done: return rv; } -static char * -remoteDomainGetOSType (virDomainPtr domain) -{ - char *rv = NULL; - remote_domain_get_os_type_args args; - remote_domain_get_os_type_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_OS_TYPE, - (xdrproc_t) xdr_remote_domain_get_os_type_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_os_type_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.type; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static unsigned long -remoteDomainGetMaxMemory (virDomainPtr domain) -{ - unsigned long rv = 0; - remote_domain_get_max_memory_args args; - remote_domain_get_max_memory_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MAX_MEMORY, - (xdrproc_t) xdr_remote_domain_get_max_memory_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_max_memory_ret, (char *) &ret) == -1) - goto done; - - rv = ret.memory; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteDomainSetMemoryParameters (virDomainPtr domain, virMemoryParameterPtr params, @@ -2693,32 +2477,6 @@ done: } static int -remoteDomainGetVcpusFlags (virDomainPtr domain, unsigned int flags) -{ - int rv = -1; - remote_domain_get_vcpus_flags_args args; - remote_domain_get_vcpus_flags_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS, - (xdrproc_t) xdr_remote_domain_get_vcpus_flags_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_vcpus_flags_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteDomainPinVcpu (virDomainPtr domain, unsigned int vcpu, unsigned char *cpumap, @@ -2829,31 +2587,6 @@ done: } static int -remoteDomainGetMaxVcpus (virDomainPtr domain) -{ - int rv = -1; - remote_domain_get_max_vcpus_args args; - remote_domain_get_max_vcpus_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_MAX_VCPUS, - (xdrproc_t) xdr_remote_domain_get_max_vcpus_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_get_max_vcpus_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteDomainGetSecurityLabel (virDomainPtr domain, virSecurityLabelPtr seclabel) { remote_domain_get_security_label_args args; @@ -2934,33 +2667,6 @@ done: } static char * -remoteDomainDumpXML (virDomainPtr domain, int flags) -{ - char *rv = NULL; - remote_domain_dump_xml_args args; - remote_domain_dump_xml_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_DUMP_XML, - (xdrproc_t) xdr_remote_domain_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static char * remoteDomainXMLFromNative (virConnectPtr conn, const char *format, const char *config, @@ -3286,28 +2992,6 @@ done: } static int -remoteNumOfDefinedDomains (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_defined_domains_ret ret; - struct private_data *priv = conn->privateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_DOMAINS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_defined_domains_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteDomainCreate (virDomainPtr domain) { int rv = -1; @@ -3846,31 +3530,6 @@ done: return rv; } -static int -remoteDomainHasManagedSaveImage (virDomainPtr domain, unsigned int flags) -{ - int rv = -1; - remote_domain_has_managed_save_image_args args; - remote_domain_has_managed_save_image_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - args.flags = flags; - - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_HAS_MANAGED_SAVE_IMAGE, - (xdrproc_t) xdr_remote_domain_has_managed_save_image_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_has_managed_save_image_ret, (char *) &ret) == -1) - goto done; - - rv = ret.result; - -done: - remoteDriverUnlock(priv); - return rv; -} - /*----------------------------------------------------------------------*/ static virDrvOpenStatus ATTRIBUTE_NONNULL (1) @@ -3934,28 +3593,6 @@ remoteNetworkClose (virConnectPtr conn) } static int -remoteNumOfNetworks (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_networks_ret ret; - struct private_data *priv = conn->networkPrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_NETWORKS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_networks_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListNetworks (virConnectPtr conn, char **const names, int maxnames) { int rv = -1; @@ -4015,28 +3652,6 @@ done: } static int -remoteNumOfDefinedNetworks (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_defined_networks_ret ret; - struct private_data *priv = conn->networkPrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_NETWORKS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_defined_networks_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListDefinedNetworks (virConnectPtr conn, char **const names, int maxnames) { @@ -4150,54 +3765,6 @@ done: return net; } -static int -remoteNetworkIsActive(virNetworkPtr network) -{ - int rv = -1; - remote_network_is_active_args args; - remote_network_is_active_ret ret; - struct private_data *priv = network->conn->networkPrivateData; - - remoteDriverLock(priv); - - make_nonnull_network (&args.net, network); - - if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_IS_ACTIVE, - (xdrproc_t) xdr_remote_network_is_active_args, (char *) &args, - (xdrproc_t) xdr_remote_network_is_active_ret, (char *) &ret) == -1) - goto done; - - rv = ret.active; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int -remoteNetworkIsPersistent(virNetworkPtr network) -{ - int rv = -1; - remote_network_is_persistent_args args; - remote_network_is_persistent_ret ret; - struct private_data *priv = network->conn->networkPrivateData; - - remoteDriverLock(priv); - - make_nonnull_network (&args.net, network); - - if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_IS_PERSISTENT, - (xdrproc_t) xdr_remote_network_is_persistent_args, (char *) &args, - (xdrproc_t) xdr_remote_network_is_persistent_ret, (char *) &ret) == -1) - goto done; - - rv = ret.persistent; - -done: - remoteDriverUnlock(priv); - return rv; -} - static virNetworkPtr remoteNetworkCreateXML (virConnectPtr conn, const char *xmlDesc) { @@ -4250,59 +3817,6 @@ done: return net; } -static char * -remoteNetworkDumpXML (virNetworkPtr network, int flags) -{ - char *rv = NULL; - remote_network_dump_xml_args args; - remote_network_dump_xml_ret ret; - struct private_data *priv = network->conn->networkPrivateData; - - remoteDriverLock(priv); - - make_nonnull_network (&args.net, network); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_DUMP_XML, - (xdrproc_t) xdr_remote_network_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_network_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static char * -remoteNetworkGetBridgeName (virNetworkPtr network) -{ - char *rv = NULL; - remote_network_get_bridge_name_args args; - remote_network_get_bridge_name_ret ret; - struct private_data *priv = network->conn->networkPrivateData; - - remoteDriverLock(priv); - - make_nonnull_network (&args.net, network); - - memset (&ret, 0, sizeof ret); - if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_GET_BRIDGE_NAME, - (xdrproc_t) xdr_remote_network_get_bridge_name_args, (char *) &args, - (xdrproc_t) xdr_remote_network_get_bridge_name_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.name; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteNetworkGetAutostart (virNetworkPtr network, int *autostart) { @@ -4393,28 +3907,6 @@ remoteInterfaceClose (virConnectPtr conn) } static int -remoteNumOfInterfaces (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_interfaces_ret ret; - struct private_data *priv = conn->interfacePrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_INTERFACES, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_interfaces_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListInterfaces (virConnectPtr conn, char **const names, int maxnames) { int rv = -1; @@ -4474,28 +3966,6 @@ done: } static int -remoteNumOfDefinedInterfaces (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_defined_interfaces_ret ret; - struct private_data *priv = conn->interfacePrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_INTERFACES, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_defined_interfaces_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListDefinedInterfaces (virConnectPtr conn, char **const names, int maxnames) { int rv = -1; @@ -4608,60 +4078,6 @@ done: return iface; } - -static int -remoteInterfaceIsActive(virInterfacePtr iface) -{ - int rv = -1; - remote_interface_is_active_args args; - remote_interface_is_active_ret ret; - struct private_data *priv = iface->conn->interfacePrivateData; - - remoteDriverLock(priv); - - make_nonnull_interface (&args.iface, iface); - - if (call (iface->conn, priv, 0, REMOTE_PROC_INTERFACE_IS_ACTIVE, - (xdrproc_t) xdr_remote_interface_is_active_args, (char *) &args, - (xdrproc_t) xdr_remote_interface_is_active_ret, (char *) &ret) == -1) - goto done; - - rv = ret.active; - -done: - remoteDriverUnlock(priv); - return rv; -} - - -static char * -remoteInterfaceGetXMLDesc (virInterfacePtr iface, - unsigned int flags) -{ - char *rv = NULL; - remote_interface_get_xml_desc_args args; - remote_interface_get_xml_desc_ret ret; - struct private_data *priv = iface->conn->interfacePrivateData; - - remoteDriverLock(priv); - - make_nonnull_interface (&args.iface, iface); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (iface->conn, priv, 0, REMOTE_PROC_INTERFACE_GET_XML_DESC, - (xdrproc_t) xdr_remote_interface_get_xml_desc_args, (char *) &args, - (xdrproc_t) xdr_remote_interface_get_xml_desc_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - static virInterfacePtr remoteInterfaceDefineXML (virConnectPtr conn, const char *xmlDesc, @@ -4761,28 +4177,6 @@ remoteStorageClose (virConnectPtr conn) } static int -remoteNumOfStoragePools (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_storage_pools_ret ret; - struct private_data *priv = conn->storagePrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_STORAGE_POOLS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_storage_pools_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListStoragePools (virConnectPtr conn, char **const names, int maxnames) { int rv = -1; @@ -4838,28 +4232,6 @@ done: } static int -remoteNumOfDefinedStoragePools (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_defined_storage_pools_ret ret; - struct private_data *priv = conn->storagePrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_defined_storage_pools_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int remoteListDefinedStoragePools (virConnectPtr conn, char **const names, int maxnames) { @@ -5040,56 +4412,6 @@ done: return pool; } - -static int -remoteStoragePoolIsActive(virStoragePoolPtr pool) -{ - int rv = -1; - remote_storage_pool_is_active_args args; - remote_storage_pool_is_active_ret ret; - struct private_data *priv = pool->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_pool (&args.pool, pool); - - if (call (pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_IS_ACTIVE, - (xdrproc_t) xdr_remote_storage_pool_is_active_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_pool_is_active_ret, (char *) &ret) == -1) - goto done; - - rv = ret.active; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static int -remoteStoragePoolIsPersistent(virStoragePoolPtr pool) -{ - int rv = -1; - remote_storage_pool_is_persistent_args args; - remote_storage_pool_is_persistent_ret ret; - struct private_data *priv = pool->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_pool (&args.pool, pool); - - if (call (pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_IS_PERSISTENT, - (xdrproc_t) xdr_remote_storage_pool_is_persistent_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_pool_is_persistent_ret, (char *) &ret) == -1) - goto done; - - rv = ret.persistent; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static virStoragePoolPtr remoteStoragePoolCreateXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags) { @@ -5174,34 +4496,6 @@ done: return rv; } -static char * -remoteStoragePoolDumpXML (virStoragePoolPtr pool, - unsigned int flags) -{ - char *rv = NULL; - remote_storage_pool_dump_xml_args args; - remote_storage_pool_dump_xml_ret ret; - struct private_data *priv = pool->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_pool (&args.pool, pool); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_DUMP_XML, - (xdrproc_t) xdr_remote_storage_pool_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_pool_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteStoragePoolGetAutostart (virStoragePoolPtr pool, int *autostart) { @@ -5229,30 +4523,6 @@ done: return rv; } -static int -remoteStoragePoolNumOfVolumes (virStoragePoolPtr pool) -{ - int rv = -1; - remote_storage_pool_num_of_volumes_args args; - remote_storage_pool_num_of_volumes_ret ret; - struct private_data *priv = pool->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_pool(&args.pool, pool); - - memset (&ret, 0, sizeof ret); - if (call (pool->conn, priv, 0, REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES, - (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} static int remoteStoragePoolListVolumes (virStoragePoolPtr pool, char **const names, int maxnames) @@ -5484,61 +4754,6 @@ done: return rv; } -static char * -remoteStorageVolDumpXML (virStorageVolPtr vol, - unsigned int flags) -{ - char *rv = NULL; - remote_storage_vol_dump_xml_args args; - remote_storage_vol_dump_xml_ret ret; - struct private_data *priv = vol->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_vol (&args.vol, vol); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (vol->conn, priv, 0, REMOTE_PROC_STORAGE_VOL_DUMP_XML, - (xdrproc_t) xdr_remote_storage_vol_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_vol_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - -static char * -remoteStorageVolGetPath (virStorageVolPtr vol) -{ - char *rv = NULL; - remote_storage_vol_get_path_args args; - remote_storage_vol_get_path_ret ret; - struct private_data *priv = vol->conn->storagePrivateData; - - remoteDriverLock(priv); - - make_nonnull_storage_vol (&args.vol, vol); - - memset (&ret, 0, sizeof ret); - if (call (vol->conn, priv, 0, REMOTE_PROC_STORAGE_VOL_GET_PATH, - (xdrproc_t) xdr_remote_storage_vol_get_path_args, (char *) &args, - (xdrproc_t) xdr_remote_storage_vol_get_path_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.name; - -done: - remoteDriverUnlock(priv); - return rv; -} - - /*----------------------------------------------------------------------*/ static virDrvOpenStatus ATTRIBUTE_NONNULL (1) @@ -5606,34 +4821,6 @@ static int remoteDevMonClose(virConnectPtr conn) return ret; } -static int remoteNodeNumOfDevices(virConnectPtr conn, - const char *cap, - unsigned int flags) -{ - int rv = -1; - remote_node_num_of_devices_args args; - remote_node_num_of_devices_ret ret; - struct private_data *priv = conn->devMonPrivateData; - - remoteDriverLock(priv); - - args.cap = cap ? (char **)&cap : NULL; - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NODE_NUM_OF_DEVICES, - (xdrproc_t) xdr_remote_node_num_of_devices_args, (char *) &args, - (xdrproc_t) xdr_remote_node_num_of_devices_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static int remoteNodeListDevices(virConnectPtr conn, const char *cap, char **const names, @@ -5722,33 +4909,6 @@ done: return dev; } -static char *remoteNodeDeviceDumpXML(virNodeDevicePtr dev, - unsigned int flags) -{ - char *rv = NULL; - remote_node_device_dump_xml_args args; - remote_node_device_dump_xml_ret ret; - struct private_data *priv = dev->conn->devMonPrivateData; - - remoteDriverLock(priv); - - args.name = dev->name; - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_DUMP_XML, - (xdrproc_t) xdr_remote_node_device_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_node_device_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - static char *remoteNodeDeviceGetParent(virNodeDevicePtr dev) { char *rv = NULL; @@ -5775,30 +4935,6 @@ done: return rv; } -static int remoteNodeDeviceNumOfCaps(virNodeDevicePtr dev) -{ - int rv = -1; - remote_node_device_num_of_caps_args args; - remote_node_device_num_of_caps_ret ret; - struct private_data *priv = dev->conn->devMonPrivateData; - - remoteDriverLock(priv); - - args.name = dev->name; - - memset (&ret, 0, sizeof ret); - if (call (dev->conn, priv, 0, REMOTE_PROC_NODE_DEVICE_NUM_OF_CAPS, - (xdrproc_t) xdr_remote_node_device_num_of_caps_args, (char *) &args, - (xdrproc_t) xdr_remote_node_device_num_of_caps_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - static int remoteNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) @@ -6023,30 +5159,6 @@ remoteNWFilterClose (virConnectPtr conn) return rv; } - -static int -remoteNumOfNWFilters (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_nwfilters_ret ret; - struct private_data *priv = conn->nwfilterPrivateData; - - remoteDriverLock(priv); - - memset (&ret, 0, sizeof ret); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_NWFILTERS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_nwfilters_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static virNWFilterPtr remoteNWFilterDefineXML (virConnectPtr conn, const char *xmlDesc, unsigned int flags ATTRIBUTE_UNUSED) @@ -6189,35 +5301,6 @@ done: return net; } - -static char * -remoteNWFilterGetXMLDesc (virNWFilterPtr nwfilter, unsigned int flags) -{ - char *rv = NULL; - remote_nwfilter_get_xml_desc_args args; - remote_nwfilter_get_xml_desc_ret ret; - struct private_data *priv = nwfilter->conn->nwfilterPrivateData; - - remoteDriverLock(priv); - - make_nonnull_nwfilter (&args.nwfilter, nwfilter); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (nwfilter->conn, priv, 0, REMOTE_PROC_NWFILTER_GET_XML_DESC, - (xdrproc_t) xdr_remote_nwfilter_get_xml_desc_args, (char *) &args, - (xdrproc_t) xdr_remote_nwfilter_get_xml_desc_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - - /*----------------------------------------------------------------------*/ static int @@ -7280,28 +6363,6 @@ remoteSecretClose (virConnectPtr conn) } static int -remoteSecretNumOfSecrets (virConnectPtr conn) -{ - int rv = -1; - remote_num_of_secrets_ret ret; - struct private_data *priv = conn->secretPrivateData; - - remoteDriverLock (priv); - - memset (&ret, 0, sizeof (ret)); - if (call (conn, priv, 0, REMOTE_PROC_NUM_OF_SECRETS, - (xdrproc_t) xdr_void, (char *) NULL, - (xdrproc_t) xdr_remote_num_of_secrets_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock (priv); - return rv; -} - -static int remoteListSecrets (virConnectPtr conn, char **uuids, int maxuuids) { int rv = -1; @@ -7440,33 +6501,6 @@ done: return rv; } -static char * -remoteSecretGetXMLDesc (virSecretPtr secret, unsigned int flags) -{ - char *rv = NULL; - remote_secret_get_xml_desc_args args; - remote_secret_get_xml_desc_ret ret; - struct private_data *priv = secret->conn->secretPrivateData; - - remoteDriverLock (priv); - - make_nonnull_secret (&args.secret, secret); - args.flags = flags; - - memset (&ret, 0, sizeof (ret)); - if (call (secret->conn, priv, 0, REMOTE_PROC_SECRET_GET_XML_DESC, - (xdrproc_t) xdr_remote_secret_get_xml_desc_args, (char *) &args, - (xdrproc_t) xdr_remote_secret_get_xml_desc_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock (priv); - return rv; -} - static int remoteSecretSetValue (virSecretPtr secret, const unsigned char *value, size_t value_size, unsigned int flags) @@ -8070,34 +7104,6 @@ done: return rv; } - -static int -remoteCPUCompare(virConnectPtr conn, const char *xmlDesc, - unsigned int flags ATTRIBUTE_UNUSED) -{ - struct private_data *priv = conn->privateData; - remote_cpu_compare_args args; - remote_cpu_compare_ret ret; - int rv = VIR_CPU_COMPARE_ERROR; - - remoteDriverLock(priv); - - args.xml = (char *) xmlDesc; - - memset(&ret, 0, sizeof (ret)); - if (call(conn, priv, 0, REMOTE_PROC_CPU_COMPARE, - (xdrproc_t) xdr_remote_cpu_compare_args, (char *) &args, - (xdrproc_t) xdr_remote_cpu_compare_ret, (char *) &ret) == -1) - goto done; - - rv = ret.result; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static char * remoteCPUBaseline(virConnectPtr conn, const char **xmlCPUs, @@ -8197,62 +7203,6 @@ done: return snapshot; } - -static char * -remoteDomainSnapshotDumpXML(virDomainSnapshotPtr snapshot, unsigned int flags) -{ - char *rv = NULL; - remote_domain_snapshot_dump_xml_args args; - remote_domain_snapshot_dump_xml_ret ret; - struct private_data *priv = snapshot->domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain_snapshot(&args.snap, snapshot); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (snapshot->domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SNAPSHOT_DUMP_XML, - (xdrproc_t) xdr_remote_domain_snapshot_dump_xml_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_snapshot_dump_xml_ret, (char *) &ret) == -1) - goto done; - - /* Caller frees. */ - rv = ret.xml; - -done: - remoteDriverUnlock(priv); - return rv; -} - - -static int -remoteDomainSnapshotNum (virDomainPtr domain, unsigned int flags) -{ - int rv = -1; - remote_domain_snapshot_num_args args; - remote_domain_snapshot_num_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain (&args.dom, domain); - args.flags = flags; - - memset (&ret, 0, sizeof ret); - if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SNAPSHOT_NUM, - (xdrproc_t) xdr_remote_domain_snapshot_num_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_snapshot_num_ret, (char *) &ret) == -1) - goto done; - - rv = ret.num; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static int remoteDomainSnapshotListNames (virDomainPtr domain, char **const names, int maxnames, unsigned int flags) @@ -8346,33 +7296,6 @@ done: return snapshot; } - -static int -remoteDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags) -{ - int rv = -1; - remote_domain_has_current_snapshot_args args; - remote_domain_has_current_snapshot_ret ret; - struct private_data *priv = domain->conn->privateData; - - remoteDriverLock(priv); - - make_nonnull_domain(&args.dom, domain); - args.flags = flags; - - if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_HAS_CURRENT_SNAPSHOT, - (xdrproc_t) xdr_remote_domain_has_current_snapshot_args, (char *) &args, - (xdrproc_t) xdr_remote_domain_has_current_snapshot_ret, (char *) &ret) == -1) - goto done; - - rv = ret.result; - -done: - remoteDriverUnlock(priv); - return rv; -} - - static virDomainSnapshotPtr remoteDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags) @@ -8617,7 +7540,6 @@ done: remoteDriverUnlock(priv); return rv; - } @@ -8646,7 +7568,6 @@ remoteQemuDomainMonitorCommand (virDomainPtr domain, const char *cmd, *result = strdup(ret.result); if (*result == NULL) { - virReportOOMError(); goto cleanup; } @@ -10282,7 +9203,7 @@ static virSecretDriver secret_driver = { .name = "remote", .open = remoteSecretOpen, .close = remoteSecretClose, - .numOfSecrets = remoteSecretNumOfSecrets, + .numOfSecrets = remoteNumOfSecrets, .listSecrets = remoteListSecrets, .lookupByUUID = remoteSecretLookupByUUID, .lookupByUsage = remoteSecretLookupByUsage, -- 1.7.0.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list