Commit Graph

4930 Commits

Author SHA1 Message Date
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
Cole Robinson
42d4179e1e tests: Fix error with latest libvirt
It caught a duplicate disk definition
2016-06-11 13:08:59 -04:00
Pavel Hrdina
df1c3e74aa virt-install: add a new guest feature GIC for ARM guests
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1334857

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-11 18:41:31 +02:00
Pavel Hrdina
0dbfb399cd virtinst: prepare XML parsers to handle GIC for ARM
GIC is used instead of APIC on ARM and libvirt allows configure specific
version of GIC for guests.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-11 18:41:24 +02:00
Pavel Hrdina
3d73f9cd3b tests: add aarch64 domcapabilities
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:09:54 +02:00
Pavel Hrdina
9ca3ec8b17 virtinst.cli: remove duplicated line
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:08:07 +02:00
Pavel Hrdina
2f0b40ac00 virtManager.config: fix pylint warning
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-10 18:05:39 +02:00
Pavel Hrdina
09cc6f3832 console: add support to forget password
If password for console is saved currently there is no way how to tell
virt-manager to forget that password.  This patch improves the authentication
page in order to provide a way how to forget password simply by unchecking the
"Save this password in your keyring".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:03:27 +02:00
Pavel Hrdina
7e1bd1d762 console: fix checkbox to save password if it was loaded from keyring
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1302175

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 20:02:45 +02:00
Pavel Hrdina
7280dcf7df create: report an error if storage doesn't exists for import installation
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1305210

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 19:48:24 +02:00
Cole Robinson
51e8b9df11 tests: test_urls: Add opensuse tumbleweed test 2016-06-07 13:23:14 -04:00
Pavel Hrdina
b327191a20 maint: fix pylint warnings wrong-import-order
standard import "import logging" comes before "from gi.repository import GLib"

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 17:37:06 +02:00
Cole Robinson
bd6badbc40 devicedisk: Fix typo in comment 2016-06-07 11:28:26 -04:00
Cole Robinson
e796efeaf9 domcaps: Add pep8 fix 2016-06-07 11:03:32 -04:00
Charles Arnold
33ae6e51ad virtinst: Fix detection of sle12sp1 media
The installer wrongly detects SLE-12-SP1 media as SLE-12-GA

Signed-off-by: Charles Arnold <carnold@suse.com>
2016-06-07 11:01:09 -04:00
Charles Arnold
2647f699fb virtinst: Fix detection of openSUSE tumbleweed media
With Tumbleweed now part of libosinfo we do not need to default
to openSUSE 13.2 when pointing at the installation media.

Signed-off-by: Charles Arnold <carnold@suse.com>
2016-06-07 11:01:09 -04:00
Shivaprasad G Bhat
94f610465f CD-ROMs should be on scsi bus for pSeries machines
Commit f6322c9e changed the default bus type for disks to virtio.
That changed it for both disks and cdroms. The CD-ROMs dont work
if on virtio on pSeries. So, change the cdrom bus type to scsi as
before.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>

Extend virt-install-ppc64-pseries-f20 test to cover this case.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 16:55:46 +02:00
Chen Hanxiao
70299a32c5 test: Fix tests with latest libvirt
libvirt commit
b33c14b342e5c2abeeee91c852ef2032327cb355
introduce this.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>

(crobinso: add proper compare_check annotations to clitest to skip
 changed tests on older libvirt)
2016-06-07 10:31:04 -04:00
Cole Robinson
9afdceef4e domcaps: Add some generic uefi<->arch catchall regexs
Not strictly required, but may help new distros make packaging
decisions that will 'just work'
2016-06-07 10:22:58 -04:00
Pavel Hrdina
efd1d2dd07 cpu: config: replace host-cpu-model by host-model-only
Commit f5c32063 replaced host-cpu-model by host-model-only but forget those two
places.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-06-07 09:06:13 +02:00
Pavel Hrdina
2d554aca7b ui: remove "Restore Saved Machine..." from File menu of Connection Details
Commit 839ce682 removed deprecated support of save/restore which was replaced by
managedsave feature.  This is a leftover that wasn't removed together with that
commit.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-05-31 13:09:48 +02:00
Cole Robinson
2204de62d9 spec: Move BuildArch before Source
My patch scripts like it better that way
2016-05-20 17:15:36 -04:00
Cole Robinson
443b64b64d tests: Add some spice gl related virt-xml tests 2016-05-20 14:51:31 -04:00
Cole Robinson
55327c81b7 xmlbuilder: Support clear()ing an object in place
This gives friendly XML output via virt-xml for clearxml=yes +
extra options: the XML block is editted in place, rather than removed
and with the newchanges appended
2016-05-20 14:51:31 -04:00
Cole Robinson
333103adbf xmlbuilder: minor cleanup 2016-05-20 14:51:31 -04:00
Cole Robinson
635a228f6b cli: Warn if we think spice GL settings won't work 2016-05-20 14:51:31 -04:00