summaryrefslogtreecommitdiffstats
path: root/libvirt-override.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of virStrcpyStaticDaniel P. Berrange2013-09-091-1/+2
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import gnulib's ignore_value macroDaniel P. Berrange2013-09-091-0/+11
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import gnulib's xalloc_oversized macroDaniel P. Berrange2013-09-091-0/+16
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Update header file includesDaniel P. Berrange2013-09-091-7/+2
| | | | | | | Remove use of all libvirt util header files. Reference generated header files in build/ subdir. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add decl of MIN macroDaniel P. Berrange2013-09-091-0/+4
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Import STREQ macro from libvirtDaniel P. Berrange2013-09-091-0/+2
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove use of VIR_ALLOC_NDaniel P. Berrange2013-09-091-53/+53
| | | | Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove use of VIR_FREE from codeDaniel P. Berrange2013-09-091-114/+114
| | | | | | | We don't have access to the libvirt memory APIs to replace VIR_FREE with free(). Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix potential use of uninitialized value in virDomainGetVcpuPinInfoDaniel P. Berrange2013-09-091-1/+1
| | | | | | | The virDomainGetVcpuPinInfo python wrapper had a potential use of uninitialized values Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remote compiler annotation attributesDaniel P. Berrange2013-09-091-141/+140
| | | | | | Remove ATTRIBUTE_NONNULL and ATTRIBUTE_UNUSED Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Remove <config.h> from source filesDaniel P. Berrange2013-09-091-2/+0
| | | | | | | We're no longer using automake, so <config.h> files are not required Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Add VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED eventJiri Denemark2013-07-181-1/+51
|
* Introduce new domain create APIs to pass pre-opened FDs to LXCDaniel P. Berrange2013-07-181-0/+89
| | | | | | | | | | | | | | | | | | | | With container based virt, it is useful to be able to pass pre-opened file descriptors to the container init process. This allows for containers to be auto-activated from incoming socket connections, passing the active socket into the container. To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles and virDomainCreateWithFiles, which accept an array of file descriptors. For the LXC driver, UNIX file descriptor passing will be used to send them to libvirtd, which will them pass them down to libvirt_lxc, which will then pass them to the container init process. This will only be implemented for LXC right now, but the design is generic enough it could work with other hypervisors, hence I suggest adding this to libvirt.so, rather than libvirt-lxc.so Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* python: return dictionary without value in case of no blockjobCVE-2013-4154CVE-2013-4153Guannan Ren2013-07-151-15/+39
| | | | | | | | | | | | | | Currently, when there is no blockjob, dom.blockJobInfo('vda') still reports error because it doesn't distinguish return value 0 from -1. libvirt.libvirtError: virDomainGetBlockJobInfo() failed virDomainGetBlockJobInfo() API return value: -1 in case of failure, 0 when nothing found, 1 found. And use PyDict_SetItemString instead of PyDict_SetItem when key is of string type. PyDict_SetItemString increments key/value reference count, so call Py_DECREF() for value. For key, we don't need to do this, because PyDict_SetItemString will handle it internally.
* Convert 'int i' to 'size_t i' in python/ filesDaniel P. Berrange2013-07-101-44/+70
| | | | | | | | | Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* viralloc: Report OOM error on failureCVE-2013-2230Michal Privoznik2013-07-101-51/+51
| | | | | Similarly to VIR_STRDUP, we want the OOM error to be reported in VIR_ALLOC and friends.
* python: Add bindings for extensible migration APIsv1.1.0-rc2v1.1.0-rc1v1.1.0CVE-2013-2218Jiri Denemark2013-06-251-0/+218
| | | | | The patch implements wrappers for virDomainMigrate3 and virDomainMigrateToURI3.
* syntax: prefer space after semicolon in for loopv1.0.6-rc2v1.0.6Eric Blake2013-05-281-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | I noticed several unusual spacings in for loops, and decided to fix them up. See the next commit for the syntax check that found all of these. * examples/domsuspend/suspend.c (main): Fix spacing. * python/libvirt-override.c: Likewise. * src/conf/interface_conf.c: Likewise. * src/security/virt-aa-helper.c: Likewise. * src/util/virconf.c: Likewise. * src/util/virhook.c: Likewise. * src/util/virlog.c: Likewise. * src/util/virsocketaddr.c: Likewise. * src/util/virsysinfo.c: Likewise. * src/util/viruuid.c: Likewise. * src/vbox/vbox_tmpl.c: Likewise. * src/xen/xen_hypervisor.c: Likewise. * tools/virsh-domain-monitor.c (vshDomainStateToString): Drop default case, to let compiler check us. * tools/virsh-domain.c (vshDomainVcpuStateToString): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* python: Remove the whitespace before ";"v1.0.6-rc1Osier Yang2013-05-211-8/+8
|
* Fix build of python bindings on Python 2.4CVE-2013-1962Daniel P. Berrange2013-05-091-0/+4
| | | | | | | The PyDict_Next method on Python <= 2.4 used 'int' instead of "Py_ssize_t" for the 'pos' parameter Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* virutil: Move string related functions to virstring.cMichal Privoznik2013-05-021-0/+1
| | | | | | | | The source code base needs to be adapted as well. Some files include virutil.h just for the string related functions (here, the include is substituted to match the new file), some include virutil.h without any need (here, the include is removed), and some require both.
* docs: fix usage of 'onto'v1.0.5-rc1v1.0.5Eric Blake2013-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | http://www.uhv.edu/ac/newsletters/writing/grammartip2009.07.01.htm (and several other sites) give hints that 'onto' is best used if you can also add 'up' just before it and still make sense. In many cases in the code base, we really want the two-word form, or even a simplification to just 'on' or 'to'. * docs/hacking.html.in: Use correct 'on to'. * python/libvirt-override.c: Likewise. * src/lxc/lxc_controller.c: Likewise. * src/util/virpci.c: Likewise. * daemon/THREADS.txt: Use simpler 'on'. * docs/formatdomain.html.in: Better usage. * docs/internals/rpc.html.in: Likewise. * src/conf/domain_event.c: Likewise. * src/rpc/virnetclient.c: Likewise. * tests/qemumonitortestutils.c: Likewise. * HACKING: Regenerate. Signed-off-by: Eric Blake <eblake@redhat.com>
* syntax-check: Only allows to include public headers in external toolsOsier Yang2013-04-181-2/+2
| | | | | | With this patch, include public headers in "" form is only allowed for "internal.h". And only the external tools (examples|tools|python |include/libvirt) can include the public headers in <> form.
* python: Fix emulatorpin API bindingsPeter Krempa2013-03-211-0/+118
| | | | | | | | | | The addition of emulator pinning APIs didn't think of doing the right job with python APIs for them. The default generator produced unusable code for this. This patch switches to proper code as in the case of domain Vcpu pining. This change can be classified as a python API-breaker but in the state the code was before I doubt anyone was able to use it successfully.
* python: Implement virDomainMigrateGetCompressionCache wrapperv1.0.3-rc2v1.0.3-rc1Jiri Denemark2013-02-221-0/+28
|
* python: Implement virDomainGetJobStats wrapperJiri Denemark2013-02-221-0/+42
|
* Introduce virTypedParamsClear public APIv1.0.2-rc1Jiri Denemark2013-01-181-39/+20
| | | | | The function is just a renamed public version of former virTypedParameterArrayClear.
* python: Avoid freeing uninitialized new_params pointerJiri Denemark2013-01-171-7/+7
|
* Rename util.{c,h} to virutil.{c,h}Daniel P. Berrange2012-12-211-1/+1
|
* Rename memory.{c,h} to viralloc.{c,h}Daniel P. Berrange2012-12-211-1/+1
|
* Fix the indentionv1.0.1-rc2v1.0.1-rc1v1.0.1Osier Yang2012-12-041-1/+1
| | | | | Introduced by commit 1465876a, pushed under build-breaker && trivial rule.
* Bind connection close callback APIs to python bindingDaniel P. Berrange2012-12-041-0/+107
| | | | | | | | | Add code in the python binding to cope with the new APIs virConnectRegisterCloseCallback and virConnectUnregisterCloseCallback. Also demonstrate their use in the python domain events demo Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* python: Use virNodeGetCPUMap where possibleCVE-2012-3411Viktor Mihajlovski2012-11-151-35/+52
| | | | | | | | | Modified the places where virNodeGetInfo was used for the purpose of obtaining the maximum node CPU number. Transparently falling back to virNodeGetInfo in case of failure. Wrote a utility function getPyNodeCPUCount for that purpose. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
* Remove spurious whitespace between function name & open bracketsDaniel P. Berrange2012-11-021-18/+18
| | | | | | | | The libvirt coding standard is to use 'function(...args...)' instead of 'function (...args...)'. A non-trivial number of places did not follow this rule and are fixed in this patch. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* maint: consistent whitespace after 'if'v1.0.0-rc3v1.0.0-rc2v1.0.0Eric Blake2012-10-251-27/+27
| | | | | | Noticed during the review of the previous patch. * python/libvirt-override.c: Use space between 'if ('.
* virNodeGetCPUMap: Add python bindingViktor Mihajlovski2012-10-251-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a method getCPUMap to virConnect. It can be used as follows: import libvirt import sys import os conn = libvirt.openReadOnly(None) if conn == None: print 'Failed to open connection to the hypervisor' sys.exit(1) try: (cpus, cpumap, online) = conn.getCPUMap(0) except: print 'Failed to extract the node cpu map information' sys.exit(1) print 'CPUs total %d, online %d' % (cpus, online) print 'CPU map %s' % str(cpumap) del conn print "OK" sys.exit(0) Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* Add support for SUSPEND_DISK eventMartin Kletzander2012-10-151-0/+50
| | | | | | | | | This patch adds support for SUSPEND_DISK event; both lifecycle and separated. The support is added for QEMU, machines are changed to PMSUSPENDED, but as QEMU sends SHUTDOWN afterwards, the state changes to shut-off. This and much more needs to be done in order for libvirt to work with transient devices, wake-ups etc. This patch is not aiming for that functionality.
* python: cleanup vcpu related binding APIsGuannan Ren2012-10-081-42/+121
| | | | | | | | | | | | | | | | libvirt_virDomainGetVcpus: add error handling, return -1 instead of None libvirt_virDomainPinVcpu and libvirt_virDomainPinVcpuFlags: check the type of argument make use of libvirt_boolUnwrap Set bitmap according to these values which are contained in given argument of vcpu tuple and turn off these bit corresponding to missing vcpus in argument tuple The original way ignored the error info from PyTuple_GetItem if index is out of range. "IndexError: tuple index out of range" The error message will only be raised on next command in interactive mode.
* node_memory: Expose the APIs to Python bindingsv0.10.2-rc2v0.10.2-rc1v0.10.2Osier Yang2012-09-171-0/+125
| | | | | | * python/libvirt-override-api.xml: (Add document to describe the APIs). * python/libvirt-override.c: (Implement the API wrappers manually)
* list: Expose virConnectListAllSecrets to Python bindingOsier Yang2012-09-171-0/+48
| | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: Implementation for listAllSecrets. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllNWFilters to Python bindingOsier Yang2012-09-171-0/+48
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * Implementation for listAllNWFilters. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllNodeDevices to Python bindingOsier Yang2012-09-171-0/+48
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * Implementation for listAllNodeDevices. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virConnectListAllInterfaces to Python bindingCVE-2012-4423Osier Yang2012-09-121-0/+48
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: * New file, includes implementation of listAllInterfaces. python/libvirt-override.c: Implementation for the wrapper.
* python: Initialize new_params in virDomainSetSchedulerParametersFederico Simoncelli2012-09-111-1/+1
| | | | | | | | The new_params variable must be initialized in case the virDomainGetSchedulerParameters call fails and we hit the cleanup section before actually allocating the new parameters. Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
* Check against python None type when filling in auth parametersDaniel P. Berrange2012-09-111-1/+2
| | | | | | | | When deciding whether to provide an auth function callback in openAuth(), credcb was checked against NULL, when it really needs to be checked against Py_None Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Print any exception that occurs in authentication callbackDaniel P. Berrange2012-09-111-1/+3
| | | | | | | | | If an exception occurs in the python callback for openAuth() the stack trace isn't seen by the apps, since this code is called from libvirt context. To aid diagnostics, print the error to stderr at least Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Fix crash passing an empty list to python openAuth() APIDaniel P. Berrange2012-09-111-0/+1
| | | | | | | | | If passing a 'credtype' parameter which was an empty list to the python openAuth() API, the 'credtype' field in the virConnectAuth struct would not be initialized. This lead to a crash when later trying to free that field. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* list: Expose virConnectListAllNetworks to Python bindingOsier Yang2012-09-111-0/+48
| | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virConnect.py: Implement listAllNetworks. python/libvirt-override.c: Implementation for the wrapper.
* list: Expose virStoragePoolListAllVolumes to Python bindingOsier Yang2012-09-101-0/+50
| | | | | | | | | | | | The implementation is done manually as the generator does not support wrapping lists of C pointers into Python objects. python/libvirt-override-api.xml: Document python/libvirt-override-virStoragePool.py: * New file, includes implementation of listAllVolumes. python/libvirt-override.c: Implementation for the wrapper.
* Fix PMSuspend and PMWakeup eventsJiri Denemark2012-09-071-2/+2
| | | | | | The unused reason parameter of PM{Suspend,Wakeup} event callbacks was completely ignored in lot of places and those events were not actually working at all.