Commit Graph

5105 Commits

Author SHA1 Message Date
Cole Robinson
40e0354631 guest: Fix multiple address.type=pci auto allocate requests
And test it for aarch64, which is the only place it's really
interesting at the moment
2016-06-17 17:17:49 -04:00
Cole Robinson
118bf85cba Apparently -tt doesn't work with #!/usr/bin/env ... 2016-06-17 16:38:57 -04:00
Cole Robinson
20c2d5b6ff delete: Don't offer to delete floppy media by default
Even if it's not marked readonly or shareable, floppy media is
very likely to be a shared resource and not something that belongs
to the VM that the user will want to delete by default.
2016-06-17 13:06:35 -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
0e8d4007cf tests: Add some virt-install autoconsole tests 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
b5d0b381ba guest: Rename start_xml -> install_xml
Make it more clear what the case is
2016-06-17 12:13:21 -04:00
Cole Robinson
837a9710a3 guest: Use newer named CreateXML API
CreateLinux is the very old style name. CreateXML has been around
since at least 2009, which covers our minimum libvirt-python version
2016-06-17 08:58:28 -04:00
Cole Robinson
48ba2883e5 virtinst: break out kernel/initrd vol upload to its own file 2016-06-17 07:52:42 -04:00
Cole Robinson
dbb057d095 virtinst: Move initrdinject handling to its own file 2016-06-17 07:52:42 -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
5398282e12 storage: Detect backing_store format automatically
By attempting to manage/import the passed path. This makes it
work via both virt-install and virt-manager

https://bugzilla.redhat.com/show_bug.cgi?id=1235406
2016-06-16 20:36:30 -04:00
Cole Robinson
8d4e58c501 cli: Add --disk backing_format= option 2016-06-16 20:09:37 -04:00
Cole Robinson
5cd1b57852 create: customize: Fix inadvertent disk removal on install fail
If the first install attempt fails, then the second attempt succeeds,
we were still removing the disk images we created as though the
install never succeeded. We need to clear out the cached failed_guest
value via the customize dialog callback

https://bugzilla.redhat.com/show_bug.cgi?id=1342043
2016-06-16 19:47:49 -04:00
Chen Hanxiao
6c82b9d184 tests: fix a testcase failure by --os-variant
Current libosinfo release on fedora23 and centos7
didn't know fedora23.
Change --os-variant fedora22 as a workaroud.

df1c3e74a introduce this issue.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2016-06-16 23:10:51 +08:00
Pavel Hrdina
0acdea1dad virtManager.details: show firmware options also for XEN guests 2016-06-16 12:16:53 +02:00
Pavel Hrdina
de9cd87fda virtinst.capabilities: return recommended machine for XEN
This is required in order to ask for correct domcapabilities.  If you don't
specify any machine libvirt will return domcapabilities for default machine
which is xenpv.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-16 12:16:49 +02:00
Pavel Hrdina
5ecc2b440a virtManager.create: don't clear recommended machine if none is selected
This improves loading domcapabilities to get domcapabilities for recommended
machine, not for default machine.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-16 12:00:10 +02:00
Pavel Hrdina
86e11786b5 maint: update all libvirt checks for version from 1.3.6 to 2.0.0
There want be 1.3.6 version, libvirt switched to new release numbering, for more
information see <http://libvirt.org/downloads.html#numbering>.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-15 12:05:11 +02:00
Jovanka Gulicoska
053672764f storagelist: code cleanup
Remove cb() function calling pool.refresh, instead use pool.refresh
in vmmAsyncJob
2016-06-14 19:17:06 -04:00
Cole Robinson
19b4cf026e cli: Support --cpu cellX.id (and cpus, and memory)
This allows configuring <cpu><numa><cell> bits via the command line.
This uses the optional numbering scheme described in the previous
commit.
2016-06-14 19:07:55 -04:00
Cole Robinson
b785f3f594 cli: Support --disk seclabelX.model (and relabel, and label)
This adds support for setting VirtualDisk <seclabel> XML. This
invents a new command line scheme for cases like this where there
are possibly multiple child elements that we want to specify
on the command line. So if you just want to specify one <seclabel>
block, you can do the expected

  --disk ...,seclabel.model=dac,relabel=no

However if you want to specify 2 <seclabel> blocks you need to do:

  --disk ...,seclabel0.model=dac,seclabel0.relabel=no,seclabel1.model=selinux,seclabel1.relabel=no
2016-06-14 19:05:30 -04:00
Cole Robinson
7ec97400a5 cli: Only instantiate VirtCLIArguments at parse time
We register the VirtCLIArgument classes with the static parse
instructions, but instantiate it with the actual key=val pair
from the command line. This fixes some layering violations, and
gives callers access to the actual command line key that we
are parsing, if that's interesting.
2016-06-14 16:26:56 -04:00
Cole Robinson
dc49d46f62 cli: Separate out can_comma handling
Clarify things by taking it out of the main parse loop
2016-06-14 14:08:50 -04:00
Cole Robinson
8532dacde0 cli: Pass virtarg and parser to setter callback
This should provide access to every bit of info we could possibly
want from the setter callbacks
2016-06-14 13:54:17 -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
8a0fd7927f cli: Improve comments for _VirtCLIArgument 2016-06-14 07:38:59 -04:00
Cole Robinson
3ce5af712b cli: Drop unused VirtCLIParser.option_variable_name 2016-06-13 19:15:35 -04:00
Cole Robinson
7018904959 cli: Move introspection checking out of Parser class
We can do that at the cli entry point, and only have the parser
print its subargs
2016-06-13 19:15:19 -04:00
Cole Robinson
7cd04a9f86 cli: Register VirtCLIArguments at class definition time
The VirtCLIArguments, (for example, path=, size=, etc. for --disk)
are only registered when a VirtCLIParser is actually initialized.
This seems backwards, since those arguments are really more immutable
factors of the actual command line parsing, so make more sense only
initializing them once, at class definition time.

This switches to use that pattern. This makes the parsing flow a bit
cleaner and can be a basis for future improvements.
2016-06-13 18:37:30 -04:00
Cole Robinson
4db0cd2eab cli: Tweak clearxml argument setup
Just unnest the callback to make it a little easier to follow
2016-06-13 18:37:30 -04:00
Cole Robinson
cb6853eea6 cli: More shared 'address.*' handling output VirtCLIParser
Make it a global function rather than complicating VirtCLIParser any
further with irrelevant functions
2016-06-13 18:37:30 -04:00
Cole Robinson
7bee927276 conn: Stop using VirtOptionParser
It only needs a minimal portion of the functionality, so separate
that out and use it explicitly. Clean up some of the surrounding
cli.py bits as well
2016-06-13 18:37:30 -04:00
Cole Robinson
efad67aab2 cli: Separate param parse and lookup
Makes the code a bit easier to follow
2016-06-12 19:48:16 -04:00
Cole Robinson
c9bd9791cf pylint: Skip bad-option-value to make f23 pylint more quiet
f24 pylint seems to have this behavior by default
2016-06-12 18:29:42 -04:00
Cole Robinson
302a84a97d virtinst: rename .seclabel->.seclabels
Since guest and disk can have multiple of these, make it clear
to callers
2016-06-12 11:09:15 -04:00
Cole Robinson
31b8051525 cli: Rename opts.opts -> opts.optdict
To make it more clear to callers what type of structure they are
dealing with
2016-06-12 10:32:23 -04:00
Cole Robinson
e04ce6fc13 Fix some pylint 2016-06-12 10:29:23 -04:00
Cole Robinson
0663e52a62 cli: Use OrderedDict for tracking cli values
Allows us to drop the single 'orderedopts' usage
2016-06-12 10:11:11 -04:00
Cole Robinson
a8914ae1e6 virtinst: disk: Fix seclabel testing
disk devices don't have a full <seclabel> under their <source>
element, just a smaller one with only a few options. Fix things
to match what libvirt does
2016-06-11 17:43:18 -04:00
Cole Robinson
263a35fe7a cli: Wrap setter_cb bits in a class
Will make it less churny if we want to add new bits in the future
2016-06-11 17:22:27 -04:00
Cole Robinson
14fd99255b cli: add --graphics listen=socket support
This is the new style socket support, where we request libvirt to
allocate a socket path for us. Plus this is the only way to enable
socket support for type=spice
2016-06-11 16:56:41 -04:00
Cole Robinson
4c0b761cfb virtinst: graphics: Add listen=none support
Not strictly needed for spice, but now available for vnc if
people want it
2016-06-11 16:48:34 -04:00
Cole Robinson
2b34831b26 cli: Add device address.type/address.bus/... options
This exposes every device <address> option, for each device
cli option. So --disk, --network, --video, etc.

Fill out a few more address XML bits as well
2016-06-11 16:10:31 -04:00
Cole Robinson
927990ad9d tests: clitest: Allow --only matching on output filename
So you can do "python setup.py --only many-devices' to only run the
clitest compare tests that output their results to files with
"many-devices" in the name
2016-06-11 15:58:48 -04:00
Cole Robinson
1330f8c675 cli: Move blkiotune and memorybacking out of the device code area 2016-06-11 13:45:05 -04:00