summaryrefslogtreecommitdiff
path: root/libvirt-utils.c
Commit message (Collapse)AuthorAgeFilesLines
* don't overrun buffer when converting cpumapv2.5.0Konstantin Neumoin2016-11-111-6/+1
| | | | | | | | | | | If we pass large(more than cpunum) cpu mask to any libvirt_virDomainPin* function, it could leads to crash. So we have to check tuple size in virPyCpumapConvert and ignore extra tuple members. Since we allocate a zeroed buffer, we don't need to bother with setting the bits to zero. Signed-off-by: Konstantin Neumoin <kneumoin@virtuozzo.com>
* move cpumap conversion code to a common helperKonstantin Neumoin2016-11-111-0/+57
| | | | | | | | All libvirt_virDomainPin* functions do the same thing for convert pycpumap to cpumap, so this patch moves all common logic to new helper - virPyCpumapConvert. Signed-off-by: Konstantin Neumoin <kneumoin@virtuozzo.com>
* use VIR_PY_DICT_SET_GOTOPavel Hrdina2015-10-051-11/+2
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* indent labels by one spacePavel Hrdina2015-10-051-2/+2
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* cleanup functions definitionPavel Hrdina2015-10-051-10/+15
| | | | | | Follow the libvirt hacking guide and make the code consistent. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Move utils and shared code into libvirt-utilsPavel Hrdina2015-10-051-0/+406
| | | | Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Import some virTypedParams* APIs from libvirtDoug Goldstein2013-11-221-0/+46
| | | | | | | virTypedParamsClear() and virTypedParamsFree() were introduced in libvirt 1.0.2. In an effort to keep the code clean bring these two functions to libvirt-python if we're building against a version of libvirt that's older than 1.0.2
* Import VIR_FORCE_CLOSE macro from libvirtDaniel P. Berrange2013-11-221-0/+20
| | | | | | Import the macro for safely closing file descriptors Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import VIR_ALLOC / VIR_ALLOC_N / VIR_REALLOC_N functionsDaniel P. Berrange2013-11-221-0/+120
Import the libvirt memory allocation functions, stripping the OOM testing and error reporting pieces. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>