summaryrefslogtreecommitdiff
path: root/virt-xml
Commit message (Collapse)AuthorAgeFilesLines
* virt-*: invoke python3 using /usr/bin/enva13460542021-10-041-1/+1
|
* Move virt-* code into their modulesCole Robinson2020-01-261-570/+6
| | | | | | | | | | | | | This layout is closer to what most python modules have nowadays. It also simplifies testing and static analysis setup. Keep virt-* wrappers locally, for ease of running these commands from a git checkout. Adjust the wrapper binaries we install on via packaging to be pure python, which makes things like running gdb easier. Signed-off-by: Cole Robinson <crobinso@redhat.com>
* virt-xml: fix defined_xml_is_unchangedPavel Hrdina2019-12-031-2/+2
| | | | | | | | | Commit <53f075ab76e1c372474ae0d88f202e487d9f213f> added a warning if the VM XML is not changed after removing default devices but the code was incorrect. We have to compare strings instead of string vs Guest object and also the condition was inverted. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
* Switch to more traditional logging structureCole Robinson2019-06-171-9/+9
| | | | | | | | Init a shared log instance in virtinst/logger.py, and use that throughout the code base, so we aren't calling directly into 'logging'. This helps protect our logging output from being cluttered with other library output, as happens with some 'requests' usage
* virt-xml: Warn if libvirt discards our defined changesCole Robinson2019-06-161-0/+10
| | | | | | | This can happen if we try to remove a default device, like a ps2 mouse on x86, but it can happen for many other reasons as well https://bugzilla.redhat.com/show_bug.cgi?id=1405263
* virt-xml: Use VIR_DOMAIN_XML_SECURECole Robinson2019-06-161-2/+9
| | | | Otherwise we will lose data when editing VMs
* virt-xml: Denest and comment code flow a bitCole Robinson2019-06-161-33/+55
| | | | | Add lots of early exits to remove implicit fall through behavior that I find hard to follow
* virt-xml: If no XML diff is generated, explicitly warnCole Robinson2019-06-161-0/+4
|
* virt-xml: Abide domain name for --build-xmlCole Robinson2019-06-141-6/+7
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1648939
* virt-xml: Remove virt_xml_setup hackCole Robinson2019-06-141-4/+0
| | | | | Not sure why this was originally required, but I can't think how to even trigger this occasion nowadays
* virt-xml: Add more test coverageCole Robinson2019-06-141-9/+5
|
* virt-install: Drop --os-variant suboption parsingCole Robinson2019-06-131-1/+2
| | | | | | Not sure I want to go down that route if we can avoid it. Instead just fold the full_id support into the existing option handling. Streamline the OSVariantData usage throughout the cli tools
* cli: Rename parse_option_strings update= to editing=Cole Robinson2019-06-131-1/+1
| | | | | Makes it more clear what the distinction is. Set this in the parser class so the cli infrastructure can access it
* cli: Add more code coverageCole Robinson2019-06-111-3/+2
|
* virtinst: Rename util to xmlutilCole Robinson2019-06-071-5/+5
| | | | | The only functions left in there are largely for xml handling, so make it explicit
* Fix codespell errorsCole Robinson2019-05-161-1/+1
|
* cli: make parse() guest argument optionalCole Robinson2019-05-121-1/+1
| | | | Because the non-guest parsers don't need it.
* cli: Clarify guest_propname and list_propnameCole Robinson2019-05-101-3/+3
| | | | | There's conflicting 'propname' naming now, so rename some usage to match
* virt-xml: Handle VM names that look like id/uuid (bz 1679025)Cole Robinson2019-03-211-5/+11
| | | | | | | Previously we assume they are id/uuid, so if it's actually the VM name then the command fails. Now we always check for a name first, https://bugzilla.redhat.com/show_bug.cgi?id=1679025
* virt-xml: Add support for starting the domainMarc Hartmayer2019-03-061-8/+45
| | | | | | | | | | Add support for starting the domain. By default, first the domain is defined and then started. If the `--start` is used in combination with `--no-define` a transient domain is created without persisting the changes in the persistent domain definition. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
* virt-xml: Add --no-define argumentMarc Hartmayer2019-03-061-4/+9
| | | | | | | | | Add `--no-define` argument. It's mutually exclusive to the `--define` argument and later on it allows the user to start a domain transiently. Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
* cli: Parameterize --os-variantCole Robinson2019-02-071-1/+2
| | | | | For now it just takes a single name= parameter that maps to the current behavior
* cli: Rename options.distro_variant to options.os_variantCole Robinson2019-02-071-7/+7
| | | | | We don't really use the 'distro' naming any more, and the command line option is called os_variant, so stick with that
* cli: Add function cli_flag_name and use itLin Ma2019-01-141-1/+1
| | | | | | | It can convert the underscore to minus for cli_arg_name in help output or error message. Signed-off-by: Lin Ma <lma@suse.com>
* cli; Share --os-variant option registeringCole Robinson2019-01-081-4/+1
| | | | And improve the help message for both users
* Remove Author lines from file headersCole Robinson2019-01-081-1/+0
| | | | | | | Similar to what was done in libvirt. See these commits: https://github.com/libvirt/libvirt/commit/600462834f4ec1955a9a48a1b6b4a390b9c31553 https://github.com/libvirt/libvirt/commit/c99e954973ea330e32e392c71ed17db5b359381b
* virt-xml: Add auto complete support for the general optionsLin Ma2018-12-181-0/+2
| | | | Signed-off-by: Lin Ma <lma@suse.com>
* virt-xml: Start using --os-variantAndrea Bolognani2018-11-131-0/+14
| | | | | | | | | | | | | | The option only works with --add-device for the time being, so we prevent its use in all other cases. It would be nice to have it work with --build-xml too, but in that case the user would have to provide some extra information that in the case of --add-device we can figure out from the existing guest, and it's not entirely clear whether that would even be that useful, so for now we're not considering that case at all. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* virt-xml: Accept --os-variant optionAndrea Bolognani2018-11-131-0/+5
| | | | | | | | We're not doing anything with it yet, but having the parser accept it means we can write tests and see how their output changes once we wire it up in earnest. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
* devices: disk: Rename setup() to build_storage()Cole Robinson2018-09-041-1/+1
| | | | | | It's more explicit. Plus drop the supposedly generic setup() entry point, storage is handled specially everywhere so it's not a generic interface
* virt-xml: Call set_defaults on created XML objectsCole Robinson2018-09-041-2/+11
|
* xmlbuilder: Rename get_xml_config -> get_xmlCole Robinson2018-08-311-5/+5
| | | | The config part is redundant. Should have done this a long time ago
* Fix copyright header to specify GPLv2 or later, not GPLv2 only.Daniel P. Berrangé2018-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | The copyright headers in every file were chjanged in this previous commit commit b6dcee8eb7ec4de999058c187162fe4aedef36b4 Author: Cole Robinson <crobinso@redhat.com> Date: Tue Mar 20 15:00:02 2018 -0400 Use consistent and minimal license header for every file Where before this they said " "either version 2 of the License, or (at your option) any later version." Now they just say "GNU GPLv2" This fixes it to say "GNU GPLv2 or later" again. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* virt-xml: Warn when --update is inapplicableDavid H. Gutteridge2018-04-031-3/+7
|
* virt-xml: Make it more clear when changes take effectCole Robinson2018-03-251-1/+1
| | | | | shutdown could be interpreted as a soft reboot, which won't apply the changes
* cli: Have parser classes reference property names, not xmlbuildersCole Robinson2018-03-211-18/+11
| | | | | | propertys already give us ways to access the backing class, and switching to this method lets us drop some infrastructure in xmlbuilder
* cli: Drop clear_attr propertyCole Robinson2018-03-211-13/+4
| | | | | It slightly complicates the generic machinery, and the one usage we can handle directly
* devices: Switch to normal _XML_PROP_ORDERCole Robinson2018-03-211-1/+1
| | | | Drop the register_device stuff, rename virtual_device_type
* guest: Move all_devices to guest.devices.XCole Robinson2018-03-211-5/+14
| | | | | | | | | The way we enumerate devices doesn't conform with the way all other XMLBuilder instances expose child objects. Move more towards that direction. This requires some virt-xml and cli.py hacks but we will remove those in future patches
* Use consistent and minimal license header for every fileCole Robinson2018-03-211-14/+2
|
* virt-xml: Remove redundant XML roundtrippingCole Robinson2018-02-221-11/+4
| | | | Based on how we do diff reporting it doesn't accomplish anything anyways
* Switch to python3 in script shebangCole Robinson2018-02-061-1/+1
| | | | Signed-off-by: Cole Robinson <crobinso@redhat.com>
* virtinst: Drop UUID validationCole Robinson2017-12-141-5/+3
| | | | | It's redundant as libvirt will give us these checks already, and we aren't even testing it
* pycodestyle: fix all E125 warningsChen Hanxiao2017-10-211-1/+1
| | | | | | | | | Fix all E125: Continuation line with same indent as next logical line Also remove ignore options of E125 Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
* tests: pylint: Silence/fix a bunch of new warningsCole Robinson2017-06-161-0/+1
|
* Switch to python3 style 'except X as Y' notationCole Robinson2017-05-051-4/+4
| | | | Which also works with python2.7
* virt-xml: Only print message if changes are appliedCole Robinson2017-03-061-3/+5
|
* Remove minor redundancy in action_remove_device()David H. Gutteridge2017-02-161-1/+1
| | | | There's no need to call util.listify() twice.
* Apparently -tt doesn't work with #!/usr/bin/env ...Cole Robinson2016-06-171-1/+1
|
* Use #!/usr/bin/env for python scriptsCole Robinson2016-06-171-1/+1
| | | | | | | | | This is recommended for upstream, but not for downstream, like Fedora. So change /usr/bin/env to /usr/bin/python2 at RPM install time to match the ideal Fedora config. https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython https://bugzilla.redhat.com/show_bug.cgi?id=1303282