Commit Graph

659 Commits

Author SHA1 Message Date
Chen Hanxiao
fcac052cdc virt-install: add support for user namespace
This patch will enable configuring idmap.
It could be used as enable user namespace
for LXC containers.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-09 13:16:34 -05:00
Cole Robinson
c5f6c6852a VirtualDisk: Always use storage APIs for provisioning
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.

We skip directories like /dev where doing this might be problematic.

This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
2014-02-08 19:24:14 -05:00
Cole Robinson
67743cbe31 storage: Only try lazy_refcounts with format=qcow2 2014-02-08 19:24:13 -05:00
Cole Robinson
0b4a72fd77 virt-convert: Reimplement it
We totally break CLI compat here, but the previous tool wasn't sustainable.
Instead, repurpose the tool as strictly converting external formats
like ovf/vmx to native libvirt XML, and launch the guest.

So we drop vmx/virt-image output, and virt-image input, and a slew of
command line options. I don't think anyone was depending on this in a
scripted fashion, so in practice I don't think anyone will care.

Add much more comprehensive unit tests while we are at it.
2014-02-07 21:16:09 -05:00
Cole Robinson
2ffd5a66e6 guest: Add single entry point for adding default devices 2014-02-07 16:07:32 -05:00
Chen Hanxiao
5a097183a9 test: add more test cases for option --blkiotune
Add additional test cases for option --blkiotune.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-07 23:12:54 +08:00
Chen Hanxiao
3be9dd3eb3 virt-install: Add --blkiotune option
This patch provides the ability to
tune Blkio cgroup tunable parameters for the domain.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-06 22:41:00 +08:00
Chen Hanxiao
c23de0b181 virtinst: drop parameter guest in convert_old_networks
We do not use this paramter any more since commit:
46d3e0041a.
So drop it.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-06 22:33:00 +08:00
Cole Robinson
a8dd7bd213 util: Fix validate_name error reporting 2014-02-05 19:02:42 -05:00
Cole Robinson
46d3e0041a deviceinterface: Absorb cli 'default source' logic 2014-02-05 19:02:42 -05:00
Cole Robinson
f5c32063e4 wip 2014-02-05 14:09:05 -05:00
Cole Robinson
7a825d9a28 virt-install: Add usbredir channels by default if using spice
Can be disabled with --redirdev none
2014-02-05 13:07:01 -05:00
Cole Robinson
f635187bb8 virt-install: If using spice graphics, add <sound> by default
Can be disabled with --sound none
2014-02-05 12:51:27 -05:00
Cole Robinson
e70ab961f9 virt-install: Switch back to using --sound argument
Since argparse allows optional arguments, we can back compat handle the
original boolean --sound option. This is nicer than using an option
named --soundhw
2014-02-05 12:41:34 -05:00
Cole Robinson
6f93d3decf Use .qcow2 extension when creating qcow2 files
Seems the be the practice these days
2014-02-04 17:30:24 -05:00
Cole Robinson
4e4fb15a2f virt-*: Drop all --prompt handling
This stuff is not very helpful and a pain to maintain. Let's drop it once
and for all. We still accept the CLI options and log a warning so people
hopefully take the hint.
2014-02-04 17:01:27 -05:00
Cole Robinson
8618a3abd7 prefs: Add 'Add SPICE USB redirection' option, enable it
For qemu guests that are using spice, add 4 redirdevs so USB redirection
happens for free. This can be disabled in the preferences dialog.
2014-02-04 15:27:56 -05:00
Cole Robinson
e0103286bd devicedisk: Short circuit path_exists(None) 2014-02-03 16:43:25 -05:00
Cole Robinson
cac593da8f storage: Use qcow2 lazy_refcounts if supported 2014-02-03 15:55:20 -05:00
Cole Robinson
1ab206a3eb virt-manager: create: Disable s3/s4 by default (bz 1044145)
I don't think most virt-manager users want this enabled, since it can
make the shutdown button cause a VM suspend. If people complain we can
provide a Preference or UI in the boot screen to undo it.
2014-02-03 14:22:15 -05:00
Cole Robinson
156a2a1dcb cli: Clarify a translation string 2014-02-03 11:21:16 -05:00
Cole Robinson
0654784643 virt-install: Add --pm option 2014-02-03 11:11:38 -05:00
Cole Robinson
4fbee9aa41 cli: Make --cpu host-model and --cpu host-passthrough work 2014-02-03 11:11:38 -05:00
Cole Robinson
032dd0cf21 clone: Show destination host if on a remote connection (bz 881099) 2014-02-01 18:59:10 -05:00
Cole Robinson
4ce356985a util: Relax name validation (bz 917444)
Warn about common cases like spaces in name, and let libvirt error on
the rest.
2014-02-01 08:37:28 -05:00
Cole Robinson
24c1c5a2bd cli: --network: Support driver_queues option 2014-02-01 07:48:04 -05:00
Cole Robinson
34e2ca8389 cli: --network: Wire up virtualport options 2014-01-31 16:51:02 -05:00
Cole Robinson
b12f06b84b cli: --disk: Add iotune paramters 2014-01-31 15:38:39 -05:00
Cole Robinson
427400d3f3 virtinst: cpu: Reorder feature bits to match libvirt XML order 2014-01-31 13:44:50 -05:00
Cole Robinson
90c9b3ca2e details: Reword the CPU model UI a bit more
- Add options in the model drop down for clear, hvdefault, and app default
- Make 'copy host' a check box, when enabled it hides the model dropdown
- Detect if the VM CPU is a copy of the host CPU
- Undocumented bit that allows passing in host-model/host-passthrough
    to the model field for people that really want those settings.
2014-01-31 13:40:09 -05:00
Cole Robinson
0a77093cbc console: Handle ipv6 addresses (bz 974126) 2014-01-29 11:02:54 -05:00
Cole Robinson
6042d762b5 cli: Add --graphics connected option (bz 730923) 2014-01-29 09:52:49 -05:00
Cole Robinson
64b2d0c6b7 Move shared graphics editing UI to gfxdetails.py
Fixes a couple UI bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=696217
https://bugzilla.redhat.com/show_bug.cgi?id=875403
2014-01-29 09:22:28 -05:00
Cole Robinson
d0c734e215 devicegraphics: Fix updating listen address
We need to make sure to change the corresponding <listen> block on newish
libvirt.
2014-01-29 09:22:28 -05:00
Cole Robinson
bd15cd3d6e distroinstaller: Fix volume upload with latest libvirt bindings (bz 1058720) 2014-01-28 10:00:06 -05:00
Chen Hanxiao
ffda1e8ef4 virt-install: add support for option "--cpu host-model-only"
commit 7003a3a528 introduced
"nearest host cpu model" option.
This patch add an option "--cpu host-model-only" to virt-install.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-28 09:40:00 +08:00
Cole Robinson
dde460e399 xmlbuilder: Fix adding devices with child properties
And test it
2014-01-27 19:55:37 -05:00
Cole Robinson
b963c3ec39 cli: Allow '--option help' for introspection as well 2014-01-27 14:48:23 -05:00
Chen Hanxiao
4b72c5f2a0 virtinst: clearer error message when disks upper limits reached
We set upper limits for virtio, hd ... disks in virtinst.
So we should let users know this.

Improve error message suggested by:
https://bugzilla.redhat.com/show_bug.cgi?id=822331

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-27 10:22:08 +08:00
Cole Robinson
58d5e0b799 uihelpers: Move a few more functions closer to their callers 2014-01-26 17:51:15 -05:00
Cole Robinson
2688ca64bb virt-xml: Fill in man page 2014-01-26 13:09:26 -05:00
Cole Robinson
b004d11eae cli: Fix unsetting --disk path 2014-01-26 13:09:26 -05:00
Cole Robinson
57e89cda8b virt-xml: Create storage if necessary 2014-01-26 13:09:26 -05:00
Cole Robinson
6e06b3642b cli: Explicitly error on cli options like --disk readonly
All options should be opt=val pairs, but we behaved weirdly on missing
= before.
2014-01-25 20:30:08 -05:00
Cole Robinson
443ae1b303 virt-xml: Change clear format to clearxml=yes, add --help example 2014-01-25 20:30:08 -05:00
Cole Robinson
48f69dd638 virt-xml: Add --update option for hotplug/hotunplug 2014-01-25 19:51:56 -05:00
Cole Robinson
26737eb7d5 virt-xml: Allow --option clearxml to clear all XML first
Needed for things like --cpu host-model,clearxml to easily clear all
the previous state.
2014-01-25 17:20:30 -05:00
Cole Robinson
9f5a842a3a xmlbuilder: Make clear() remove unknown XML properties 2014-01-25 17:20:30 -05:00
Cole Robinson
16c8c31cbd xmlbuilder: Remove unneeded argument to _remove_xpath_node 2014-01-25 17:20:30 -05:00
Cole Robinson
5edf4de058 xmlbuilder: Only pass xml context to _remove_xpath_node
Was confusing otherwise, and can give us a speedup.
2014-01-25 17:20:29 -05:00
Cole Robinson
5c762a9851 simplify remove_ node args 2014-01-25 17:20:29 -05:00
Cole Robinson
329ebe0746 xmlbuilder: Remove some unneeded redirection 2014-01-25 17:20:29 -05:00
Cole Robinson
927a7ef265 cli: Add --metadata option
Can take name, description, uuid, and title (new). This deprecates the
separate --description and --uuid element, but we won't require it for
specifying a name with virt-install/virt-image since that's quite
overkill. Allowing --name with this option is mostly for the benefit
of virt-xml.
2014-01-25 17:20:29 -05:00
Cole Robinson
ec359fd5b2 cli: Add --disk readonly and shareable options
This deprecates the difficult perms= sub option
2014-01-25 17:20:29 -05:00
Cole Robinson
7ba76b5748 cli: Add --memory, deprecates -r/--ram
This is a compound option like we use elsewhere, with suboptions for
maxmemory and hugepages.
2014-01-25 17:20:29 -05:00
Cole Robinson
cf626c3afe cli: Fix --security label=foo,unknownopt=val
We should embed the unknown opt
2014-01-25 17:20:29 -05:00
Cole Robinson
65124ff66b cli: Add infrastructure for tracking alias property names
Use this to hide redundant --boot extra_args option from introspection
output.
2014-01-25 17:20:29 -05:00
Cole Robinson
70ce777c33 cli: --controller: Remove double register of type 2014-01-25 17:20:29 -05:00
Cole Robinson
87a611b547 cli: Allow controlling arch, type, emulator via --boot 2014-01-25 17:20:29 -05:00
Cole Robinson
748ff1c4cc virt-xml: Initial commit, basic set of tests 2014-01-25 17:20:29 -05:00
Cole Robinson
ffa9bb77b3 Fix some pylint 2014-01-25 15:52:34 -05:00
Cédric Bosdonnat
beab40e3b1 Share the list of all disk image formats
(crobinso: Fix some trailing whitespace)
2014-01-25 11:59:32 -05:00
Cédric Bosdonnat
796ddd966a Moved vmmFSDetail.convert_units to virtinst.util 2014-01-25 11:58:24 -05:00
Cole Robinson
35f6567c69 Allow command line introspection ex: disk=?
This will list all sub options associated with that command.
2014-01-22 15:37:23 -05:00
Cole Robinson
316b2bd73b virt-install: Add some examples in --cpu help 2014-01-22 10:43:57 -05:00
Cole Robinson
812c4c6d98 virt-install: Move more shared options to cli.py
virt-xml will use these
2014-01-22 10:43:48 -05:00
Cole Robinson
f9ab83a69e virt-install: Deprecate --init, make it --boot init= instead 2014-01-22 10:43:09 -05:00
Cole Robinson
ec79c676b3 cli: Deprecate explicit --cpuset option, make it a --vcpus sub option 2014-01-22 10:43:01 -05:00
Cole Robinson
54b73f4502 cli: Centralize most option handling dispatch
Rather than require tools to do multiple parse_* calls. This infrastructure
will help with virt-xml as well.
2014-01-22 10:42:05 -05:00
Cole Robinson
269339f29f cli: drop get_* helpers, just make parse_* helpers handle all cases 2014-01-22 10:40:48 -05:00
Cole Robinson
d216c44157 Stub out --check-cpu option
It's old, uninteresting, and I don't think anyone is depending on it
to work. Parse the command line option, but don't do anything differently.
2014-01-22 10:38:42 -05:00
Cole Robinson
6c7439d625 cli: Drop useless get_uuid helper 2014-01-22 10:36:21 -05:00
Cole Robinson
d1edce1ca5 cli: Drop dest= from most arguments, it was redundant 2014-01-22 10:36:14 -05:00
Cole Robinson
41a84bae9f cli: Rework adhoc CLI parsing into a class structure
This adds:

VirtCLIArgument: a single foo=bar mapping
VirtOptionString: A collection of VirtCLIArguments, that parses the whole thing
VirtCLIParser: Represents a single cli option like --disk, --network, etc.

Centralizing this infrastructure opens up a lot of doors for future
improvements, like cli option introspection.
2014-01-22 10:35:30 -05:00
Chen Hanxiao
a98515a4da virt-install: add support for '--panic option'
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>

(crobinso: man page and cli tweaks)
2014-01-22 09:33:18 -05:00
Martin Kletzander
dc0b9bbaaf Rename hide_unsupported_rhel_options to stable_defaults and clean-up its usage
There were multiple problems with the setting and usage of
hide_unsupported_rhel_options.  Due to the fact that the option has
several diferent namings throughout the code, this patch is renaming
it to stable_defaults, which basically says what the option does and
makes it possible to use it without need for more than one negation
(where the old code had up to 4 of them in some places), which also
helps understanding it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-01-21 17:13:18 +01:00
Cédric Bosdonnat
d888ff2394 Add lxc filesystem drivers: loop and nbd
These file systems drivers have been added in virtinst, but also in the
addhardware UI.
2014-01-21 09:29:13 -05:00
Cédric Bosdonnat
2f505822a1 Add Hardware: added the missing filesystem types for LXC guests.
This means tweaking the UI to input a memory usage for the 'ram'
filesystem type.
2014-01-21 09:29:12 -05:00
Martin Kletzander
10331a5f14 pylint: Skip hashlib import hackery and remove unused variable
hashlib's dynamic import hackery makes pylint very sad since it cannot
realize that the module has sha256 member (just created dynamically),
so let's just make it skip this error.

Also remove unused variable in virtinst.cli

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-01-20 14:42:07 +01:00
Cole Robinson
c426a30511 Convert all command line handling to argparse
Allows us to drop some hacks, and we may need it for a new upcoming
tool.
2014-01-19 11:32:08 -05:00
Cole Robinson
7f66926721 Fix first time remote URL installs from virt-manager (bz 1049852)
On first run, the remote URL install handling creates a storage pool
for /var/lib/libvirt/boot on the remote host. After this, it clears
the VirtualConnection's object cache, so the next time all pools are
fetched, it returns an accurate list.

However that clear_cache call wasn't propagated up to virt-manager's
cache. Add a new cb to fix it.
2014-01-18 14:57:39 -05:00
Cole Robinson
a82b60dcff capabilities: Remove some public API back compat 2014-01-18 13:23:30 -05:00
Cole Robinson
dcd67be2db osdict: Use virtio console and qemu ga for RHEL7 2014-01-18 13:06:09 -05:00
Cole Robinson
073b3a69e3 urlfetcher: Use inst.repo kernel option for new RH distros (bz 1026841) 2014-01-18 13:04:47 -05:00
Cole Robinson
962994f72f osdict: RHEL7 has a public beta, so it's 'supported' now 2014-01-18 10:35:55 -05:00
Cole Robinson
e151146cad cloner: Don't validate new clone name (bz 1054771)
Our validation check might not be up to date, WRT what characters are
acceptable. So if we try to --auto-clone an existing valid VM with
some characters we aren't expecting, we cause ourselves to error.

Just skip the validation and let libvirt complain if something is wrong.
2014-01-17 18:44:26 -05:00
Cole Robinson
d040bf3573 Drop the len <= 50 validation check for domain names
Just let libvirt error out, since we have no idea if this is still
relevant.
2014-01-17 18:42:15 -05:00
Cole Robinson
958dea6c5f createnet: Use typical name validation pattern 2014-01-17 18:40:30 -05:00
Cole Robinson
6d2f937c99 virt-install: --host-device: add driver_name option 2014-01-14 18:09:21 -05:00
Cole Robinson
b57a2094ff Probe entire backing chain when checking if path is in use 2014-01-14 17:44:14 -05:00
Cole Robinson
66096a7eeb choosecd: Check path-in-use collision (bz 1028197) 2014-01-14 17:11:51 -05:00
Cole Robinson
765b1ed7d6 Track kernel/initrd/dtb in 'path in use by' UI 2014-01-14 16:57:32 -05:00
Chen Hanxiao
2bee4a128d panic notifier: display default value if not set
If we didn't set values for @type and @iobase in
XML, libvirt will use the default value.
Currently, virt-manager will display "-" if we don't
set any values.
This patch will use default value for display.
And update test case to cover this scenario.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-14 09:58:09 -05:00
Cole Robinson
6db30432a5 domain: Use support infra to check if memory stats supported 2014-01-12 17:53:53 -05:00
Cole Robinson
bd111d411c addhw: Only allow panic device if libvirt supports it 2014-01-12 15:16:06 -05:00
Cole Robinson
f02b85d913 guest: Don't add qemu-ga on ARM where virtio slots are limited 2014-01-12 14:58:43 -05:00
Cole Robinson
52bb0f6067 nodedev: Include PCI vendor in pretty name
Pretty important if trying to distinguish between devices
2014-01-12 14:52:33 -05:00
Cole Robinson
cad64c0dc1 nodedev: Remove subdev for pretty_name, it's pointless 2014-01-12 14:52:15 -05:00
Cole Robinson
a70077172e urlfetcher: Don't mandate boot.iso in treeinfo for Generic distro
Hit this if doing --location /path/to/mounted/RHS.iso

https://bugzilla.redhat.com/show_bug.cgi?id=1039456
2014-01-11 16:24:13 -05:00
Cole Robinson
d38d019aeb distroinstaller: Make each media type explicit 2014-01-11 16:10:38 -05:00
Cole Robinson
0c80c69918 installer: Drop needless property redirection 2014-01-11 15:28:21 -05:00
Chen Hanxiao
8419835b1d virtinst: add support for panic notifier device
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-11 14:32:18 -05:00
Cole Robinson
95170e8892 virt-install: Support --network source, source_mode, target
The latter two bits are needed for macvtap configuration.
2014-01-06 15:17:32 -05:00
Cole Robinson
c9680b34a1 ppc64 pseries guests use vga graphics, not qxl (bz 1034693) 2013-12-18 16:17:01 -05:00
Giuseppe Scrivano
25723f98ae osdict: append "(or later)" to the last version of an OS
It makes clearer to the user to pick the last version available for an
OS when a newer version is not listed by virt-manager/virt-install.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-12-06 20:18:28 +01:00
Cole Robinson
70f1f8df1e storage: Parse volume key 2013-12-05 09:17:12 -05:00
Giuseppe Scrivano
e51dd1cf40 capabilities: correctly parse "cpus" in the host NUMA topology
"cpus" might no be the only child element in the "cell" element, so be
sure to check all children.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1032320

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-11-22 13:53:06 +01:00
Cole Robinson
e7ed161f5a support: Use libvirt daemon version correctly
It should be the reference version for all libvirt checks if it exists.

Fixes AUTOSOCKET check for a remote RHEL6 hypervisor for example.
2013-11-19 17:02:51 -05:00
Giuseppe Scrivano
d3a6f1a537 virtinst: parse capabilities baselabel element
libvirt since version 1.1.4 shows the security context used to execute
the hypervisor process.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-11-18 09:05:22 +01:00
Cole Robinson
1ffcc0cced urlfetcher: Fix breakage after kernel err report fix 2013-11-10 11:35:22 -05:00
Cole Robinson
de7144d216 create: Don't ask about changing perms if qemu is 'root' user 2013-11-10 11:09:22 -05:00
Cole Robinson
8b42bca801 urlfetcher: Fix error reporting if fetching kernel fails (bz 1017419) 2013-11-09 18:56:09 -05:00
Cole Robinson
8dcb65bd50 create: Fix default qemu-ga setup (bz 1016613)
We were adding default devices before setting the OS value, which qemu_ga
setup depends on.
2013-11-09 18:52:05 -05:00
Cole Robinson
eb33bd34e7 Misc improvements to some debug messages 2013-11-09 18:17:29 -05:00
Giuseppe Scrivano
5798c5b9b4 virt-manager: prefer os.makedirs to os.mkdir when creating cache dir
Ensure the parent directories exist when attempting to create the
cache directory.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1016435

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-11-05 18:15:11 +01:00
Giuseppe Scrivano
a832d77559 virt-install: EGD RNG devs need a host to connect to if backend_mode=bind
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:32:06 +01:00
Giuseppe Scrivano
8248331d6c virtinst: allow EGD RNG devices to have both bind and connect sources
Remove backend_mode from VirtualRNGDevice and allow to directly specify
bind and connect sources.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:32:06 +01:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Giuseppe Scrivano
0df75c7603 headers: update "Red Hat, Inc." copyright for the year 2013
Ensure that any file touched by a @redhat.com author in 2013 has an
updated copyright header.

The files were updated using the build-aux/update-copyright gnulib
script and manually added where the copyright line wasn't present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:26 +01:00
Cole Robinson
2b564f524e Fix a string typo 2013-10-24 14:07:06 +01:00
Cole Robinson
1a88cef3af altlinux doesn't have installable URLs, clarify 2013-10-15 11:21:53 -04:00
Cole Robinson
6673123185 nodedev: Parse PCI iommuGroup 2013-10-10 09:41:49 -04:00
Cole Robinson
3f532fe263 VirtualDisk: Handle the blktap default
And cache the blktap lookup once for the localhost
2013-10-06 13:17:35 -04:00
Cole Robinson
5945b8c4a1 connection: Drop redundant XML sanitizing 2013-10-06 13:00:30 -04:00
Cole Robinson
56b9f6187b Streamline support checks
Just use one function check_support
2013-10-06 10:08:04 -04:00
Cole Robinson
d4103eac26 virt-install: Add '--console none' and '--channel none'
For skipping the default channel and default console behavior
2013-10-06 09:43:56 -04:00
Cole Robinson
18fa751059 Add qemu-guest-agent channel automatically for supported OS 2013-10-06 09:19:59 -04:00
Cole Robinson
f44ad5ae05 Default to virtio console for supported OS
This could cause issues for people trying unattended non-graphical
kickstart installs and expecting ttyS0 in the guest to be hooked
up to the default console. So to get back the default behavior, you
can do:

  --console pty
2013-10-06 08:53:05 -04:00
Cole Robinson
dae3678d26 guest: Absorb more default device checks 2013-10-06 08:30:33 -04:00
Cole Robinson
eede884554 guest: Set more involved clock defaults for qemu
The XML we use is:

  <clock offset="utc">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
  </clock>

Which translates to the qemu commands:

    -no-hpet -no-kvm-pit-reinjection -rtc driftfix=slew

The latter two bits are already used by openstack and gnome boxes by
default.

On RHEL hpet is compiled out so -no-hpet is the default,
but not everywhere else. Though recently the RH guys confirmed that
for regular usage it should be turned off because a) qemu support
is not that good, b) most users don't need it anyways c) it has
a performance penalty.

This default can be overridden from a virt-install command like

  --clock rtc_tickpolicy=delay

When Guest() sees that a timer has already been defined, it won't
set the new defaults, and that setting above is the old implied
default rtc setting.
2013-10-05 17:12:11 -04:00
Cole Robinson
d0b067f2fc virt-install: Add --clock option 2013-10-05 16:48:07 -04:00
Cole Robinson
a163f44a27 clock: Add timer parsing 2013-10-05 16:05:31 -04:00
Cole Robinson
ff73f1119e details: If we know the channel target name, pretty list it 2013-10-05 14:04:49 -04:00
Cole Robinson
0366589812 Rip out all support for local RHEL6 version checks
These bits only apply if virt-manager is running directly on a RHEL6.
Since latest virt-manager can't do that thanks to GTK3 conversion,
just drop it all.
2013-10-05 13:57:55 -04:00
Cole Robinson
34f23165b6 addhw: Add channel option for auto socket allocation 2013-10-05 13:54:28 -04:00
Cole Robinson
5f1187e4c3 addhw: Don't show target_type for every char device 2013-10-05 13:33:55 -04:00
Cole Robinson
9d21d2bb02 addhw: List known channel names in a comboboxentry 2013-10-05 13:27:11 -04:00
Cole Robinson
24137cdfe9 addhw: Add 'console' option for adding virtio consoles 2013-10-05 13:22:53 -04:00
Cole Robinson
f9fcac27a0 addhw: Don't advertise unused char types
Like vc, stdio, etc. They don't really have much use
2013-10-05 11:07:32 -04:00
Cole Robinson
98187eb4b7 util: Fix generate_name start_num logic
We would start at start_num+1 which was confusing, fix it to do
the right thing.
2013-10-05 10:22:27 -04:00
Fred A. Kemp
05254479db virt-install: Add --disk removable option 2013-10-04 07:57:13 -04:00
Fred A. Kemp
bcd47d6471 virtinst: Expose disk/target/@removable 2013-10-04 07:57:13 -04:00
Cole Robinson
d83b2c02fa virt-manager: Add USB3 convenience option to the controller UI
and a --controller usb3 option to virt-install
2013-10-03 16:34:28 -04:00
Giuseppe Scrivano
8e85840546 virt-install: allow to specify "startupPolicy" for --disk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-03 16:51:23 +02:00
Giuseppe Scrivano
f5a7476497 virtinst: expose disk/source startupPolicy attribute
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-03 16:49:49 +02:00
Giuseppe Scrivano
b2e962fcf3 virtinst: Use the default keymap when running tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-03 16:49:45 +02:00
Cole Robinson
0bd2f97bda VirtualDisk: Try to append targets, not just use first free (bz #905439)
This used to happen:

- create VM with cdrom, cdrom gets hdc
- customize before install
- add new cdrom, gets target hda or hdb (first free target)
- new cdrom now has priority in the boot order

Change the logic to try to append targets first, and if there isn't
any space left, use the first free one. This may cause other issues
but we'll just have to wait and see.
2013-10-03 08:48:15 -04:00
Cole Robinson
5860b132dc tests: Add focused unit test for device numbering 2013-10-03 08:48:11 -04:00
Cole Robinson
0614e490c8 VirtualDisk: Don't try to force cdrom target=hdc
It was required a long long time ago, before qemu supported -drive
and possibly ancient xen. Nowadays it should be pointless, and contributes
to some issues like bz 905439
2013-10-02 20:31:57 -04:00
Cole Robinson
475ec1252e virt-install: Allow --disk target
Shouldn't be needed often, but just in case
2013-10-02 20:15:49 -04:00
Cole Robinson
18d8512699 Move the 'default graphics type' logic into Guest
So we can share it, and make virt-install more robust
2013-10-02 18:06:52 -04:00
Cole Robinson
a2cbb9f500 support: s/CONN_HV/CONN/g
We don't need to distinguish these days.
2013-10-02 16:41:23 -04:00
Cole Robinson
fb7868db19 Enable cache=None and io=native by default for block devices
This is where performance issues hit the most. This changes the
RHEL default to remove cache=None for all file volumes. If anyone
cares they can speak up, but it seems an overly unnecessary deviation
from upstream qemu.
2013-10-02 16:10:39 -04:00
Cole Robinson
9c57c72eac Default to adding USB2 for new enough KVM
We enable this for virt-install as well. To avoid it, you can do either

--controller usb,model=none or --controller usb
2013-10-02 15:54:35 -04:00
Cole Robinson
9194feb1f5 virt-manager: Default to qcow2 on kvm
qcow2 enables fancy features like snapshots and is generally more
desktopy, which we purport to be.

We only do this on not horribly old libvirt/qemu, and only on qemu
connections. This may work for xen but I'm not going to turn it on
until someone tests it.
2013-10-02 15:34:34 -04:00
Cole Robinson
fa0ee32172 virt-install: Fix multiple invocation of --disk pool=default
Don't use a global counter, just correctly specify a collidelist with
not yet created disk images
2013-10-02 13:20:27 -04:00
Cole Robinson
187ce92621 hostkeymap: Centralize parsing, don't be so noisy
And add /etc/vconsole.conf parsing to close bug 882183
2013-10-02 12:35:59 -04:00
Cole Robinson
67c62e68de create: Move name to last page, arch/type to first page
Moving name to the end allows us to do things like generate a default
name based on the chosen OS type, which we do here. This is bz 736951

Moving arch/type to the front page of the wizard simplifies validation
and will be needed to intuitively install arm guests without a bunch
of hacky workarounds.
2013-10-01 16:53:59 -04:00
Cole Robinson
37350859ce storage: Use qcow2 metadata preallocation if supported 2013-10-01 14:29:58 -04:00
Ying-Shiuan Pan
fa8422f278 support: decrease required libvirt version for stream console
According to the changelog of libvirt http://libvirt.org/news.html,
the required version for stream console should be 0.8.6.

Please check the link: http://libvirt.org/news.html, libvirt started
to support virDomainOpenConsole() since "0.8.6: Nov 30 2010". And there
were also many changes related to stream console.

In practical terms, I have tested the change with libvirtd-0.8.8 in
Ubuntu 12.04.2 (x64) and another ARM port libvird-0.8.8. I think changing
to 0.8.6 should be fine because according to the changelog there are
no big changes in libvirt-0.8.7 and libvirt-0.8.8.

Signed-off-by: Ying-Shiuan Pan <yspan@itri.org.tw>
2013-10-01 10:58:44 -04:00
Cole Robinson
dd823d2d8c cli: Don't log to debug files from the test suite
We shouldn't be doing it anyways, but my recent cache_dir change broke
a bunch of stuff without this.
2013-10-01 10:14:46 -04:00
Cole Robinson
0b58badfc1 Storage debug and scratch files in ~/.cache/virt-manager (bz 693028) 2013-10-01 08:28:15 -04:00
Cole Robinson
6043a88a0c snapshots: Add some specific UI for external snapshots
We sort them separately in the snapshot list, explicitly mention that
they are 'external', and add a UI field listing the memory/disk
details.

In general mixing internal and external snapshots is a recipe for
confusion and disaster, so I think the best thing to do is at least
acknowledge their presence in the UI but not make any attempt to
predict what will or will not work.
2013-09-30 19:55:21 -04:00
Cole Robinson
45e84d46ec snapshots: Make state type/icon UI match other usage 2013-09-30 17:12:24 -04:00
Cole Robinson
b3e2d26337 snapshots: new: Automatically generate a snapshot name 2013-09-30 16:33:45 -04:00
Cole Robinson
34c502560f storage: Drop unused static function
This allows us to simplify the parameters for find_free_name
2013-09-30 16:22:12 -04:00
Cole Robinson
98a95b2e2d network: Add install() command, remove function from vmmConnection
This is the pattern used by other virtinst objects
2013-09-30 15:38:34 -04:00
Cole Robinson
2b74c46909 snapshots: Pretty up the 'new snapshot' dialog 2013-09-30 15:38:12 -04:00
Cole Robinson
ccb96e9e4a VirtualDisk: Add cache modes 'directsync' and 'unsafe' (bz 844907) 2013-09-30 14:30:50 -04:00
Cole Robinson
74e8fff069 clone: Fix a few misc issues 2013-09-29 11:31:03 -04:00
Cole Robinson
86a98f0d39 virt-install: Add --disk backing_store option 2013-09-29 11:23:59 -04:00
Cole Robinson
ddba6098f6 pollhelpers: Support nodedev listAllDevices 2013-09-29 09:39:55 -04:00
Cole Robinson
52e4976462 pollhelpers: Add fetch_volumes helper
That does the listAllVolumes support check to speed us up a bit.
2013-09-29 09:33:17 -04:00
Cole Robinson
ce9f8ee24e pollhelpers: Clarify some variable names and docs 2013-09-29 09:28:42 -04:00
Cole Robinson
07ea05365d connection: Cache _all_ support checks
This could cause issues if something like a domain support check
returns NOSUPPORT for one domain on a connection but not for another
domain, but honestly I'd call that a libvirt bug since NOSUPPORT should
be usable like we want it.
2013-09-29 09:26:03 -04:00
Cole Robinson
a9a085340b support: Rename SUPPORT_STORAGE to SUPPORT_POOL
It's more accurate. And fix up comments about back compat which no
longer apply.
2013-09-29 09:21:42 -04:00
Cole Robinson
72058f2bbf support: Remove unused nodedev support checks 2013-09-29 09:19:56 -04:00
Cole Robinson
0ffdbb13fe pollhelpers: Re-enable list-all-interfaces
Was just transient F19 breakage
2013-09-29 08:33:45 -04:00
Cole Robinson
7a5dc7c544 devicedisk: path_in_use_by: Check backing stores as well
Plumb through a fetch_all_vols helper for this, and do all the
caching bits.
2013-09-28 21:07:18 -04:00
Cole Robinson
bc34df1dc7 storage: Parse volume backingstore 2013-09-28 19:21:58 -04:00
Cole Robinson
d414beb3a9 Warn that --prompt mode will likely be removed in the future. 2013-09-28 11:34:03 -04:00
Cole Robinson
4c15da439b cli: Combine registering a bunch of common options 2013-09-28 11:27:26 -04:00
Cole Robinson
b1fb6c2567 cli: Pass key name to set_param convert_cb for error handling 2013-09-28 10:58:27 -04:00
Cole Robinson
5329a9afc9 virt-install: Add --tpm /dev/tpm convenience option 2013-09-28 10:28:04 -04:00
Cole Robinson
b3719f25ac cli: s/yes_or_no/yes_no/g 2013-09-28 10:06:52 -04:00
Cole Robinson
b3a72bcb95 cli: Remove unneeded parameter to optparse.add_option 2013-09-28 10:03:08 -04:00
Cole Robinson
eca87838fb virt-install: Add --features option
And hide docs about old --noacpi/--noacpi options. I don't think
anyone really uses them anyways, but if anyone complains we should
just implement --features for the other CLI commands.
2013-09-28 09:58:57 -04:00
Cole Robinson
16a190a0dc cli: Add some consistency to deprecated option handling
Take all the old options and convert them to new style, so the rest
of the app only needs to deal with new style bits.
2013-09-27 22:31:52 -04:00
Cole Robinson
fd00ad74e2 devicehostdev: Drop device creation helper
Goes against other device paradigms, and is cleaner when we unwind it.
2013-09-27 18:28:28 -04:00
Cole Robinson
6013622da4 cli: Make option handling more consistent 2013-09-27 16:52:41 -04:00
Cole Robinson
a900ca14e3 domainfeatures: Fill out XML support 2013-09-27 15:35:27 -04:00
Cole Robinson
1212cf43a9 DomainFeatures: Drop __getitem__ helpers
They just complicate matters
2013-09-27 15:08:44 -04:00
Cole Robinson
166414dd57 storage: Add VDI to format list 2013-09-27 13:22:40 -04:00
Oden Eriksson
3118821848 osdict: Add Mandriva Business Server 1 2013-09-26 20:17:24 -04:00
Cole Robinson
90a610eaef tests: Fix REPLACEME image.py hack 2013-09-26 19:56:16 -04:00
Cole Robinson
d49e11dabc urlfetcher: Fix distro lookup short circuiting if os_variant specified 2013-09-26 17:45:02 -04:00
Cole Robinson
7aa24be31a urlfetcher: Detect debian, ubuntu, and opensuse variant from URL 2013-09-26 17:44:57 -04:00
Cole Robinson
a78235c8bf urlfetcher: More cleanups of isValidDistro impls 2013-09-26 16:31:53 -04:00
Cole Robinson
4378e40aad urlfetcher: Drop Solaris and Netware distro classes
They are untested, likely broken, and I don't think anyone cares
anyways. Maybe opensolaris but it was tied in with a bunch of
extra junk.
2013-09-26 14:54:02 -04:00
Cole Robinson
c5f5d5ad9d urlfetcher: Clean up APIs for fetching URL media 2013-09-26 14:28:13 -04:00
Cole Robinson
655f458298 test_urls: Turn each URL test into an object, not a dict
Update the URL list and fix a couple bugs
2013-09-26 12:36:21 -04:00
Giuseppe Scrivano
601eb5f15e virt-install: accept a single argument form for RNG devices
Detect the "--rng /dev/random" case and assume it is the "random" type.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-09-26 10:09:33 +02:00
Giuseppe Scrivano
0d03f972a3 virtinst: handle the guest "title" XML element
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-09-25 19:16:22 +02:00
Giuseppe Scrivano
620bcae93e virtinst: add probe functionality to test for metadata support
Suggested-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-09-25 19:16:22 +02:00
Cole Robinson
a2e5206730 deviceinterface: Fix creating direct interfaces (bz 1006324)
And take the opportunity to standarize on setting net.source,
rather than have API users have to do net.bridge/network/source_dev
2013-09-24 10:00:01 -04:00
Cole Robinson
9ec845af03 xmlbuilder: Unify make_xpath callbacks 2013-09-24 09:25:05 -04:00
Cole Robinson
a660088768 cloner: Unset domain ID when cloning
This unbreaks the cli clone tests whenever a new guest is added to
the testdriver.xml
2013-09-23 21:27:54 -04:00
Cole Robinson
737016c0cf guest: Allow parsing domain ID 2013-09-23 21:27:42 -04:00
Cole Robinson
8ba600a8e7 virt-install: Fix --location nfs:// (bz 1011177) 2013-09-23 21:23:36 -04:00
Cole Robinson
85813203dc createnet: Use virtinst.Network for XML generation 2013-09-23 13:49:20 -04:00
Cole Robinson
0323fcfbf7 network: Fix parsing route netmask 2013-09-23 09:10:43 -04:00
Cole Robinson
b690557a53 Convert NodeDevice to XMLBuilder 2013-09-23 08:25:20 -04:00
Cole Robinson
1c0475feff xmlbuilder: Make prop cache work with subclasses 2013-09-23 07:38:22 -04:00
Cole Robinson
a6d92c7001 Drop a lot of usage of utility XML functions 2013-09-22 17:34:53 -04:00
Cole Robinson
e9b8a289b5 network: Centralize pxe support check 2013-09-22 17:05:15 -04:00
Cole Robinson
a7834f5d6c Add Network class for parsing <network> XML
Convert virtManager/host.py, do some cleanups and modernization to the
UI there, add tests.

createnet.py hasn't really been touched yet, but still works because
it was building the XML by hand anyways.
2013-09-22 11:16:07 -04:00
Giuseppe Scrivano
a55438f880 virt-install: add support for virtio-rng devices
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-09-20 18:56:19 -04:00
Giuseppe Scrivano
8abcae5073 virtinst: add support for virtio-rng devices
The virtio-rng device is supported by libvirt since version 1.0.3.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-09-20 18:56:12 -04:00
Cole Robinson
cadf5ba770 xmlbuilder: Cache class property maps
Shaves about 20 seconds off the test suite
2013-09-20 11:30:33 -04:00
Cole Robinson
85e81df01a xmlbuilder: Serialize child objects even if they aren't in PROP_ORDER
This was just a bug
2013-09-20 11:17:11 -04:00
Cole Robinson
a23f1794d0 guest stuff 2013-09-20 10:55:48 -04:00
Cole Robinson
fd52fb2c32 util: Drop 'partition' helper, we require python 2.5 these days 2013-09-20 10:05:42 -04:00
Cole Robinson
aff0ddb259 Use XMLBuilder for Storage object handling
Simplify the API a bunch while we are at it, add tests, etc.
2013-09-20 10:00:08 -04:00
Cole Robinson
3db5cb5f06 Use XMLBuilder for Interface XML
So we unify parsing and building the XML.

Since we already do this for vmmDomain, take the opportunity to move
the shared infrastructure into vmmLibvirtObject
2013-09-19 16:56:38 -04:00
Cole Robinson
cb06f7eb3d xmlbuilder: Ensure top level XML objects always end with a newline 2013-09-19 13:48:28 -04:00
Cole Robinson
99a50de53e Simplify XMLProperty declarations 2013-09-19 13:31:33 -04:00
Cole Robinson
1aaf41b201 xmlbuilder: A couple optimizations
This brings the test suite back to pre-refactor speeds
2013-09-19 13:31:33 -04:00
Cole Robinson
0be727e6bb xmlbuilder: Track singleton child properties explicitly
Things like Guest.Seclabel, VirtualDevice.VirtualAlias, etc.

Now we don't need to track a full xpath with each class, just its root
name and we build its hierarchy depending on its parent.
2013-09-19 13:31:33 -04:00
Cole Robinson
38545e3af8 Fix pylint warnings with latest version 2013-09-19 13:14:44 -04:00
Cole Robinson
f5dab5cdfa xmlbuilder: Distinguish between parent xpath and object xpath
We want to add support for nested objects, like child interfaces
in virInterface definition. To do that we need to distinguish between
parent xpath and relative object path.

This causes a 10-15% slow down in the unit test suite for me. There's
probably opportunities for speeding this up.
2013-09-11 11:28:27 -04:00
Cole Robinson
eb4068cc47 xmlbuilder: Add infrastructure for parsing into subclasses
We already had this open coded in several classes with varying methods.
Now all someone has to do is

features = XMLChildProperty(CPUFeature)

The xmlbuilder code will pull the relevant xpath from the CPUFeature class,
handling parsing into instances of that class directly. The only
thing that needs to be manually added is the add_* remove_* functions.
2013-09-10 21:34:45 -04:00
Cole Robinson
10e608e9dd guest: Fix adding a parsed device to a built guest 2013-09-10 18:34:36 -04:00
Cole Robinson
71d7e20811 guest: Simplify remove_device 2013-09-10 18:34:36 -04:00
Cole Robinson
37ec775daf xmlbuilder: Fix multiple overwrite of root_xpath
Nothing really triggers it right now, but future code may
2013-09-10 18:34:36 -04:00
Cole Robinson
67cc81f6b1 virt-install: Add --boot useserial=on
Which gives bios output over serial console via sgabios
2013-09-04 11:57:26 -04:00
Martin Kletzander
ab94df86c4 Typos fix and minor cleanup
Commit 57aab5de copy-pasted a typo, introduced a new one and used bad
order of parameters, so I'm fixing it so we're not stuck with it
forever.
2013-09-03 08:47:26 +02:00
Martin Kletzander
70fae14635 Automatically add multifunction address parameter when needed
Also check for use of duplicate addresses before passing such XML to
libvirt.  And fix tests (of course).
2013-09-03 08:08:06 +02:00
Martin Kletzander
57aab5de17 Add support for multifunction address parameter 2013-09-03 08:08:06 +02:00
Cole Robinson
018fcbbb4a distroinstaller: Support --initrd-inject for RHEL4 (bz 866608)
RHEL4 kernels are gzip'd ext2 images, so unzip it, use debugfs to inject
files, and zip it back up. Based on shell code from Patrick J. LoPresti.
2013-09-02 16:10:28 -04:00
Cole Robinson
288a611ff7 graphics: Fix default autoport value
default_cb doesn't want yes/no, it wants True/False
2013-09-02 11:54:02 -04:00
Daniel Gollub
1730a8e5ff virtinst: add nwfilter support
This allows to make use of libvirt network filtering support with virt-install.
With the additional option "filterref" in the --network parameter one can
configure any defined nwfilter per network interface, i.e.:
virt-install ... --network network=mynet,model=virtio,filterref=clean-traffic

(crobinso: add an xmlparse test case)
2013-08-29 11:44:40 -04:00
Cole Robinson
9d11c7eae3 virtinst: Add DomainSnapshot object and some plumbing
Just for parsing domainsnapshot XML and performing some support checks
2013-08-21 18:26:27 -04:00
Martin Kletzander
3b9c397d11 Handle storage formats properly
This simple patch fixes three issues:

 1) We used only one list of storage formats.  However, we are able to
    use some formats which we cannot create.  This patch adds a list
    called 'no_create_formats' and moves such formats (currently only
    one) into it and uses new parameter 'create' which describes
    whether such formats should be removed or not.

 2) When creating new storage with the above fixed, we need to set the
    combobox's text to "" in order not to change it to "raw".  This
    was already done in reset_state(), but we need it also when
    toggle_storage_select() happens and it doesn't hurt in
    set_initial_state(), so I abstracted the implementation into
    populate_disk_format_combo().

 3) It's a bit unrelated, but when bus of a domain disk gets changed
    (in details.py), the address was not cleaned up properly ('target'
    attribute was still kept), so I fixed up the VirtualDeviceAddress
    as well.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=907289
2013-08-21 11:12:42 +02:00
Martin Kletzander
64b1ca15f2 Fix UUID generation according to RFC 4122
In commit 74aa8c8a, I somehow made an off-by-one error even though
that code was almost copy-paste from libvirt's commit 396c4d34.
2013-08-19 10:56:56 +02:00
Cole Robinson
8460af9a99 VirtualWatchdog: Add dump action 2013-08-18 16:06:18 -04:00
Cole Robinson
e52f6050fa qemu ARM support: wire up virtio, fix a bunch of defaults
This has some fallout on non-x86 tests which were wrong to begin with.
There's still some missing bits but this is the jist of it.
2013-08-18 12:30:58 -04:00
Cole Robinson
414f6bbd99 guest: Use virtio on plain qemu on x86
It's been available for a long long time, and unifies code paths.
2013-08-17 18:00:31 -04:00
Cole Robinson
a8858cd366 osdict: Don't run support checks, make the caller do it
Some ARM bits we are about to add would substantially complicate the
current setup, so move all the logic into guest.py where we can be
more flexible. I think this is closer to what libosinfo will give us
as well.
2013-08-17 17:53:17 -04:00
Cole Robinson
3130f64e35 VirtualDisk: Add is_disk, is_cdrom, is_floppy helpers 2013-08-17 14:21:30 -04:00
Cole Robinson
c67bd587b7 osdict: Add solaris 11 (bz 894017) 2013-08-17 10:37:59 -04:00