Commit Graph

2235 Commits

Author SHA1 Message Date
Roman Bogorodskiy
6c7080a39b virtinst: bhyve: properly configure loader
Bhyve requires explicit loader configuration. So query
domain capabilities, try to find the "official"
firmware and configure all the necessary loader options.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2021-02-15 13:27:48 -05:00
Roman Bogorodskiy
dab099d413 virtinst: prefer SATA bus for bhyve
Choose SATA as a default bus for bhyve as it doesn't support IDE.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2021-02-15 13:27:48 -05:00
Roman Bogorodskiy
143c6befc3 virtinst: fix error message format string
Fix a regression introduced by commit 71f034d6b where
format string expects kwarg "domain", but "vm" is passed instead.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
2021-02-10 10:26:23 -05:00
Cole Robinson
d3c627f189 volumeupload: Use 1MiB read size
Rather than 1K. This drastically speeds up the volumeupload case
for a local URI for the cost of some higher runtime memory but
I think that's worth it

Fixes: #221

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-02-03 14:15:57 -05:00
Cole Robinson
56cb813d42 cli: Add --tpm persistent_state=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:54:54 -05:00
Cole Robinson
2862f1be98 cli: Add --memballoon freePageReporting=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:49:55 -05:00
Cole Robinson
5c1ace02c9 cli: Add --sound audio.id=
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:48:09 -05:00
Cole Robinson
d3517ded62 cli: Add --filesystem fmode, dmode
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:46:47 -05:00
Martin Pitt
4d0e323227 virtinst: Fix TOCTOU in domain enumeration
Similar to commit 49a01b5482, _fetch_all_domains_raw() has a race
condition where a domain may disappear (from parallel libvirt
operations) in between enumerating and inspecting the objects.

Ignore these missing domains instead of crashing.

https://bugzilla.redhat.com/show_bug.cgi?id=1901081
2020-12-01 13:56:30 -05:00
Igor Ryzhov
ac9316cce1 virtinst: add support for controller target subelement
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-21 14:47:22 -05:00
Cole Robinson
ddc55c8ba5 hostdev: Log XML of the source nodedev device
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 18:17:32 -05:00
Cole Robinson
cd788e9303 Prep for release 3.2.0
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 16:15:22 -05:00
Cole Robinson
488f153655 fsdetails: Rework XML building logic
Make it work more like gfxdetails. The problem with the current
approach is that it requires effectively rebuilding the whole device
to match the original device when we want to edit a single field,
which is error prone.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-14 16:09:21 -05:00
Cole Robinson
41023192ca fsdetails: Stop showing the 'driver' combo for qemu
The only valid value now is 'path' which is also the default,
so drop the UI

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:17:41 -05:00
Cole Robinson
b7b75ab8fc fsdetails: Drop driver="handle" UI
It was removed in qemu 4.0.0

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 13:09:03 -05:00
Cole Robinson
374ea52be0 fsdetails: Remove wrpolicy UI
This is an obscure setting. If users need it they can set
it manually in the XML editor

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-13 12:20:57 -05:00
Cole Robinson
4cfb3aeff1 cloner: more detailed error messages about supported network vols
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
6a6c1c13d7 diskbackend: Fix volume lookup for existing rbd disk
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson
c4f5812290 device: disk: Group related functions
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 18:07:50 -05:00
Cole Robinson
b3ff59c75c device: disk: Move <source> XML handling to its own class
Makes DeviceDisk less complicated, helps with readability

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 18:07:50 -05:00
Cole Robinson
d9c6df951f installer: Remove cloudinit media after initial boot
We do this by faking an install phase whenever cloudinit media is
specified, which isn't really the right abstraction and will leak
into virt-install behavior (like doing 2 boots), but it's the simplest
fix for now

Fixes: #178

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-10 12:04:25 -05:00
Cole Robinson
b132820244 devices: disk: Skip check_path_search for path=""
virt-manager can trigger this when ejecting cdrom media

Fixes: #180

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-10 12:04:25 -05:00
Martin Pitt
49a01b5482 virtinst: Fix TOCTOU in pool and volume enumeration
_fetch_all_pools_raw() and _fetch_vols_raw() have a race condition where
a pool/volume may disappear (from parallel libvirt operations) in
between enumerating and inspecting the objects.

_fetch_vols_raw() already expected that failure in the loop, but not for
the initial storagePoolLookupByName() call.

Also tighten the expected exception: This *should* crash on errors like
AttributeError or SystemExit, just not on dynamic libvirt errors. (Bare
exceptions are highly frowned upon in Python)

https://bugzilla.redhat.com/show_bug.cgi?id=1894359
2020-11-08 17:01:40 -05:00
emojifreak
04ad8df752 Added Debian's armv7l UEFI binary. Closes #174 2020-11-03 13:49:27 -05:00
Cole Robinson
f4dc418e66 virtclone: Only print/log 'clone successful' if we actually clone
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-03 13:15:47 -05:00
Cole Robinson
8988572776 virtclone: Drop --print-xml special --auto-clone behavior
For unclear reasons we allowed --print-xml without --file or
--auto-clone, like is required for a traditional clone, which
can lead to some weird behavior.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-03 13:03:22 -05:00
Cole Robinson
1a1e4580c0 cloner: Explicitly reject 'network' disks we don't know how to clone
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-03 13:03:03 -05:00
Martin Pitt
7cb6a6062a virtinst: Fix TOCTOU race in user scratch dir creation
When starting many virt-install processes in parallel, some often crash
with

    ERROR    [Errno 17] File exists: '/home/kstest/.cache/virt-manager/boot'

Fix that by ignoring existing directories instead of explicitly testing
for existence.

The `exist_ok` parameter exists since Python 3.2, and the minimum
supported version is 3.4 now.
2020-11-03 11:52:46 -05:00
Cole Robinson
d0650aa48f osdict: Handle possible conflicting os named 'generic'
It's not impossible osinfo-db adds a 'generic' OS of its own, in
which case we will start misbehaving. Rework the way we implement
our synthetic 'generic' OS internally, using a stub Libosinfo.Os()

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-10-21 18:49:11 -04:00
Cole Robinson
b17914591a Prep for release 3.1.0 2020-09-30 18:06:22 -04:00
Cole Robinson
f7bd274a55 domcaps: Fix error if enum not found
https://bugzilla.redhat.com/show_bug.cgi?id=1883008

In the example above this is because the VM XML has an invalid machine
type, so domcaps fetching entirely fails, and a get_enum() call
then fails. But this could happen if using virt-manager against an
older libvirt that doesn't advertise the enum

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-28 13:44:34 -04:00
Cole Robinson
9c13d2f878 Remove use of problematic terminology
Following kernel recommendation here:
https://lkml.org/lkml/2020/7/4/229

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-23 14:33:17 -04:00
Cole Robinson
5c1f4b2386 virtinst: storage: gluster pools don't support volume creation
Drop code that implies they do

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-20 16:44:24 -04:00
Cole Robinson
a010c49b8b cli: Fix --os-variant=help introspection
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-20 16:00:46 -04:00
Cole Robinson
0ac9ff3488 tests: Drop a bunch of redundant xmlparse/xmlconfig tests
For the few bits we are hitting specific code paths, break them
out or fold them into other test cases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:46:08 -04:00
Cole Robinson
1b93c17564 cli: Add --controller vectors=X
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-19 13:45:07 -04:00
Pino Toscano
748bb7d774 i18n: fix string puzzles in capabilities lookup error msgs
Create complete sentences with all the details available; there are not
many combinations, so this makes it possible to properly translate them.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Pino Toscano
adeabb6e40 i18n: use plural forms where needed
In particular, when the number of objects depends on a variable.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Pino Toscano
fb8a31ba76 i18n: translate UI messages
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Pino Toscano
76593f8a08 virtinst: use fail_conflicting
Make use of the new helper for showing a standard error message for two
conflicting cli options. This also catches one untranslatable message.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Pino Toscano
8501206cb3 cli: add fail helper for 2 conflicting cli options
It will avoid repeating the same message in different places.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Pino Toscano
924d766112 i18n: fix string puzzles in virt-xml hotplug/hotunplug/update
Do not use the action string (which is an identifer) as replaced
placeholder in messages for device hotplug/hotunplug/update.
Instead, use complete strings for all the actions, and also for all the
usages (confirmation message, success message, error message).

Since the action is the same for all the devices, create the messages
outside the iteration to avoid translating them more than once.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-09-17 15:38:42 -04:00
Cole Robinson
c7ce770170 Prep for release 3.0.0 2020-09-15 17:14:00 -04:00
Cole Robinson
9fdbccec2b Fix pylint raise-missing-from
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-15 12:36:27 -04:00
Cole Robinson
a242894182 cli: Add --os-variant require=on|off
If specified, this errors if no OS name was detected or manually set.
So --os-variant detect=on,require=on will error if no OS is detected.

name= can be used as a fallback, so test and document this case

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 20:36:12 -04:00
Cole Robinson
17f47a44c5 cli: --os-variant: add explicit suboptions
This adds the following --os-variant suboptions

* name=, short-id=
* id=
* detect=on|off

Functionally this does not change behavior, just adds explicit
sub options for behavior we already support

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 20:15:20 -04:00
Cole Robinson
67703ec7a5 cli: Add --osinfo as alternate name for --os-variant
The --os-variant option naming is pretty crappy and mostly a historical
artifact. Ideally this would be named just `--os` but I'm afraid that
would cause confusion with libvirt's <os> XML

Add --osinfo as an alternate commandline naming. If we ever want to
transition documented use of --os-variant it will help to have the
alternative around for a few releases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-14 18:12:41 -04:00
Cole Robinson
428948a690 cli: Add disk type=nvme source properties
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 09:58:39 -04:00
Cole Robinson
ffc48af4ee cli: Add --disk source.file, source.dir, source.dev
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-13 09:58:39 -04:00