Commit Graph

243 Commits

Author SHA1 Message Date
Cole Robinson
6f95ebc7fd devices: controller: Add get_attached_devices
Move the opencoded impl out of virt-manager details.py and into
virtinst, since this is entirely about XML comparison. Add tests for
it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 13:08:12 -05:00
Cole Robinson
ec580f82a2 tests: Cover Guest.find_device and Device.compare_device
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 07:38:53 -05:00
Cole Robinson
3e5d530fce devices: interface: add coverage for new bridge changes
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-27 07:00:29 -05:00
Cole Robinson
8ed9eef905 netlist: Use same default policy as virt-install
virt-manager's logic is hard to follow, and gives weird results
by just choosing the first bridge device it finds more or less.

Use virt-install's logic: bridge if it is the default route,
otherwise network 'default' if it exists

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
869eb2dc8f devices: interface: Cache default bridge lookup for process lifetime
Saves us possibly hammering the logs if this goes wrong. We are
about to start using it more in virt-manager

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
9a72df3128 devices: interface: Rework default_source functions slightly
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-26 11:39:34 -05:00
Cole Robinson
b3ea89f218 virtinst: device: Remove set_addrstr()
There's only one user now, in cli.py. Open code it there

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson
2367e70efa virtManager: Remove magic spapr-* device handling
We have lots of spapr-* pretty printing and some magic handling
spread around the codebase. These devices have fallen out of favor
and are rarely used, so drop the special handling

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-25 14:30:07 -05:00
Cole Robinson
cdbc3f56e6 cli: kill --graphics keymap=local, and hostkeymap module
Removing this was discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

This is the old default, where we would try to determine a static
keymap value from host graphics config files, and set that in the
XML.

We haven't defaulted to this for a long time, setting a static keymap
is suboptimal generally, and the file parsing code is not up to date
for modern host config. So let's remove it

The hostkeymap module is now unused, so remove it and all the custom
testing for it.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Cole Robinson
7251ea25c2 virtManager: Remove graphics keymap UI
Removing this was discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

For a decade, qemu and xen and virt-manager work together to
make setting a manual keymap redundant. Advertising it in the UI does
more harm than good, because users may think they need to specify
one when in the vast majority of cases it will give worse behavior.

With the XML editing UI, users still have a way to do this by hand
if they really know what they are doing.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-24 17:04:29 -05:00
Cole Robinson
ec50dbd15d devices: disk: Ensure abspath when checking search permissions
Reported-by: Junqin Zhou <juzhou@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-01-18 15:27:01 -05:00
Pavel Hrdina
39366c37f6 controller: don't set default controller index
Libvirt is able to figure this out and it will make usage of the CLI
options more user-friendly.

For example if users wants to add a new pcie-root-port to existing VM
they have to figure out the latest controller index and call it like
this:

    virt-xml \
        --add-device \
        --controller pci,model=pcie-root-port,index=$nextIndex \
        $VM

After this change it will be simply:

    virt-xml \
        --add-device \
        --controller pci,model=pcie-root-port \
        $VM

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
2019-12-04 12:38:28 +01:00
Fabiano Fidêncio
8f4c53ea96 video: Prefer "bochs" when it's supported.
Preferring "bochs" display device is the way to go when dealing with a
Linux guest using UEFI and that's quite well described here:
https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

https://bugzilla.redhat.com/show_bug.cgi?id=1753644

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-10-04 11:17:10 -04:00
Cole Robinson
651e5b6d75 devices: video: Simplify model hvm check
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-10-03 15:41:44 -04:00
Cole Robinson
0eb571f9e1 cli: Add --tpm backend.encryption.secret=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-09-04 08:29:58 -04:00
Cole Robinson
1f0c262051 cli: Add --controller driver.iothread
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-08-28 13:17:32 -04:00
Cole Robinson
cee3f6b48e cli: Add --disk driver.iothread
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2019-08-28 12:43:56 -04:00
Cole Robinson
b8074b4505 storage: Replace volume supports_property with supports_format
Helps to make usage more explicit
2019-07-03 19:37:01 -04:00
Cole Robinson
f107e39989 Switch to more traditional logging structure
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
2019-06-17 00:12:31 -04:00
Cole Robinson
52f0b1c91e devices: disk: Handle unset source_protocol
This can't happen with libvirt processed XML, but could
be triggered via virt-install command line.

https://bugzilla.redhat.com/show_bug.cgi?id=1482636
2019-06-16 11:01:47 -04:00
Cole Robinson
c52e220504 devices: disk: Handle pool=iscsi-direct volumes
I don't have a working setup for this so I'm not positive
it actually works, but this roughly matches what I see in
libvirt test suite data and docs

https://bugzilla.redhat.com/show_bug.cgi?id=1658511
2019-06-14 20:35:41 -04:00
Cole Robinson
a5f4033493 details: add xmleditor UI
Handling this is a bit different from other bits, because:

1) the <device> editing paradigm is unique. We need to replace the
   device in line in the XML which is a new operation
2) the New VM customize pattern is tricky and needs lots of
   special handling
2019-06-13 07:15:46 -04:00
Cole Robinson
c33eb562c2 devices: graphics: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson
b0b3ba4e1c devices: interface: Test remaining code coverage 2019-06-11 17:51:25 -04:00
Cole Robinson
f056798918 virtinst: Add a bunch of # pragma: no cover 2019-06-11 17:51:25 -04:00
Cole Robinson
361657ad15 virtinst: Add a lot of test code coverage
* Delete dead code
* Add tests for various device default code paths
* Rework certain conditions a bit so code coverage always hits them
2019-06-09 18:59:50 -04:00
Cole Robinson
b5a664bd1b virtinst: move UI only functions into virtManager
These throw off code coverage testing. They are mostly:

* pretty* device helpers
* network + snapshot validation + creation routines
2019-06-09 18:33:45 -04:00
Cole Robinson
f01a534cfb tests: Use testsuirebr0 as the fake bridge name
It's more obvious in the output than 'eth0'
2019-06-08 09:24:33 -04:00
Cole Robinson
b97003ddfc interface: Get more unittest coverage of _default_* 2019-06-08 09:24:25 -04:00
Cole Robinson
388850f04e virtinst: Rename util to xmlutil
The only functions left in there are largely for xml handling, so
make it explicit
2019-06-07 18:21:24 -04:00
Cole Robinson
c603ea4084 util: Move *_meter to progress.py 2019-06-07 17:32:51 -04:00
Cole Robinson
f85e6def55 support: Convert callers to the new format 2019-06-07 16:26:03 -04:00
Cole Robinson
281e796538 connection: Use weakref.proxy instead of weakref.ref
Works more like expected, let's us drop a hack in devicedisk
2019-06-07 15:53:36 -04:00
Cole Robinson
f4f8cfb33b util: Remove validate_macaddr
Libvirt does this for us
2019-06-06 18:11:01 -04:00
Cole Robinson
ab0c99057b nodedev: Fold DRMDevice into NodeDevice 2019-06-05 16:35:34 -04:00
Cole Robinson
bc232eb8de devices: disk: Drop DIR+floppy validation
Libvirt already gives us a similar warning at parse time, this is
obscure enough that we don't need to catch it upfront
2019-06-05 11:13:33 -04:00
Cole Robinson
08b26e9b1c devices: disk: Add tests for missing _storage_backend 2019-06-05 11:13:33 -04:00
Athina Plaskasoviti
304b323f5d cli: Fix add --memballoon stats.period
XML Mapping

<memballoon model=...>
  <stats period="10"/>
</memballoon>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-29 14:03:14 -04:00
Athina Plaskasoviti
5b443fd383 cli: Fix --memballoon autodeflate
Fixing commit ebf2199875

XML Mapping:

<memballoon model="virtio" autodeflate="on"/>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-28 17:32:58 +02:00
Athina Plaskasoviti
ebf2199875 cli: Add --memballoon autodeflate
XML Mapping:

<memballoon model=...>
  <autodeflate>on</autodeflate>
</memballoon>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-23 10:03:27 -04:00
Athina Plaskasoviti
35c53fc02c cli: Add --disk rawio
XML mapping:

<disk type=... rawio="yes">
...
</disk>

Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-05-20 15:32:04 +02:00
Athina Plaskasoviti
d171489f7d cli: Add --disk wwn
XML mapping:

<disk>
  <wwn>...</wwn>
</disk>

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@gmail.com>
2019-05-17 15:29:18 -04:00
Cole Robinson
6394ab7f9a cli: --graphics: Add zlib.compression=
This maps --graphics zlib.compression=auto to the XML:

  <graphics>
    <zlib compression='auto'/>
  </graphics>
2019-05-16 10:21:19 -04:00
Cole Robinson
2b613d2ef5 tests: clitest: Cover all --rng options and aliases 2019-05-15 17:34:01 -04:00
Cole Robinson
9d3ad1ed56 cli: --disk: Convert source.host.* to source.host[0-9]*.
There can be multiple hosts specified. We already have this wired
up in the XML handling, just need to expose it on the command line
2019-05-15 09:47:53 -04:00
Cole Robinson
c31443a810 cli: Add driver.ats= and driver.iommu for virtio devices
This is shared XML schema used by multiple devices that support virtio
2019-05-14 12:45:57 -04:00
Cole Robinson
2344de6f38 cli: device: Add boot.loadparm= 2019-05-14 12:33:07 -04:00
Cole Robinson
0eb2b167f9 cli: device: Add address.zpci.uid and address.zpci.fid 2019-05-14 12:20:53 -04:00
Cole Robinson
ca0f9e18cc cli: Add --serial target.model.name=
This maps to XML like:

  <serial>
    <target>
      <model name='X'/>
    </target>
  </serial>
2019-05-14 11:57:50 -04:00
Cole Robinson
f3fd6d200b cli: --smartcard: support database= and certificate[0-9]*=
For mode=host-certificates config
2019-05-14 11:57:50 -04:00
Cole Robinson
c85bb61559 devices: char: Wire up seclabels in CharSource
And expose the config options on the command line for all CharSource
users
2019-05-14 11:57:50 -04:00
Cole Robinson
569533b187 devices: Add DeviceSeclabel
Hoist it out of DeviceDisk, so we can eventually share it with
CharSource as well
2019-05-14 11:57:50 -04:00
Cole Robinson
873a35dcee devices: char: move 'protocol' and 'log*' to CharSource
This violates our typical XML hierarchy, but that's how it's modeled
internally in libvirt, and these properties are shared among all
charsource users.
2019-05-14 11:57:50 -04:00
Cole Robinson
43a39dc158 devices: smartcard: Use CharSource
smartcard does the same internally for libvirt, so let's follow that
pattern, and fix the fallout
2019-05-14 11:57:50 -04:00
Cole Robinson
9d78759ac5 devices: redirdev: Use CharSource
redirdev does the same internally for libvirt, so let's follow that
pattern, and fix the fallout
2019-05-14 11:57:50 -04:00
Cole Robinson
6d46e37e09 devices: rng: Use CharSource
Re-use CharSource, just like libvirt does internally. Adjust all
callers to match. Rename type -> backend_model while we are here,
because type is ambiguous
2019-05-14 11:57:50 -04:00
Cole Robinson
b2b9d7d366 devices: char: Add CharSource
Move all ./source handling into CharSource, which will be reused by
other device classes as well. This requires us to add ../ handling
into our xmlapi xpath engine
2019-05-14 11:57:50 -04:00
Cole Robinson
1b3e8e1a32 addhardware: Remove supports_property usage
It's not a pattern I think is worth extending in the future, and
make internal refactorings more difficult. Drop it, and drop it
from tpm and char devices since it is now unused
2019-05-13 14:06:32 -04:00
Cole Robinson
e11ed3ce77 devices: char: Remove uncalled supports_property values 2019-05-13 13:43:25 -04:00
Cole Robinson
1bf970627e devices: tpm: Drop unnecessary defaults setting
Libvirt does the same for these two values, so don't bother duplicating
2019-05-13 13:43:25 -04:00
Cole Robinson
0ec251dae4 devices: char: Drop default 'protocol' setting
In the cases we were doing this, libvirt already defaults to raw for us
2019-05-13 13:06:46 -04:00
Cole Robinson
68b4236262 devices: rng: Remove unused function supports_property 2019-05-13 13:01:18 -04:00
Cole Robinson
ba1764943b devices: char: drop tty fallback reading
This is only for ancient rhel5 era libvirt, We don't need it anymore
and it complicates XML handling
2019-05-13 12:36:17 -04:00
Cole Robinson
e6eb1d447b devices: char: Rename some properties to better match XML
* bind_port -> bind_service
* source_host -> connect_host
* source_port -> connect_service
2019-05-13 12:35:55 -04:00
Cole Robinson
8e1cdf2cd7 cli: --controller: use predictable cli subarg names
To match the XML schema, rename these subarguments and add aliases
to preserve compatibility:

* driver_queues -> driver.queues
* master -> master.startport
2019-05-12 18:21:49 -04:00
Cole Robinson
3c57b13322 devices: panic: drop DeviceAddress wrapper opts
Just use regular address handling to represent 'type' and 'iobase'.
Add address handling to the command line
2019-05-12 17:25:47 -04:00
Andrea Bolognani
1e3de807a6 video: RISC-V virt guests support virtio-gpu
QXL, on the other hand, is still x86-only for some reason.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-04-04 18:57:39 -04:00
Cole Robinson
091dae5d65 Fix a couple new pylint warnings 2019-04-01 16:18:00 -04:00
Jim Fehlig
8d9743d69f virt-install: Add support for xenbus controller
libvirt commit 09eb1ae0 added support for a new 'xenbus' controller
type. Add support for the controller in virtinst, including support
for the maxGrantFrames attribute.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2019-03-21 14:15:40 -04:00
Vasudeva Kamath
648115334d virt-install: Add driver_queues argument to --controller
<controller> can have additional <driver> sub element with queues as property,
which is currently not exposed via virt-install. This commit exposes this option
similar to queues in network configuration.

(crobinso: add test case)
2019-03-12 10:17:06 -04:00
Cole Robinson
18e60c5e47 devices: disk: drop dead s390 check
The scsi check above will always trigger for s390, so this path won't
ever be hit
2019-03-08 11:40:08 -05:00
Cole Robinson
32034c6847 Revert "devices: disk: Use virtio-scsi for CDROMs where supported"
This reverts commit a746150bef.

See discussion:
https://www.redhat.com/archives/virt-tools-list/2019-March/msg00058.html

Apparently some debian versions struggle with this. Let's stick with
the old method until there's a sufficiently compelling reason to change

Some adjustment is required to deal with changes added by later patches
2019-03-08 11:39:20 -05:00
Andrea Bolognani
db6c7070e2 devices: disk: Don't prefer virtio-scsi for aarch64/virt
Back when this was introduced in 2014 (commit aa772f01e1) using
virtio-scsi instead of virtio-blk made sense, because virtio-pci
support on aarch64/virt was still not widely available and
virtio-mmio couldn't do hotplug.

These days, however, virtio-pci availability is something that
we can assume is present on any remotely reasonable deployment
target, so it's better to no longer behave differently than
other architectures.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Andrea Bolognani
a746150bef devices: disk: Use virtio-scsi for CDROMs where supported
We already use virtio-blk for regular disks whenever possible,
and there's no good reason not to do the same with virtio-scsi
when dealing with CDROMs instead of artificially limiting its
use to s390x and ppc64/pseries guests.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-03-06 14:00:11 -05:00
Pavel Hrdina
a0b42327c6 graphics: move all listen code into one place
Instead of duplicating the code into CLI and GUI move it into graphics
device file which is used from both places.  This also fixes a bug in
virt-xml where changing listen to address was not working.

This also changes behavior to always configure one listen type when
using CLI listen option or GUI.  If user wants to modify only specific
listen type they can use listens[] options from CLI.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1565968

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-02-28 11:48:09 +01:00
Cole Robinson
fb5aadc636 guest: Move compare_device to Device class
It operates on a Device object, so it makes sense
2019-02-07 17:42:55 -05:00
Cole Robinson
ea99784d27 interface: Make network/bridge/source_dev public
The convenient 'source' abstraction is not sufficient in all cases,
like is using type=network with a forward mode=bridge network: on
startup, the qemu driver will change the runtime XML to type=bridge
but still list a source network= and bridge= value.
2019-02-04 17:35:47 -05:00
Cole Robinson
9b2e6886d0 disk: Fix virt-xml --add-device --disk size=X 2019-01-22 10:32:23 -05:00
Slavomir Kaslev
63db4de0b5 Remove Author lines from files
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-15 13:55:53 -05:00
Cole Robinson
2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00
Slavomir Kaslev
be1b5e6ebb virtinst: Add vsock device type
VSOCK sockets allow communication between virtual machines and the host they are
running on.

This patch adds vsock device support along with clitest for the new properties.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-06 18:04:26 -05:00
Cole Robinson
b91393e6c3 cli: s390x+graphics specified, use video=virtio (bz #1654994)
s390x doesn't support any of the PCI graphics cards

https://bugzilla.redhat.com/show_bug.cgi?id=1654994
2018-12-13 16:39:43 -05:00
Cole Robinson
e05f74c2f0 devices: disk: Fix path search changing
Accessed the wrong variable name
2018-10-12 13:49:53 -04:00
Jim Fehlig
5a7698c799 Fix selection of network volumes
When creating a new VM and selecting a volume from a network-based
storage pool such as rbd, the volume is not recognized as network-based
and is treated as a volume from a directory storage pool.

This patch adds a method to check if the volume's path points to a
network-based volume, then uses the method to avoid actions like
setting unix file permissions on the volume, which doesn't make
sense for a network-based volume.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>

(crobinso: rebase, tweak lookup logic)
2018-10-12 13:49:53 -04:00
Cole Robinson
d36aa7fbaf device: disk: Move last host touching to diskbackend
This just conceptually makes more sense to keep it all in
one file, and DeviceDisk is the API for the rest of the code
to deal with any host storage state
2018-10-11 19:20:46 -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
Cole Robinson
fb1e63c100 devices: disk: remove dead code 2018-10-11 18:00:10 -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
e6738d9827 cliconfig: Remove --default-qemu-user
Libvirt has given us this info in capabilities for a long time,
this shouldn't matter anymore
2018-10-06 12:30:59 -04:00
Cole Robinson
210cb858bc controller: usb: Use ports=15 for usb3
It's the max that qemu supports, so why not add as many as possible.
Gerd indicated in private mail that he didn't know of any issues
with it.
2018-10-04 11:55:57 -04:00
Cole Robinson
046a242bd4 guest: Use USB3 for x86 qemu if OS supports it
Using new annotations in osinfo-db
2018-10-03 19:02:07 -04:00
Cole Robinson
97ea737386 devices: interface: Have x86 fallback model be e1000
libvirt will use rtl8139, but the qemu default changed a while
ago to e1000, and libvirt has diverged. e1000 is more modern and
considered the better default here, so use it
2018-09-29 14:35:28 -04:00
Cole Robinson
a754718889 devices: disk: Use uppercase naming for mode lists 2018-09-06 16:51:14 -04:00
Cole Robinson
63287c83fb addhardware: Move disk bus listing to virtinst
Drop the stable_default stuff as domcaps usage should make
it obsolete for any cases we care about
2018-09-06 16:40:49 -04:00
Cole Robinson
a09a46289a addhardware: Move controller list logic to virtinst
And tweak the UI defaults a bit, preferring virtio-scsi and
usb3
2018-09-06 16:05:12 -04:00
Cole Robinson
7994dc90c8 addhardware: Move video model list to virtinst
And make it smart about the hypervisor
2018-09-06 14:45:05 -04:00
Cole Robinson
b3865d7b0d addhardware: Drop tcp/udp/dev char support
I know openstack uses tcp consoles but for end users I've never
really heard about it. RHEL compiles out udp as well. I'm fine telling
users to go to the cli and use virt-xml for this use case.

Use this opportunity to drop a lot of code that only simplified the
case when there are tons of char options we need to consider
2018-09-06 13:28:21 -04:00
Cole Robinson
cd07d6af34 sound: Track recommended models in virtinst
Change addhardware to show an editable model entry, like the
details wizard
2018-09-06 13:28:21 -04:00
Cole Robinson
be1f5a6e25 devices: Remove a bunch of unused static lists 2018-09-06 13:28:21 -04:00
Cole Robinson
4394eff9fa xmlbuilder: Drop last usages of set_converter
Unfold most of them into manual property() wrappers. It's a bit
noisier but the logic is easier to follow.
2018-09-04 14:55:04 -04:00
Cole Robinson
bd35f4711c devices: disk: Rename setup() to build_storage()
It's more explicit. Plus drop the supposedly generic setup()
entry point, storage is handled specially everywhere so it's
not a generic interface
2018-09-04 14:55:04 -04:00
Cole Robinson
ebd6091cc8 devices: interface: Simplify is_conflict_net calls
We don't return a non-fatal error these days, so adjust all callers
to only handle failure
2018-09-04 14:55:04 -04:00
Cole Robinson
c27cdc67de devices: interface: Convert setup() to validate()
That's all it's doing. Fold in mac validation while we are here
2018-09-04 14:55:04 -04:00
Cole Robinson
43f40950eb devices: Remove some redundant char/rng xml callbacks
I think these aren't needed after the default fixing stuff, or maybe
past xmlbuilder fixes
2018-09-04 14:55:04 -04:00
Cole Robinson
221dd00cb9 devices: disk: remove default_cb usage 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
640a068650 devices: controller: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
6215f790f5 devices: filesystem: Add set_defaults
Requires a bit of rework in virt-manager handling, which had lots
of explicit "default" handling
2018-09-04 14:55:04 -04:00
Cole Robinson
ef83565e48 devices: hostdev: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
0f918a4bd5 addhw: Move interface model list to virtinst
So we are keeping the default and model list logic closer together,
as its similar
2018-09-04 14:55:04 -04:00
Cole Robinson
64dc334538 devices: interface: Add set_default function
Move all the Guest network default logic to it, and drop a now
redundant test
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
35c0cf352f guest: Move graphics defaults handling to DeviceGraphics 2018-09-04 14:55:04 -04:00
Cole Robinson
e29980959c devices: tpm: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
221edf7d86 devices: char: Remove default_cb in favor of add_defaults 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
31d74ff0eb devices: input: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
698c72e60d devices: sound: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
1b0f325813 devices: video: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
7738b8f407 devices: panic: Add set_defaults
Move default handling out of Guest and default_cb callbacks, and
make implement it in a standard set_defaults function
2018-09-04 14:55:04 -04:00
Povilas Kanapickas
e6c7e46a54 details: Add support for disk detect zeroes option 2018-09-04 11:39:50 -04:00
Cole Robinson
2b41e130d8 connection: rename fetch_all_guests->fetch_all_domains
The virtinst class is erroneously called Guest, but these
functions are dealing with libvirt <domain> XML, so rename them
2018-08-31 16:50:46 -04:00
Lin Ma
4484f473cd char: Track/Show the state of virtio channels in channel details
crobinso: Add a test case

Signed-off-by: Lin Ma <lma@suse.com>
2018-07-12 15:25:23 -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
Marc-André Lureau
67cb191e82 tpm: add CRB device model
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-06-11 12:40:28 -04:00
Marc-André Lureau
c04733c10d addhardware: learn to choose a TPM model
There is only one for now, but we are adding CRB next (and SPAPR is
being added too in qemu/libvirt).

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
Daniel P. Berrangé
b1460ba065 Chagne most URIs to use https:// instead of http://
All URLs were checked to see if they supported https://, those which did
were converted.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-30 13:35:39 -04:00
Cole Robinson
056305d29b addhardware: Make combo init/populating more consistent
* Use the _build_combo helper more
* Un-static methods that don't need it
* Use pretty labels more
2018-04-25 08:04:50 -04:00
Cole Robinson
fd2fe1249d graphics: Default to unset keymap
qemu and all related hypervisors (xen, vz) haven't needed this in
the common case for a very long time, so make keymap=None the default
2018-04-24 14:11:30 -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
7fb1ddbc18 virtinst: s/_XML_ROOT_NAME/XML_NAME/g
No reason for it to be privatized, could be useful in some cases
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
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