Commit Graph

1904 Commits

Author SHA1 Message Date
Cole Robinson fbe388b26a virt-install: Warn if mem less than OS recommended
And if mem is abnormally low, like it appears user tried to specify
GiB not MiB
2019-06-14 11:24:10 -04:00
Cole Robinson c37d6a7260 installer: Log warning when we set network-install resources
So the cli user will see it
2019-06-13 22:01:02 -04:00
Cole Robinson 34f42cc673 installer: Make test suite override paths a bit more descriptive
Have them incorporate the basename of the path we are replacing.
This gives some validation that we are manipulating the correct files
2019-06-13 21:53:41 -04:00
Cole Robinson 17ac0d017c virt-install: Drop --os-variant suboption parsing
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
2019-06-13 21:25:05 -04:00
Cole Robinson 21723706f5 virt-install: Add --install OSNAME
Replace the unreleased --os-variant OSNAME,install=location with just

  --install OSNAME

Unwind the --unattended dependency on upfront --os-variant while
we are at it, since they are all intertwined. Now we can just do:

  virt-install --install OSNAME
and
  virt-install --install OSNAME --unattended
2019-06-13 20:26:26 -04:00
Cole Robinson ee119c3bb2 guest: Add skip_default_osinfo
We set this to True in virt-install, which will cause an explicit
error to be thrown if some part of the cli parser tries to access
osinfo before it's been set, because then we have a circular dependency
between cli config -> installer -> osinfo -> cli config
2019-06-13 18:29:39 -04:00
Cole Robinson d9729855ee guest: break out disable_hyperv_for_uefi
Having this at set_uefi time complicates the domain XML building
machinery, where we don't want things to have osinfo access.
Rearrange it so that editing cases call this explicitly, and
the XML builder just deals with it at the set_defaults time
2019-06-13 17:55:37 -04:00
Cole Robinson 8c8fec6cb1 cli: Rename parse_option_strings update= to editing=
Makes it more clear what the distinction is. Set this in the parser
class so the cli infrastructure can access it
2019-06-13 17:37:26 -04:00
Cole Robinson f36e8b36bc virt-install: Rework install option detection a bit
Add an explicit no_install to Installer to encode that the user is
not expecting an install phase. Use that to determine later if any
install options were specified. This saves later code from having
to deal with installer=None, and is the basis for further clarifications
2019-06-13 16:36:21 -04:00
Cole Robinson 5077f97000 guest: Add a comment about the vcpu situation 2019-06-13 14:42:37 -04:00
Cole Robinson 7ef20e26b0 Revert "guest: Don't hardcode vcpus = 1"
This reverts commit 66fe00ddee.

Turns out it's not that simple. Indeed libvirt sets the default
when no <vcpus> XML is present, but if you do --vcpus cpuset=X
libvirt will error that there's no vcpu value set. So for back
compat and generate safety let's keep setting it.
2019-06-13 14:40:06 -04:00
Cole Robinson 1e8f2413d7 unattended: Move the windows method=cdrom logic into installer
And warn about it. This isn't triggerable at the moment due to
virt-install hackery but that will change
2019-06-13 14:00:04 -04:00
Cole Robinson a9d33d49db osdict: Add testing and finish of code coverage 2019-06-13 14:00:04 -04:00
Cole Robinson 19bcec651c virt-install: Push validation down into the installer
It's hard to validate whether something like --extra-args or
--initrd-inject is supported based on the command line arguments. It's
easier to let the installer.py figure it out because it's the
authoritative source
2019-06-13 14:00:04 -04:00
Cole Robinson 9cbe5f9742 virt-install: Move --install kernel/initrd handling to installtreemedia
This essentially gives us kernel upload, http access, and initrd inject
for free, and ensures that the source file is kept in pristine shape
2019-06-13 14:00:04 -04:00
Cole Robinson b746d919a9 virt-install: Add --install kernel_args=X,kernel_args_overwrite=yes|no
--install kernel_args=X acts like --extra-args. If
kernel_args_overwrite=yes is also specified, it overwrites whatever
default kernel args we would have used for the install method.
2019-06-13 14:00:04 -04:00
Cole Robinson b50ecd2bf1 installer: Move location_* conflict validation to treemedia
That's where the values are handled, so move it there
2019-06-13 14:00:04 -04:00
Cole Robinson d85a9a4808 cli: Advertise --boot cmdline, that's the XML naming 2019-06-13 14:00:04 -04:00
Cole Robinson 216b1f2a2d installer: Reject --unattended method=cdrom on remote connection
It's not wired up yet
2019-06-13 14:00:04 -04:00
Cole Robinson 69c20d5256 installer: install_{kernel,initrd} imply an install phase 2019-06-13 14:00:04 -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 18af72212b xmleditor: Add the shared code
The XML editor ui is a two tabbed notebook, one 'Details' tab
and one 'XML' tab. The latter has a gtksourceview and allows editing
the raw libvirt XML for whatever the selected object is.

API users will programmatically insert the xmleditor notebook into
their UI, with the existing UI under the details tab.
2019-06-13 07:13:43 -04:00
Andrea Bolognani c88e492331 guest: Enable qemu-ga by default on s390x
It was disabled with commit 2aca20141e back in 2015, but
these days we have it enabled for all other architectures and
there doesn't seem to be a good reason for s390x to keep being
the outlier.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2019-06-13 09:16:45 +02:00
Cole Robinson 1f4a5a1b43 cli: Add --install bootdev=X,kernel=X,initrd=Z
This is the beginning of a big --install option, which will be used
for tweaking less common elements of the install process
2019-06-11 17:55:09 -04:00
Cole Robinson a4a577bd23 tests: Finish off installer and kernelupload coverage 2019-06-11 17:55:09 -04:00
Cole Robinson de90716eb4 unattended: Choose a default profile name if none specified
We default to 'desktop' if none specified, otherwise we choose the
first alphabetical profile available. Make bare '--unattended' a
valid option
2019-06-11 17:55:09 -04:00
Cole Robinson ecb60c3062 Drop use of logging.info
Just use logging.debug in these random places
2019-06-11 17:55:09 -04:00
Cole Robinson 034d112181 unattended: Finish off code coverage testing 2019-06-11 17:55:09 -04:00
Cole Robinson 13b3790829 virt-install: Print when we set default memory and disk
Since we never defaulted here before, print out the values we are
setting. Users can see right away if they actually want those values
or not.
2019-06-11 17:55:09 -04:00
Cole Robinson b3e6ebe28b virt-install: Generate default --name
This uses the same logic as virt-manager. The name is mostly
derived from --os-variant naming, but we have fallback defaults too.

Print the name to stdout so users are informed about what we are
doing.
2019-06-11 17:55:05 -04:00
Cole Robinson 078348fbbf create: move generate_name to Guest
This will be used by virt-install.
Tweak the logic a bit to not have 'generic' in the name
2019-06-11 17:54:45 -04:00
Cole Robinson 387614c641 generatename: Move libvirt collision handling to callers
Make every caller pass an explicit cb that handles libvirt
collision processing. Makes it easier to see exactly what is going
on at the call impls
2019-06-11 17:54:45 -04:00
Cole Robinson 4cdf2e4a78 generatename: Remove collidelist
Fold it in to the callback of the single remaining user
2019-06-11 17:54:45 -04:00
Cole Robinson 47a6f3a6d5 storage: Handle guest collision checking
This pattern is already used in two places. Formalize and centralize
it
2019-06-11 17:54:45 -04:00
Cole Robinson 6e6a0b8a6a connection: Use shared default pool lookup logic
It wasn't abiding a different pool name pointing to our default
path
2019-06-11 17:54:45 -04:00
Cole Robinson 088657a2b8 storage: Kill get_default_dir
The last location is in virt-convert, which has weird local directory
creation semantics. Just have it use storage APIs like we do
everywhere else
2019-06-11 17:54:45 -04:00
Cole Robinson e27202d178 createpool: Use StoragePool.default_target_path
Indirectly, rather than the less useful get_default_dir
2019-06-11 17:54:45 -04:00
Cole Robinson 8bfa04c230 storage: Split apart build_default_pool, and document it 2019-06-11 17:54:45 -04:00
Cole Robinson 66fe00ddee guest: Don't hardcode vcpus = 1
libvirt has set this as the default forever, we don't need to set it
2019-06-11 17:54:42 -04:00
Cole Robinson 17d157820f guest: move libosinfo resource setting to virt-install
This puts all the default resource setting in one place, and the
only place that was depending on it, as virt-manager explicitly sets
the values on its own. This will be used in future patches to add
more default setup and report the values to the user
2019-06-11 17:51:25 -04:00
Cole Robinson db4d348950 domain: cpu: Rework vcpus setting slightly
Move it to Guest, where we have a more hollistic view of the issues.
This will be needed in later patches
2019-06-11 17:51:25 -04:00
Cole Robinson cc366fff7d cli: Add more code coverage 2019-06-11 17:51:25 -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 ffcf713e06 cli: Drop warnings about video accel3d
Libvirt has provided explicit errors here for a while
2019-06-11 17:51:25 -04:00
Cole Robinson 203c0d4a6c virt-install: Call install.get_search_paths
Similar to what we do via create.py
2019-06-11 17:51:25 -04:00
Cole Robinson b7465fdcf8 installertreemedia: Move url() to is_network_url()
And then have callers just access location. It's more clear IMO
2019-06-11 17:51:25 -04:00
Cole Robinson 59f1eabf27 installtreemedia: Simplify unattended kernel_args logic
Let unattended kernel args take precedence, we implicitly require
a new enough osinfo-db that provides the info we need
2019-06-11 17:51:25 -04:00
Cole Robinson 66ffafe148 urldetect: Drop old mandriva URL support
Mandriva hasn't existed since 2011. Drop references to it
2019-06-11 17:51:25 -04:00