Commit Graph

261 Commits

Author SHA1 Message Date
Cole Robinson
76334bfabd guest: Add DomainCapabilities caching 2018-10-04 12:30:14 -04:00
Cole Robinson
b51104ad22 guest: Tweak error with invalid --os-variant
Try to point people in the right direction if they specify an
unknown distro name on the cli, like was reported here:

https://bugzilla.redhat.com/show_bug.cgi?id=1576473
2018-10-03 19:32:09 -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
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
b19f94299b details: Add OS name view/edit, + oslist rework
This is just a big nasty commit.

Turn the OS inspection page into an always available page that
shows the libosinfo name from the domain metadata XML. Use oslist.py
and have it absorb more of the common behavior needed by create.py
and details.py. Add UI tests for it all
2018-09-30 20:55:32 -04:00
Cole Robinson
a741f595ea guest: Drop update_defaults
Fold its one purpose into the UEFI setting bits, fix it and test it
2018-09-13 15:59:27 -04:00
Cole Robinson
d7ff46f7f5 guest: Encode the cli --os-variant in the XML
And add some testdriver examples of it
2018-09-13 15:11:22 -04:00
Cole Robinson
86ef998023 guest: Lookup osinfo object from libosinfo metadata XML 2018-09-13 15:03:36 -04:00
Cole Robinson
bad5eabd93 domain: Add metadata.libosinfo
From the libosinfo discussion here:
https://www.redhat.com/archives/libosinfo/2018-September/msg00003.html

This is a cross-app schema for tracking libosinfo OS ID in the
domain <metadata> XML. Example:

   <metadata>
     <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
       <libosinfo:os id="http://fedoraproject.org/fedora/17"/>
     </libosinfo:libosinfo>
   </metadata>
2018-09-13 12:39:56 -04:00
Cole Robinson
6063538750 guest: Replace os_variant with set_os_name
And have callers directly access osinfo.name if they need it
2018-09-12 17:24:28 -04:00
Cole Robinson
2549e60698 guest: Add an entry point for setting machine=q35 default
We will want this at some point, but it's dependent on libosinfo
work
2018-09-12 15:35:49 -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
e903d374c2 guest: Always encode machine= in XML
Don't rely on libvirt's default. This makes any XML changes more
explicit, and can help other parts of the code that may depend on
a machine type being encoded
2018-09-12 12:16:47 -04:00
Cole Robinson
ec69ae44b6 capabilities: Drop build_virtinst_guest
Same as lookup_virtinst_guest
2018-09-06 20:54:59 -04:00
Cole Robinson
1c05db691d guest: Cache capsinfo
Don't repeatedly look it up, was slowing down the test suite by about 5%
2018-09-06 20:38:59 -04:00
Cole Robinson
e61f2b991b guest: Re-organize function locations 2018-09-06 20:12:49 -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
242844fefa osdict: Make the broken uefi+hyperv bit more explicit
And add links to the relevant bug reports
2018-09-04 14:55:40 -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
852d7b564d virtinst: Remove name field validate_cb usage
Either openly do this at callers, or wrap it in a validate() call.
Doing this at set time has always had issues, like the self.replace hack
2018-09-04 14:55:04 -04:00
Cole Robinson
2ac54ac001 guest: Drop self.installer and start_install wrapper
This changes all the callers to invoke start_install directly on the
Installer object. We still stash the installer instance inside the
guest object in create.py, just for simplicity
2018-09-04 14:55:04 -04:00
Cole Robinson
c154bbacd4 guest: Fold add_default_devices into set_defaults
It doesn't have any need anymore to be separate
2018-09-04 14:55:04 -04:00
Cole Robinson
f1bbc5f67a guest: move set_install_defaults to installer class
It's only called explicitly in one place, so update the caller
2018-09-04 14:55:04 -04:00
Cole Robinson
8a6a491306 guest: Drop self.autostart and self.replace
Require callers to pass autostart as an argument to start_install
self.replace isn't even used for guest installs
2018-09-04 14:55:04 -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
fdbb1f9e5a installer: Absorb all guest start_install handling
Really it makes more conceptual sense that the Installer class
should handle start_install and friends, but that's difficult
because the layering is all mixed up.

Start to untangle it by moving all those routines to the Installer
class and adding wrapper APIs to Guest to maintain compat for now.
2018-09-04 14:55:04 -04:00
Cole Robinson
1abbdfc551 installer: Drop isinstall parameter
Separate the install from postinstall config case more clearly,
so the installer is only ever altering bits for the install-time
case, and Guest handles actually writing postinstall bits
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
4e7652b548 domain: cpu: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
cf65bef6f5 domain: clock: add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
d5bff2c987 guest: Remove default_cb usage
This lets us simplify things in create.py a bit, since we don't
need to manually encode a UUID
2018-09-04 14:55:04 -04:00
Cole Robinson
e6219504ce domain: os: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
c1443f8a80 guest: Remove fallback xen loader/emulator handling
This has been provided by libvirt caps for a long time, and we
don't even test it
2018-09-04 14:55:04 -04:00
Cole Robinson
468f5e67fa domain: pm: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
5517033c79 domain: seclabel: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
9a5b903086 domain: features: Add set_defaults
And move all the Guest logic there.

We need to add an xmlbuilder helper _prop_is_unset to be able to
determine if a bool property is unset, in our quest to remove
default_* xmlbuilder bits
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
7b5f1a304d guest: Publicize _os_object as osinfo 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
698c72e60d devices: sound: Add set_defaults 2018-09-04 14:55:04 -04:00
Cole Robinson
40de2c4762 guest: For implied devices, explicitly call set_defaults
These can be added after we initially call set_defaults on all devices,
so require a manual set_defaults call
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
d25ce81439 guest: Force qxl/vga more often
Letting libvirt choose gives us cirrus, which is really bad.
So for x86 for it more
2018-09-04 14:55:04 -04:00
Cole Robinson
fdd1cc5ca8 guest: Make spice default device additions explicit
Don't lump it in with setting video 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
Cole Robinson
c3515fa469 guest: Drop multifunction address magic
Seems sufficiently obscure that if someone is manually specifying
addresses we can require them to pass multifunction as well
2018-09-04 14:55:04 -04:00
Cole Robinson
d5638eb140 osdict: Make qemu_ga support solely dependent on virtio-serial support
We shouldn't concern ourselves with whether the OS supports qemu_ga
out of the box, just set up the channel regardless, as long as
virtio-serial is supported.

This adds the channel for some aarch64 cases which didn't have OS
specified, but that's desired IMO
2018-09-01 13:23:01 -04:00
Cole Robinson
8a87c91888 osdict: Move default_netmodel logic to Guest
Make the entry point just return a list of libosinfo device names,
and have Guest choose the preference. This is more future proof
2018-09-01 13:23:01 -04:00
Cole Robinson
b902fbd54f osdict: Move default_videomodel to guest
It's not really osdict specific
2018-09-01 13:23:01 -04:00