Mon Jun 25 09:19:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>

* qemud/remote.c, src/remote_internal.c: Fix virDomainGetVcpus
	  in the remote case.
	* src/libvirt.c: Allow virConnectListDomains,
	  virConnectListDefinedDomains, virConnectListNetworks and
	  virConnectListDefinedNetworks to work in the case where
	  they are called with maxids/maxnames == 0.
	* src/remote_internal.c: Fix virDomainGetMaxVcpus in remote
	  case so that it copies sufficient data.
	* src/xen_unified.c: Remove autostart functions.
This commit is contained in:
Richard W.M. Jones
2007-06-25 08:23:10 +00:00
parent 137847e55d
commit 56cd4140d4
5 changed files with 28 additions and 43 deletions

View File

@@ -956,14 +956,14 @@ remoteDispatchDomainGetVcpus (struct qemud_client *client,
return -2;
}
if (args->maplen > REMOTE_CPUMAPS_MAX) {
remoteDispatchError (client, req, "maplen > REMOTE_CPUMAPS_MAX");
if (args->maxinfo * args->maplen > REMOTE_CPUMAPS_MAX) {
remoteDispatchError (client, req, "maxinfo * maplen > REMOTE_CPUMAPS_MAX");
return -2;
}
/* Allocate buffers to take the results. */
info = calloc (args->maxinfo, sizeof (virVcpuInfo));
cpumaps = calloc (args->maplen, sizeof (unsigned char));
cpumaps = calloc (args->maxinfo * args->maplen, sizeof (unsigned char));
info_len = virDomainGetVcpus (dom,
info, args->maxinfo,
@@ -985,7 +985,7 @@ remoteDispatchDomainGetVcpus (struct qemud_client *client,
* assumption that unsigned char and char are the same size.
* Note that remoteDispatchClientRequest will free.
*/
ret->cpumaps.cpumaps_len = args->maplen;
ret->cpumaps.cpumaps_len = args->maxinfo * args->maplen;
ret->cpumaps.cpumaps_val = (char *) cpumaps;
return 0;