Commit Graph

253 Commits

Author SHA1 Message Date
Fabiano Fidêncio d5af67d077 installer: add support for windows unattended install
The Windows unattended installation is quite similar to the Linux one
with a few major differences:
- It uses floppy injection instead of initrd injection
  - Yes, it does. Then we have to create a floppy, add the device and,
    when finishing the installation, remove the device;
- There's no InstallerTreeMedia in the game making us end up duplicating
  some code in the Installer class as:
  - keeping track of files that have to be cleanup up;
  - actually cleaning up the files;
  - generating the install script

Apart from that, some obvious differences in the scripts where already
done in a previous commit, but those were basically:
- Not using /dev/*da as a target disk, but use "C" instead;
- Set the product-key
- Explicitly set the injection method as "floppy"

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-04-01 16:28:52 -04:00
Christian Borntraeger 5bc847ebb0 virt-install: Do not warn about consoles on s390x
s390x guests usually detect the sclp or virtio console. The current
warning might actually break setups. Let us disable the warning.

Reported-by: Andre Wild <wild1@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-03-14 18:21:51 +01:00
Fabiano Fidêncio d97b528710 virt-install: Deal with "--cdrom" unattended installations
When dealing with unattended installation, we safely can assume that
"--cdrom" can be treated as "--location". The reason for that is that
we'll need to, under the hooks, extract its kernel/initrd and perform an
initrd injection.

This commit makes "--unattended" work properly when combined with
"--cdrom".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-08 17:11:38 -05:00
Cole Robinson 3a29b40af6 virt-install: Error earlier when --unattended is missing --os-variant 2019-03-05 16:38:22 -05:00
Fabiano Fidêncio 49e21723b3 virt-install: Make --unattended useful
--unattedend now can be used to perform tree based installations.

The way it's implemented, it takes advantage of the code we currently
have for setting --os-variant install="location|cdrom".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio a0aebf77e8 virt-install: --unattended conflicts with --initrd-inject and --extra-args
As --unattended will take care of generating the install script to be
inject in the initrd and also of the kernel command line to be used
during the installation, we should not mix whatever user is passing as
--initrd-inject or --extra-args when using --unattended.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Fabiano Fidêncio e8893f2178 virt-install: Add --unattended
--unattended is currently a no-op parameter that will be used to perform
unattended installations.

For now, if someone tries to use --unattended virt-install will fail as
the option is still not supported.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-03-05 16:38:22 -05:00
Cole Robinson d48ea2f5ff virt-install: Explicitly fail on bad os-variant install=X 2019-02-18 11:17:57 -05:00
Cole Robinson 8139b3839e osdict: Raise exception on get_location failure
It's better to error immediately if we know this won't work
2019-02-18 10:56:38 -05:00
Fabiano Fidêncio 5f7d49d6a3 virt-install: Deal with os-variant's install param
As os-variant has a new "install" parameter that can be passed, let's
take advantage of it and automatically fill options.location with data
from osinfo-db whenever install=location is passed (and, of course,
osinfo-db has the information).

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-14 13:33:48 -05:00
Fabiano Fidêncio e103aab7cc virt-install: Set options.disk if the value comes from osinfo-db
Commit 45ab922b2c moved the code to the way it was before the libosinfo
default changes. However, by not setting "options.disk" the parser will
error out and bail the installation as this option must be set. Only
parsing the disk doesn't seem to be enough as the check is actually done
against "options.disk".

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-02-14 13:33:48 -05:00
Cole Robinson 4a2ff83b51 cli: Parameterize --os-variant
For now it just takes a single name= parameter that maps to
the current behavior
2019-02-07 16:27:01 -05:00
Cole Robinson 1ad1c2acd1 virt-install: Drop --os-variant tolower()
This could break some command line invocations, but there's no
guarantee libosinfo might not add capitalized IDs in the future,
and there's an easy workaround to just lowercase the passed value
2019-02-07 16:05:12 -05:00
Cole Robinson a9eecd591c cli: Rename options.distro_variant to options.os_variant
We don't really use the 'distro' naming any more, and the
command line option is called os_variant, so stick with that
2019-02-07 15:48:40 -05:00
Cole Robinson ada5b49d3b virt-install: Remove remote URL error
This is for very old libvirt versions. Just let it fail later on
2019-02-07 15:22:48 -05:00
Cole Robinson 91cdb485cb virt-install: Drop xenpv install warnings
These may still be relevant, but I think it's fine just to let
the config fail to install. I'm not even sure if anyone is trying
xenpv these days...
2019-02-07 15:13:30 -05:00
Cole Robinson a5e01c947d virt-install: set_install_defaults before disk validation
So we validate the CDROM disk contents too. This revealed we were
using a cdrom path in the test driver that was assigned as a
writeable disk to another test VM, which is a correct warning, so
fix the fallout, and ensure that we don't warn when colliding with
another cdrom device
2019-02-07 15:00:27 -05:00
Cole Robinson 45ab922b2c virt-install: Parse option strings before installer creation
This is how it was before the libosinfo defaults changes. In general
this pattern is more sensible: we serialize all the Guest data, then
create the installer which acts on a Guest, then fill in any missing
config with libosinfo bits.

We need to manually parse a disk option string now which is a bit funky
2019-02-07 14:51:28 -05:00
Cole Robinson 0afe0c1797 virt-install: Break out set_resources_from_osinfo 2019-02-07 14:38:32 -05:00
Cole Robinson 951aba41b9 virt-install: Split apart set_distro_variant
There's two cases: for an explicitly requested --os-variant, we
want to set it ASAP, since more things will depend on it in the
future, like grabbing install media from libosinfo. For the
'auto' case, we need to wait until the installer is setup.
2019-02-07 14:30:00 -05:00
Cole Robinson 6e4b4a5cba virt-install: Simplify convert_old_os_options 2019-02-07 14:09:37 -05:00
Cole Robinson 921a604abe virt-install; Don't add os-variant storage for containers 2019-02-03 15:46:32 -05:00
Cole Robinson 39bb8968d0 virt-install: add --location LOCATION,kernel=X,initrd=X
Add kernel= and initrd= --location suboptions. These can be
used to override the default kernel/initrd and specify new
paths, relative to LOCATION.

For example, if you have an ISO that libosinfo doesn't know
about called my-unknown.iso, with a kernel at 'kernel/fookernel'
and initrd at +'kernel/fooinitrd', you can make this work with:

--location my-unknown.iso,kernel=kernel/fookernel,initrd=kernel/fooinitrd
2019-02-03 12:05:18 -05:00
Cole Robinson 137be83232 cli: Use VirtCLIParser for --location
No-op change for now, just adds a default subopt location=. But
more subopts will be added in the future
2019-02-03 12:05:18 -05:00
Cole Robinson c20e78926b installer: Drop check_location
detect_distro does it all already nowadays, so there's no
real reason to have a separate entry point.
2019-02-03 12:05:18 -05:00
Cole Robinson 6c28f53590 cli; Share --os-variant option registering
And improve the help message for both users
2019-01-08 12:44:53 -05:00
Fabiano Fidêncio 050acb68f1 virt-install: Default to libosnfo recommended disk size
If no disk options are passed, let's fallback to the libosinfo
recommended disk size for the OS variant.

The guest.set_capabilities_default(), build_installer() and the set of
the distro variant have been moved earlier in the code in order to fetch
the correct information from libosinfo and then set the recommended disk
size without changing much of build_guest_instance() logic.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2019-01-07 12:24:06 +01:00
Lin Ma f6076a0eb0 virt-install: Add auto complete support for the general options
With this patchset, the general options completion is available. ex:

$ virt-install -<TAB><TAB>
...
--arch      --check     --cpu       --dry-run   -h
--autostart --clock     --cputune   --events    --help
...

$ virt-install --a<TAB><TAB>
--arch       --autostart

Signed-off-by: Lin Ma <lma@suse.com>
2018-12-18 11:20:35 -05:00
Andrea Bolognani 751fb88c58 virt-install: Add "Guest OS" options group
The --os-variant option doesn't quite fit perfectly into
its current "Installation method" group, plus we want to
add the same option to virt-xml which can't have that
group for obvious reasons.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-12 16:15:33 +01:00
Andrea Bolognani a550a95727 virt-install: Fix description for --os-variant
Since we're messing with it either way, might as well use
modern OS names as examples.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-11-12 16:15:33 +01:00
Cole Robinson e212ce84e6 installer: extraargs -> extra_args
Better matches what's on the command line
2018-10-13 16:29:32 -04:00
Cole Robinson 0cbb420347 virt-install: Limit --os-variant warning to kvm+x86
As that's really all that libosinfo defaults presently matter for
2018-10-13 12:55:34 -04:00
Cole Robinson 2482e57a15 create: Fix customize boot page
Installer reworks dropped the guest.autostart flag, need to add
it back. Add Uitest for it
2018-10-13 09:46:06 -04:00
Cole Robinson 11d1cbdf06 installer: DistroInstaller -> InstallerTreeMedia
Now we have only one Installer class, and callers don't need to
worry about choosing a particular class type depending on their
needs, just pass cdrom vs. location to the installer init and
we figure out everything behind the scenes.

Besides simplifying the callers this makes the control flow a
lot easier to follow whether looking at InstallerTreeMedia or
Installer classes
2018-10-13 09:42:11 -04:00
Cole Robinson 4f320c2b98 distroinstaller: Remove implied cdrom installs
This is an obscure feature that I'm skeptical anyone is relying on,
and has weirdly subtle semantics that are hard to test.
2018-10-12 15:33:05 -04:00
Cole Robinson 286dbf6d51 installer: Fold PXEInstaller into base Installer class
PXEInstaller is really just 'boot off bootdev=network' which is
easy enough to model without a separate class
2018-10-12 15:15:20 -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 96ac896e1a cli: Remove redundant argparse dest= options 2018-10-11 12:53:03 -04:00
Cole Robinson 3e55e89453 tests: Add better virt-install console testing 2018-10-11 12:19:48 -04:00
Cole Robinson 63b4d1f154 virt-install: Encode guest defaults earlier
We need this for determining correct console tool to launch,
and probably other checks later
2018-10-11 12:19:09 -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 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 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 4e30161f44 guest: Absorb UEFI default setup
Rather than force callers to deal with it
2018-09-12 14:02:23 -04:00
Cole Robinson a2fa799478 capabilities: Drop lookup_virtinst_guest
Users should just init Guest() directly, and call
set_capabilities_defaults if they need default arch data
2018-09-06 20:28:05 -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 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 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 068c8aedd2 installer: Remove ContainerInstaller and ImportInstaller
Fold their non-logic into the base Installer class
2018-09-04 14:55:04 -04:00
Cole Robinson 0293fa492c virt-install: Centralize installer building and validation
The ordering was strange here and forced us to duplicate checks
for cli validation
2018-09-04 14:55:04 -04:00
Cole Robinson 256ca7f3fb virt-install: Simplify install method validation a bit
And drop the --pxe --nonetwork collision check, it's near pointless
2018-09-04 14:55:04 -04:00
Cole Robinson f9600ca31b virt-install: Remove smm validation and q35 default setting
The validation is already handled by libvirt, and setting q35 for
smm=on is overkill and just hardcoding some libvirt logic here.
I think the 'secboot' detection in Guest.py is the preferred
magic here, otherwise let users specify all the correct values.
2018-08-21 15:39:27 -04:00
Cole Robinson eb0f4a612f virt-install: Support armv7l and i686 uefi 2018-08-08 15:14:21 -04:00
Cole Robinson 7a2abb5abf installer: Remove --location nfs support
Removal was discussed here:
https://www.redhat.com/archives/virt-tools-list/2018-May/msg00011.html

Basically I don't think many people use this, the feature is very
inflexible, it's hard to test, and users can essentially do it
themselves with a bit more effort.
2018-06-12 14:07:50 -04:00
Cole Robinson b6cd46b382 virt-install: Add --test-stub-command
Fills in basic install options to make the command succeed. Saves
devs having to type boiler plate options when testing new command
line bits
2018-06-12 14:07:50 -04:00
Cole Robinson 876c79cc15 virt-install: Simplify checking for install options 2018-06-12 14:07:50 -04:00
Cole Robinson bac3ea74ec virt-install: Do all option compat conversions earlier
Prevents more mistakes like usage of old options when building the
Guest instance
2018-06-07 10:56:47 -04:00
Cole Robinson b85a2a9eb8 virt-install: Drop --import and --nodisks collision
It doesn't work with '--disk none' and it's not very useful anyways
2018-06-07 10:56:47 -04:00
Cole Robinson b65a144db1 virt-install: Drop unused graphics default override 2018-06-07 10:56:47 -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
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 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 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
Cole Robinson e70eb82db1 virt-install: Remove redundant isActive check 2018-02-22 20:49:07 -05:00
Cole Robinson ddba9c1702 Switch to python3 in script shebang
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-02-06 18:56:15 -05:00
Chen Hanxiao b44aa0e3bb pycodestyle: fix all E131 warnings
Fix all E131:
     Continuation line unaligned for hanging indent

   Also remove ignore options of E131

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-26 20:03:21 +08:00
Chen Hanxiao c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Radostin Stoyanov b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Cole Robinson 4e7a6ad728 tests: pylint: Silence/fix a bunch of new warnings 2017-06-16 12:54:56 -04:00
Pavel Hrdina f38c56c971 virt-install: add support for SMM feature
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Brian 'Redbeard' Harrington c30cdb0ccf virtinst: Fix os-variant ordering
Previously os-variant was not being set before performing location
checks.  This lead to a sitation where the os-variant data could not be
acted on.  This commit re-orders the process to ensure that the correct
ordering happens.

Previous behavior:

```
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (distroinstaller:180) DistroInstaller location is a network source.
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (distroinstaller:181) Sanitized value is https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:57) Using scratchdir=/home/bharrington/.cache/virt-manager/boot
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:477) Finding distro store for location=https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:484) Using os-variant=generic
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:486) Supplying urldistro=None
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:186) HTTP hasFile request failed: 404 Client Error: Not Found for url: https://example.com/repo/rhel/7/rhel-7-server-rpms/Fedora
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:145) hasFile(https://example.com/repo/rhel/7/rhel-7-server-rpms/Fedora) returning False
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:1114) No treearch found in uri, defaulting to arch=i386
...
```

Current behavior:
```
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (distroinstaller:180) DistroInstaller location is a network source.
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (guest:250) Setting Guest.os_variant to 'rhel7.3'
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (urlfetcher:57) Using scratchdir=/home/bharrington/.cache/virt-manager/boot
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (urlfetcher:477) Finding distro store for location=https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 13:20:38 virt-install 22335] DEBUG (urlfetcher:499) Prioritizing distro store=<class 'virtinst.urlfetcher.RHELDistro'>
```
2017-05-16 17:16:55 -04:00
Cole Robinson a90d675394 Switch deprecating log.warn to log.warning
Same semantics, but the alias is deprecated
2017-05-05 14:53:28 -04:00
Cole Robinson 62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Pavel Hrdina f07a3021d9 virt-install: fix --wait=0 to behave like --noautoconsole
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1371781

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-01-18 13:11:43 +01:00
Cole Robinson 7962672c71 virt-install: Fix error checking extra_args
Later bits in the code that want to warn based on extra_args content
don't handle the None case. Be consistent and convert it to a list
everywhere.

Mentioned at https://bugzilla.redhat.com/show_bug.cgi?id=1376547#c9
2016-11-02 10:27:14 -04:00
Cole Robinson 118bf85cba Apparently -tt doesn't work with #!/usr/bin/env ... 2016-06-17 16:38:57 -04:00
Cole Robinson 47dd38eb3e Use #!/usr/bin/env for python scripts
This is recommended for upstream, but not for downstream, like Fedora.
So change /usr/bin/env to /usr/bin/python2 at RPM install time to
match the ideal Fedora config.

https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
https://bugzilla.redhat.com/show_bug.cgi?id=1303282
2016-06-17 12:56:14 -04:00
Richard W.M. Jones 246e3c9c59 virtinst: Add --transient flag.
If this flag is specified, --import|--boot will create a transient
libvirt domain, ie. one which goes away when the guest shuts down or
the host is rebooted.

(crobinso: some tweaks and tests)
2016-06-17 12:20:24 -04:00
Cole Robinson f2d2630f45 virt-install: Uncontionally use domain.isActive()
It's been around for seven years, and even RHEL5 has it... I don't think
we need to work around platforms that don't have support for it.

Use this as an opportunity to simplify the surrounding code
2016-06-17 12:20:24 -04:00
Cole Robinson 81231530e5 tests: Add virt-install --wait test, and tweak the logic a bit 2016-06-17 12:13:21 -04:00
Cole Robinson 116fabb37a virt-install: Access domain in place via guest.domain
And stop returning the domain object from Guest.start_install, it's
redundant
2016-06-17 12:13:21 -04:00
Cole Robinson 59edd87e9f guest: Rename noboot -> doboot
It's a bit easier to follow the logic IMO
2016-06-17 12:13:21 -04:00
Cole Robinson 9f297eda5b virtinst: guest: drop 'continue_install' concept
continue_install is intended to facilitate windows XP style 3 stage
installs:

  stage 1: initial dos style disk setup, reboot
  stage 2: actual full installer, reboot
  stage 3: OS is functional, virt-install is done

The code assumed that we needed to keep the cdrom as the primary
boot device for the second stage, so virt-install/virt-manager needed
to hang around through the second stage run, wait until the VM shutdown,
then encode the final XML to boot of the disk.

Windows is and always has been smart enough to handle that case though...
after the initial boot, if we set the hd as the primary boot device
for stage 2, the disk bits that windows already installed will make
use of the cdrom as necessary. So the entire premise of continue_install
is irrelevant. Maybe back when it was added, when xen didn't even have
working ACPI support, this served a purpose, but I'm pretty sure we
can safely drop it nowadays.
2016-06-17 07:52:42 -04:00
Cole Robinson 984b368725 cli: Rework VirtCLIParser instantiation
Only initialize VirtCLIParser at actual parse time. The data that's
passed to __init__ is the particular data for that parse task, like
the option string, and the Guest object we are editing.

As a result we can drop the whole parsermap handling, since the
parserlist is immutable.

There's a bunch of other reworks mixed in like dropping the
VirtOptionString abstraction...
2016-06-14 10:51:50 -04:00
Cole Robinson f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Cole Robinson f99be58ab1 virt-install: Fix warning about missing --os-variant
We always at least have os_variant == "generic" now
2016-04-07 17:36:53 -04:00
Cole Robinson 22022d95dc virt-install: Don't show old --ram option in --help (bz 1321663) 2016-04-07 15:52:07 -04:00
Cole Robinson d3b9fcf3de Fix some pylint 2016-03-24 16:04:06 -04:00
Pavel Hrdina 4c3e7969c6 virt-install: concatenate all extra-args argument
So far we used only the last --extra-args argument from virt-install
command line, but it makes more sense to use all occurrences of
--extra-args and pass them to kernel.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-03-18 03:28:17 +01:00
Pavel Hrdina 3bca4e7fcb Revert "virt-install: fix condition that detect if console is present"
This reverts commit 588c2d4481.

Actually it was correct before this patch.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-11 22:07:53 +01:00
Pavel Hrdina 588c2d4481 virt-install: fix condition that detect if console is present
Function get_devices() always returns a list, if there is no requested
device the list is empty.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-11 21:25:50 +01:00
Pavel Hrdina ef14f04226 virt-install: warn user about missing console while installing on arm
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-11 21:23:19 +01:00
Pavel Hrdina 0e26031096 virt-install: don't report missing console in extra-args for ppc64
Kernel for ppc64 automatically enables serial console, there is no need
to report any warning.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-09 19:57:30 +01:00
Cole Robinson 601a82cb87 virt-install: Simplify --extra-args text install warnings
- Drop the warnings about incorrect console=, that's a little too fine
  grained and was really only about virtio-console default confusion
  which doesn't apply anymore
- Skip the check for xenpv which seems to always 'just work'
- Drop the opencoded arm check, use is_arm
- Fix an error when xen HVM is used (reported on virt-tools-list)
2015-09-22 12:44:33 -04:00
Cole Robinson b217c199bc virt-install: Remove obsolete hack 2015-09-06 14:27:37 -04:00
Cole Robinson 1237be9d1a virt-install: Clean up created disk images if VM creation fails
We are conservative here, only cleaning up disk images if libvirt
fails to even accept the XML. Otherwise the VM may already be
running or defined, and the user has to do some cleanup anyways.
2015-09-06 14:27:37 -04:00
Pavel Hrdina aebebbf879 virt-install: report an error for pxe install without network
Fix a regression where we used to report an error message if user
specified pxe installation without any network (--nonetworks or
--network none).

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-08-06 14:56:30 +02:00