Commit Graph

372 Commits

Author SHA1 Message Date
Cole Robinson
b68656329d tests: Add argcomplete testing 2018-12-18 15:39:08 -05:00
Lin Ma
2d38e22943 cli: Add auto complete support about sub options
With this patchset, the sub options completion is available. ex:

$ virt-install --disk <TAB><TAB>
...
bus=    cache=      format=     path=   serial=     size=
...

$ virt-install --disk path=test.qcow2,cache=none,<TAB><TAB>
...
bus=    format=     serial=     size=
...

$ virt-install --disk bu<TAB><TAB>
Then the sub option 'bus' will be auto completed with a '='
$ virt-install --disk bus=

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Lin Ma
d68f0f8867 cli: Add the generic completer function and validator function
The patch adds the generic completer and validator, Further patches use
them as completer/validator. The completer won't add already specified
options to the list.

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Cole Robinson
a8d4c7cb79 cli: Fix --security baselabel=X 2018-12-17 09:06:03 -05:00
Cole Robinson
6fb81aeb65 cli: Another searchdata.user fix 2018-10-12 18:34:42 -04:00
Cole Robinson
425f599c84 device: disk: Move all path search handling to diskbackend
Simplify it slightly by combining return output and removing
an entry point. Add some additional test cases for it
2018-10-11 19:11:16 -04:00
Lin Ma
eb1a67a595 cli: disk: Add options to support SCSI persistent reservation
Create the managed or the unmanaged PR object to enable SCSI persistent
reservation for LUN Passthrough

Signed-off-by: Lin Ma <lma@suse.com>
2018-10-11 16:00:28 -04:00
Cole Robinson
42a96cfd59 virt-install: add --destroy-on-exit
This makes the console window behave like a raw qemu command line:
when the user closes it, the VM is hard powered off.
2018-10-11 15:24:16 -04:00
Cole Robinson
3e55e89453 tests: Add better virt-install console testing 2018-10-11 12:19:48 -04:00
Yossi Ovadia
215d296b61 cli: add --boot rebootTimout
virt-install -n blah -r 1024 --vcpu=1 --disk=/root/vm/blah.qcow2,size=10\
 --network=bridge:br-public --pxe --boot=network,rebootTimeout=3

By default, in case of (first) pxe boot failure the VM will simply
stop trying.
By adding the above, VM will re-try pxe boot. ( useful when DHCP not
replys on first attempt.

Libvirt support it and VM XML will look as follow : ( 'bios rebootTimeout'
will be created under OS section. )

  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.5.0'>hvm</type>
    <boot dev='network'/>
    <bios rebootTimeout='3'/>
  </os>

(crobinso: fix it, add test case)
2018-10-11 11:24:07 -04:00
Cole Robinson
be628ad54f cli: Log openauth callback prompts 2018-10-08 09:15:06 -04:00
Cole Robinson
a4097b7691 cli: Merge multiple instances of single use opts
So --memory 123,maxmem=456 --memory 555 is equivalent to
--memory 555,maxmem=45
2018-10-05 13:23:20 -04:00
Cole Robinson
03439dd9a3 cli: Remove some --sysinfo examples
This is a sufficiently uncommon option, it doesn't need 5 examples
2018-10-04 20:52:32 -04:00
Cole Robinson
945c0125db cli: Remove VirtStreamHandler
This was needed at one point to make our logging not throw
exceptions when passed non-ascii text, like logging translated
errors. pretty sure python 3 and probably python2.7 fixed all
those issues, so lets drop it
2018-10-04 19:45:06 -04:00
Cole Robinson
9edca3486a virt-manager: Wire up support for default mode=host-model
Simplify things a long the way
2018-10-04 14:43:44 -04:00
Cole Robinson
35dd99f172 cli: Don't hardcode nec-xhci for --controller usb3
Use our helper function to choose the optimal model
2018-10-04 09:24:43 -04:00
Cole Robinson
c539f06eeb cli: Give better --controller examples
ich9-ehci1 isn't a recommended configuration
2018-10-03 18:52:33 -04:00
Marc-André Lureau
4ad74278ca cli: add memory backing access_mode & source_type
Allow to set some memory backing options, ex:
--memorybacking access_mode=shared,source_type=anonymous

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-10-02 11:12:13 -04:00
Cole Robinson
757910a1bb cli: Add --metadata os_name= and os_full_id=
Allows changing the libosinfo metadata for an existing vm via virt-xml
2018-09-30 20:55:32 -04:00
Cole Robinson
627bfabc32 pylint: Silence output on Fedora 29 2018-09-29 14:27:34 -04:00
Cole Robinson
4adb1c8c30 pycodestyle: fix W605 invalid escape sequence 2018-09-29 13:59:19 -04:00
Cole Robinson
4e30161f44 guest: Absorb UEFI default setup
Rather than force callers to deal with it
2018-09-12 14:02:23 -04:00
Cole Robinson
5f22f41da4 guest: Absorb capabilities defaults setup
Rather than forcing API users to go through the capabilities APIs.
This lets us simplify things in virt-install quite a bit, and is
needed for smarter machine type defaults
2018-09-06 20:12:49 -04:00
Cole Robinson
12a7a18be0 cli: Fix traceback detection 2018-09-06 18:39:14 -04:00
Cole Robinson
9e05c56397 guest: Drop self.domain
The only user is virt-install, make its usage explicit
2018-09-04 14:55:04 -04:00
Cole Robinson
fff3c88f9c devices: disk: Absorb Guest bus/target default setting
Simplifies cli stuff as a nice side effect
2018-09-04 14:55:04 -04:00
Cole Robinson
347143982a devices: Add set_defaults for memballon, redirdev, rng, smartcard 2018-09-04 14:55:04 -04:00
Cole Robinson
31bda5bbb6 devices: watchdog: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
fb1bb26373 support: Drop lots more checks
- Remove anything for less than qemu 0.12 or libvirt 0.10, basically
  rhel6 vintage stuff
- Open code some simple checks
- Remove some that are only used for unnecessary error reporting
2018-08-31 22:21:15 -04:00
Cole Robinson
8d45dba43d cli: Add --boot bootloader= 2018-08-22 07:38:34 -04:00
Lubomir Rintel
3a4cf07a28 virtinst: allow adding host block devices to LXC containers
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2018-06-19 15:07:45 -04:00
Lubomir Rintel
a2a022a879 virtinst: allow adding host character devices to LXC containers
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2018-06-19 15:07:42 -04:00
Lubomir Rintel
bba3d04558 virtinst: allow adding host network devices to LXC containers
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
2018-06-19 15:05:28 -04:00
Marc-André Lureau
fa32aea416 tpm: add TPM emulator backend
An emulated backend doesn't require any path, since libvirt will take
care of finding the emulator and managing the storage. However, the
version to emulate can be specified.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Anya Harter
846e2f711a cli: add --sound codec support
Add codec support to virt-install so that it can accommodate
multiple instances of codec configuration.

The commandline argument:

  --sound codec0.type=micro,codec1.type=duplex,codec2.type=output

maps to the sound XML below:

    <sound model="es1370">
      <codec type="micro"/>
      <codec type="duplex"/>
      <codec type="output"/>
    </sound>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:23:14 -04:00
Anya Harter
02635d3358 cli: Add --disk geometry attribute options
Attribute options are:
    - geometry.cyls=W
    - geometry.heads=X
    - geometry.secs=Y
    - geometry.trans=Z

This maps to disk XML like:

    <disk>
      <geometry cyls='W' heads='X' secs='Y' trans='Z'/>
    </disk>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:02:11 -04:00
Anya Harter
89c389e45a cli: Add --disk driver.copy_on_read=on option
This maps to disk XML like:

    <disk>
      <driver copy_on_read='on'/>
    </disk>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-11 12:00:56 -04:00
Anya Harter
8bde479112 cli: Add --network mtu.size=X option
This maps to interface XML like:

    <interface>
      <mtu size='X'/>
    </interface>

Signed-off-by: Anya Harter <aharter@redhat.com>
2018-06-06 10:44:03 -04:00
Stefan Weil
633534c8b8 Fix some typos in comments and documentation (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-06-05 14:27:29 -04:00
Cole Robinson
ffab20782f connection: Handle more openauth cred types
Like ECHOPROMPT which is needed for libssh hosts file management.
Sync the two implementations a bit
2018-05-03 06:16:28 -04:00
Cole Robinson
a33ac92040 cli: Fix --boot smbios_mode=sysinfo (bz 1570549)
Not sure how this was expected to work, just make it do the simple
thing and set the value in the XML. Add a test case for it
2018-04-24 12:32:18 -04:00
Daniel P. Berrangé
48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  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>
2018-04-04 16:51:37 -04:00
Cole Robinson
8d0b1f80f1 cli: Have parser classes reference property names, not xmlbuilders
propertys already give us ways to access the backing class, and
switching to this method lets us drop some infrastructure in
xmlbuilder
2018-03-21 11:17:36 -04:00
Cole Robinson
3b88bfb1ee cli: Drop clear_attr property
It slightly complicates the generic machinery, and the one usage we
can handle directly
2018-03-21 11:17:36 -04:00
Cole Robinson
f69b823fad devices: Switch to normal _XML_PROP_ORDER
Drop the register_device stuff, rename virtual_device_type
2018-03-21 11:17:36 -04:00
Cole Robinson
7b61c45d3b guest: Move all_devices to guest.devices.X
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
2018-03-21 11:17:36 -04:00
Cole Robinson
fe9ed2340c virtinst: move <domain> XML files to virtinst/domain
And give the classes consistent naming
2018-03-21 11:17:36 -04:00
Cole Robinson
b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson
3909c10441 virtinst: Move all devices to virtinst/devices/ 2018-03-21 07:29:40 -04:00
Cole Robinson
1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00