summaryrefslogtreecommitdiff
path: root/examples/guest-vcpus
Commit message (Collapse)AuthorAgeFilesLines
* examples: Fix white spacePhilipp Hahn2020-08-051-3/+10
| | | | | | | indent by 4 spaces one spaces around assignments Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Replace sys.exit() with exit()Philipp Hahn2020-08-051-3/+2
| | | | | | No need to import sys. Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Cleanup importsPhilipp Hahn2020-08-051-2/+0
| | | | | | | | | | Break import into multiple lines as recommended by PEP-8 Move imports to top Remove unused imports Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Do not use bare exceptPhilipp Hahn2020-08-051-3/+3
| | | | | | as it also catches SystemExit, InterruptedError, SyntaxError and such. Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples: Convert to ArgumentParserPhilipp Hahn2020-08-052-77/+33
| | | | | | | | Replace getopt() and hand-rolled-parser with argparse.ArgumentParser. Fix wrong header comments copy-pasted from domstart.py Signed-off-by: Philipp Hahn <hahn@univention.de>
* examples/*: Remove stray semicolonPhilipp Hahn2020-08-051-2/+2
| | | | | | This is Python, not C Signed-off-by: Philipp Hahn <hahn@univention.de>
* Drop support for python 2Daniel P. Berrangé2019-12-042-2/+2
| | | | | | | | | python2 will be end of life by the time of the next libvirt release. All our supported build targets, including CentOS7, have a python3 build available. Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* examples: Add example to make guest agent lifecycle event usefulPeter Krempa2015-05-112-0/+234
This example allows to use the guest agent event and metadata to track vCPU count set via the guest agent (agent-based onlining/offlining) and keep it persistent accross domain restarts. The daemon listens for the agent lifecycle event, and if it's received it looks into doman's metadata to see whether a desired count was set and issues the guest agent command.