Re: [PATCH] (for discussion) DHCP host mappings using 3 arrays API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 25, 2008 at 04:49:00PM +0000, Richard W.M. Jones wrote:
[...]

Thanks to Jim for pointing me in the right direction here.  If you try
this patch you'll need to insert memset() calls at the two places
indicated below.  That fixes all the problems I can see and it appears
to all work fine now.

Rich.

> +static int
> +remoteNetworkNumOfDHCPHostMappings (virNetworkPtr network)
> +{
> +    remote_network_num_of_dhcp_host_mappings_args args;
> +    remote_network_num_of_dhcp_host_mappings_ret ret;
> +    GET_NETWORK_PRIVATE (network->conn, -1);
> +
> +    make_nonnull_network (&args.net, network);
> +

  memset (&ret, 0, sizeof ret);

> +    if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_NUM_OF_DHCP_HOST_MAPPINGS,
> +              (xdrproc_t) xdr_remote_network_num_of_dhcp_host_mappings_args, (char *) &args,
> +              (xdrproc_t) xdr_remote_network_num_of_dhcp_host_mappings_ret, (char *) &ret) == -1)
> +        return -1;
> +
> +    return ret.num;
> +}
> +
> +
> +static int
> +remoteNetworkListDHCPHostMappings (virNetworkPtr network,
> +                                   char **const hwaddrs,
> +                                   char **const ipaddrs,
> +                                   char **const hostnames,
> +                                   int maxmappings)
> +{
> +    remote_network_list_dhcp_host_mappings_args args;
> +    remote_network_list_dhcp_host_mappings_ret ret;
> +    int i;
> +    GET_NETWORK_PRIVATE (network->conn, -1);
> +
> +    make_nonnull_network (&args.net, network);
> +    args.maxmappings = maxmappings;
> +

  memset (&ret, 0, sizeof ret);

> +    if (call (network->conn, priv, 0, REMOTE_PROC_NETWORK_LIST_DHCP_HOST_MAPPINGS,
> +              (xdrproc_t) xdr_remote_network_list_dhcp_host_mappings_args, (char *) &args,
> +              (xdrproc_t) xdr_remote_network_list_dhcp_host_mappings_ret, (char *) &ret) == -1)
> +        return -1;


-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]