Commit Graph

127 Commits

Author SHA1 Message Date
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
Pavel Hrdina
0fbe8e7a1f translation: fix wrong usage of _() function
All the strings have to be at first translated and then we can fill the
formated and translated string.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-06-05 16:33:51 -04:00
Cole Robinson
93f826a8b2 cli: Replace add --check option (bz 1063471)
For fine grained enabling/disabling validation checks. Use this to
replace the heavy handed --force option.
2015-04-11 19:48:35 -04:00
Cole Robinson
9b21f27e31 cli: Maintain same --print-xml behavior for non virt-install
Don't want it scooping up any nargs
2015-04-07 19:58:28 -04:00
Cole Robinson
3d6831ec8f virt-install: Deprecate --print-step, just use --print-xml
argparse lets us handle this in a back compat fashion, so let's simplify
the CLI.
2015-04-04 17:10:45 -04:00
Cole Robinson
97259c4d9b capabilities: Store results of guest_lookup together
Simplifies API users lives to not have to remember whether caps guest
or caps domain contains a particular value.
2015-04-03 17:37:08 -04:00
Cole Robinson
2c9d2a2360 virt-install: Don't print virsh command if VM is running (bz 1180558) 2015-03-26 16:43:28 -04:00
Cole Robinson
c7c772b200 virt-install: Default to --boot uefi
Try to use --boot uefi if the user hasn't already specified loader params,
or a kernel to boot. If we can't determine a UEFI setup, just print a
warning.
2015-02-22 10:25:51 -05:00
Cole Robinson
09ef4583a0 virt-install: Also don't show console= warning for machvirt + --location 2014-11-21 13:57:30 -05:00
Cole Robinson
507af25258 virt-install: Don't warn about missing console= for machvirt
Since latest kernels figure it out automatically
2014-11-20 19:15:11 -05:00
Cole Robinson
c4162f6708 Use -M virt as default machine for arm/aarch64
Centralize the default machine logic in caps and use it consistently
2014-09-23 16:05:48 -04:00
Cole Robinson
64106230bd virt-install: Add hidden option --test-media-detection
Can help with debugging and test cases
2014-09-20 20:32:19 -04:00
Cole Robinson
99700821c6 virt-install: Reorder --help output a bit 2014-09-20 19:30:16 -04:00
Cole Robinson
d7e1a40352 virt-install: Deprecate --nodisks in favor of --disk none 2014-09-20 19:16:13 -04:00
Cole Robinson
57ae284ad4 virt-install: Deprecate --nonetworks in favor of --network none
Follows the pattern used by the other cli options
2014-09-20 19:02:38 -04:00
Cole Robinson
c26512926d virt-install: Default to --graphics even if DISPLAY is unset
This was a weird bit of logic that tries to be smart, but there isn't
a clear corrolation between DISPLAY being unset and whether the user
wants graphics or not.

Make the default consistent, some people may need to adjust to
--nographics
2014-09-20 18:52:20 -04:00
Cole Robinson
1f3f3fa4fc virt-install: If virt-viewer will fail, default to --wait -1
This can happen if user requests explicit --graphics, but they are on
a headless display. We had a few reports of this recently.
2014-09-20 18:28:43 -04:00
Cole Robinson
ca2ee52eb8 virtinst: cli: Move unshared bits to virt-install
Since virt-image is gone, this stuff should all be private to virt-install
2014-09-19 20:31:22 -04:00
Cole Robinson
8b20f68cd7 virt-install: Print warning if no OS detected or specified 2014-09-07 13:55:45 -04:00
Cole Robinson
c46459d6a6 virt-install: Improve warning with headless --cdrom 2014-09-07 13:51:15 -04:00
Cole Robinson
a8843e5807 virtinst: Remove redundant LiveCDInstaller
DistroInstaller can basically do the same thing. This also gives us distro
detection when using virt-install --livecd
2014-09-07 13:42:56 -04:00
Cole Robinson
a722eeac78 virt-install: Enable libosinfo detection for --cdrom
This streamlines virt-manager and virt-install implementations, requiring
installer.distro_detect to be called if we want distro detection. As
a side effect, we now get CDROM detection for free.
2014-09-07 12:20:26 -04:00
Richard W.M. Jones
283553060d arm: On arm the virtual console is PL011-based ttyAMA0.
Confusingly real ARM hardware can have either PC-like 8250 devices,
which the Linux kernel calls /dev/ttyS0, or ARM-only PL011-based
/dev/ttyAMA0.

qemu can emulate either, but the default for `-M virt' is the PL011
so /dev/ttyAMA0.

Change the warning message so it uses ttyAMA0 instead.
2014-08-05 13:32:45 +02:00
Chen Hanxiao
2f4a424521 use binary prefixes for units where appropriate
https://bugzilla.redhat.com/show_bug.cgi?id=1103893

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-16 11:56:53 +08:00
Cole Robinson
f397d96ca6 virt-install: Don't require install option with --print-xml (bz 1095789) 2014-05-11 19:19:00 -04:00
Cole Robinson
2de9e9cc52 virt-install: Remove needless error message redirection 2014-05-11 19:00:51 -04:00
Giuseppe Scrivano
bcb60f0fb1 virt-install: Drop support for --os-variant list
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:42 +01:00