[PATCH v1 4/4] libxl: set vcpu affinity during domain creation

Olaf Hering olaf at aepfle.de
Wed May 5 03:23:11 UTC 2021


Am Tue, 4 May 2021 16:34:05 -0600
schrieb Jim Fehlig <jfehlig at suse.com>:

> > +    /* Will be released by libxl_domain_config_dispose */
> > +    b_info->vcpu_hard_affinity = calloc(vcpu_idx, sizeof(libxl_bitmap));  
> Fails syntax-check. You'll need to use g_new0.

There are other areas where libxl expects the caller to provide a malloc buffer, which it free's later in its *_dispose functions. libxlMakeDiskList for example.
This looks like an inconsistency in the API.

Perhaps we assume glib folks will make no mistakes in the future to use a private allocator again. Or we provide a simple calloc/free wrapper in libxl_api_wrapper.h, which can be easily blacklisted in exclude_file_name_regexp--sc_prohibit_raw_allocation.

Olaf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210505/01715a8a/attachment-0001.sig>


More information about the libvir-list mailing list