Commit Graph

642 Commits

Author SHA1 Message Date
Chen Hanxiao 2987c721fb virtinst: fix a pylint warning
fix a "attribute-defined-outside-init" warning.
We set installer.livecd in virt-install.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-09-11 09:33:50 +08:00
Cole Robinson db41d9459f cli: Don't error if logfile setup fails (bug 1138991)
If the logfile is owned as root, like could happen if the first run of
virt-manager is done via 'su -c' or similar, virt-manager refustes to
start on subsequent runs under reduced privs. Just log an error and
skip the logfile setup if that happens.
2014-09-08 10:51:34 -04:00
Cole Robinson 17f57eaaa7 Centralize call to setup_i18n in virtinst __init__
No need to call it twice
2014-09-08 10:42:44 -04:00
Cole Robinson d9ca950acb distroinstaller: Don't attempt distro detection for remote CDROMs
We shouldn't access the local disk in this case
2014-09-07 16:16:39 -04:00
Cole Robinson d8d6af55e5 distroinstaller: Cache fetcher and distro store lookups
Since we already determine the distro store ahead of time via
check_location and detect_distro, cache the result in the installer
class to save us some network traffic.
2014-09-07 14:40:09 -04:00
Cole Robinson 050d0fb16e urlfetcher: Make fetcher cleanup idempotent 2014-09-07 14:22:56 -04:00
Cole Robinson faa0ef5e55 urlfetcher: Point to man page if location URL is invalid 2014-09-07 14:01:40 -04:00
Cole Robinson 46e135c7a1 urlfetcher: Remove outdated comment 2014-09-07 13:59:54 -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 1247e8d43e installer: Don't needlessly pass around scratchdir 2014-09-07 13:35:34 -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
Cole Robinson bfb3174ec2 osdict: Manually tweak 'supported' info
Many old OSes don't have an EOL date tracked with libosinfo, and
we just treat them as 'supported'. So the default distro list in
the create wizard is wayyy too huge and contains all sorts of
crazy options.

Assume lack of EOL date means 'unsupported', and add a manual whitelist
for some still common distros. We will fix this at the libosinfo level.
2014-09-07 10:49:50 -04:00
Cole Robinson eb01bc1b61 osdict: Disable virtioconsole default
We used to enable this for Fedora 18+, because systemd would
autostart a getty on /dev/hvc0 which made 'virsh console' work
out of the box for a login prompt. However now in Fedora
virtio-console is compiled as a module, and systemd doesn't
detect it in time to start a getty. So the benefit of using
it as the default is erased, and we reverted to this.

More info: https://bugzilla.redhat.com/show_bug.cgi?id=1039742
2014-09-06 18:37:20 -04:00
Cole Robinson 5aafe008bc Remove virt-image, as scheduled
As promised with the last release, remove virt-image. In 6 months I didn't
hear a peep from any actual users that cared.
2014-09-06 18:05:43 -04:00
Cole Robinson 2e7d477156 urlfetcher: Bunch of distro detection fixes
And update test_urls to ensure it's passing
2014-09-06 16:42:09 -04:00
Cole Robinson 95f8b4c6b0 distroinstaller: Fix https:// installs 2014-09-06 15:08:40 -04:00
Cole Robinson f2f2c1fd95 Fix some pylint 2014-09-06 13:47:10 -04:00
Cole Robinson 7d25dbe7a3 osdict: Always use vmvga for ubuntu
There's been a couple reports recently that virt-manager's default of video
model=qxl doesn't work well with latest ubuntu 14.04:

https://bugzilla.redhat.com/show_bug.cgi?id=1129803
https://lists.fedoraproject.org/pipermail/virt/2014-August/004105.html

However vmvga works, so let's use it for all ubuntu versions and not just a
couple of them. Marc Deslauriers confirmed it should be safe.
2014-09-06 13:45:15 -04:00
Cole Robinson d89888a7bd osdict: Don't force encode cirrus as the video default
Forcing cirrus isn't correct for non-x86 architectures, so let's have
libvirt fill in the default so there's only one place to fix it.
2014-09-06 13:45:15 -04:00
Cole Robinson 0759a31acc osdict: Turn videomodel check into a function
The previous setup of having an OS register a preferred videomodel is
overly simplistic and doesn't cover all our needs. Rework it without any
logic change for now, we will alter the logic in subsequent commits.
2014-09-06 13:45:15 -04:00
Cole Robinson d1f46a75e7 cli: Don't rely on libvirt to generate MAC if mac=RANDOM (bz 1130449) 2014-08-15 15:02:57 -04:00
Giuseppe Scrivano c1fd79c4f7 virtinst, snapshot: do not hardcode the value of VIR_DOMAIN_PMSUSPENDED
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-08-01 09:30:21 +02:00
Chen Hanxiao cff8e32c55 virt-install: support setting hugepages/page/[@size, @unit, @nodeset] for memorybacking
libvirt commit
136ad49740f017aabcac48d02d2df6ab7b0195e9
introduce ./hugepages/page/[@size, @unit, @nodeset]
for memory backing.
This patch will add support in virt-install.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-07-30 14:34:03 +08:00
Chen Hanxiao 5f3ede96de storage: fix a typo
s/paramaters/parameters

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-07-28 16:55:28 +08:00
Giuseppe Scrivano 148576d69e virtinst, clone: use the specified MAC address for the new VM
Prevent setup_clone from changing the self._clone_macs list so that
further calls will access the same data.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-07-28 10:38:31 +02:00
Cole Robinson 5f81c4bdc0 virtinst: cli: Tweak some command line strings and indentation 2014-07-15 09:25:20 -04:00
Cole Robinson 8ea634f9e4 guest: Enable Hyper-v Enlightenments for Windows VMs
These are the recommended defaults for all windows VMs, when using
a new enough libvirt + kvm. Some more details in this boxes bug report:

https://bugzilla.gnome.org/show_bug.cgi?id=732811
2014-07-07 18:24:40 -04:00
Cole Robinson 1e77c05c4e Clarify some translation strings, reported on transifex 2014-07-04 16:42:24 -04:00
Giuseppe Scrivano 3606bb573d virtinst: add method to set connection keep-alive
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-07-02 15:31:40 +02:00
Ron ea1d973957 Don't create disk images world readable and executable
Python's os.open() defaults to mode 0777 if not explicitly specified.
Disk image files don't need to be executable, and having them world
readable isn't an ideal situation either.  Owner writable and group
readable is probably more than sufficient when initially creating
them.

Signed-off-by: Ron Lee <ron@debian.org>
2014-07-02 07:35:15 +02:00
Chen Hanxiao ddd88dac25 storage: fix another comment typo
s/explictly/explicitly

Thanks for Giuseppe's reminding.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-30 16:20:38 +08:00
Chen Hanxiao 7ce434fed7 urlfetcher: fix a comment typo
s/Explictly/Explicitly

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-30 10:58:53 +08:00
Giuseppe Scrivano 57d26e6265 virtinst: parse "bandwith" node in network definition
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-06-26 15:26:37 +02:00
Chen Hanxiao 75d43f6a37 fix some missed binary prefixes for units
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-17 09:33:14 +08: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
Chen Hanxiao d3d76beb5b guest: fix order in _XML_PROP_ORDER
re-order xml values according to libvirt code.

a) move "blkiotune" "memtune" ahead of "memoryBacking"
b) move "resource" ahead of "pm"

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-05 08:52:24 +08:00
Chen Hanxiao d1b0fade1d virt-install: add --resource support
This patch will enable setting
resource partition configuration.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-04 10:08:05 +08:00
Cole Robinson 809c5a81e5 diskbackend: Fix pool 'create' call (bz 1103442) 2014-06-03 16:26:28 -04:00
Cole Robinson aefd4c4824 connection: Use name instead of uuid for object keys
And clean up the API mess while we are at it. Treat the key as an opaque
value that users shouldn't depend on.

Besides the improved code clarity and API layout, this will help diagnose
'key error' issues, since we'll see an object name instead of UUID which
is hard to trace back.
2014-06-02 17:48:32 -04:00
Cole Robinson d3e9af8328 pollhelpers: Use correct dictionary keys for old pool/net polling (bz 1099827)
We were inadvertently using the object name rather than UUID when libvirt
didn't support new style polling APIs.
2014-06-02 12:18:59 -04:00
Cole Robinson d3e55a1fbf pollhelpers: Add debugging helper to force old polling 2014-06-02 12:02:09 -04:00
Cole Robinson da73e4980b virt-install: Add --boot initargs=
Expects a shell escaped string which we split into individual initarg bits
2014-05-31 17:15:03 -04:00
Cole Robinson ceab99cf7b virtconv: Don't create default pool when in dry mode
We will still need to create pools to probe source storage if doing
--print-xml.
2014-05-31 16:30:00 -04:00
Cole Robinson d6f063d0b8 diskbackend: If pool not running, start it
Nowadays we depend on the pool existing and running, so better to get
an error up front if pool startup will fail
2014-05-31 16:29:29 -04:00
Cole Robinson 42fe235cbf virt-install: Add --network portgroup= option 2014-05-31 14:30:07 -04:00
Cole Robinson 1c608f3ba8 network: Parse <portgroup> XML 2014-05-31 14:20:56 -04:00
Chen Hanxiao 33c7e63a99 cli: fix some style misc issue
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-05-29 17:06:13 +08:00
Chen Hanxiao 3c45262526 virt-install: add --events support
This patch will enable setting event configuration:
on_poweroff, on_reboot and on_crash.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-05-29 09:46:24 +08:00
Giuseppe Scrivano b84f8cb406 osdict: fix default value for devices data
commit 4f056dcba9 didn't take into
account the default value.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-05-21 10:09:41 +02:00
Giuseppe Scrivano 4f056dcba9 osdict: lazy load devices data
Do not load the devices data for each OS as most of this data will
will not be used by virt-manager.  It makes the "Create new VM" wizard
faster on the first time it is accessed (~0.5s faster on my machine).

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-05-20 08:41:22 +02:00
Cole Robinson ea89dfb53f tests: Don't fail on non-latest libvirt 2014-05-11 19:11:45 -04:00
Cole Robinson 196ff823b3 Fix warnings with latest pep8 2014-05-02 10:20:59 -04:00
Cole Robinson feadd98fed Fix using storage when the directory name contains whitespace (bz 1091384) 2014-04-29 14:09:14 -04:00
Jim Minter 764063dfe9 virt-install --disk discard= support
(crobinso: Remove default overriding, add test cases)
2014-04-29 10:38:30 -04:00
Cole Robinson 6ed988ebfc osdict: Prevent traceback in the logs when detection fails 2014-04-25 16:31:00 -04:00
Cole Robinson e6a67fc709 filesystem: Fix target validation when editing device (bz 1089422) 2014-04-21 16:51:57 -04:00
Giuseppe Scrivano e980d9c737 virtinst: display the domain for PCI devices
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1085499

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-04-15 18:53:26 +02:00
Giuseppe Scrivano 1d312a520e virtinst: early detect ftp connection errors
It fixes two problems:

i) "ftp://" was accepted as valid URL but then it causes this
exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ftplib.py", line 387, in login
    resp = self.sendcmd('USER ' + user)
  File "/usr/lib64/python2.7/ftplib.py", line 243, in sendcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 178, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 173, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'

ii) only a cryptic error message "Unable to complete install: '[Errno
-2] Name or service not known'" was showed to users when the DNS
lookup failed.  The exception is now intercepted and decorated with
more information.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-04-14 15:20:18 +02:00
Chen Hanxiao 35c9afad45 test: fix a pylint
After commit 7594cef35f,
pylint show a "access to a protected member" warning.
This patch introduces a static method to solve it.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-04-10 23:15:55 +08:00
Roman Bogorodskiy 7594cef35f tests: fix TestCapabilities.testCPUMap
testCPUMap() tries to open /usr/share/libvirt/cpu_map.xml file
and that fails if libvirt is not installed on the system
or cpu_map.xml path is different.

Force it to use tests/capabilities-xml/cpu_map.xml file instead.
2014-04-08 18:13:03 +02:00
Cole Robinson a398d245cb Clean up pylint integration
- Drop no longer needed disable= bits
- Use string names for all skipped pylint messages
2014-04-02 19:00:24 -04:00
Chen Hanxiao 89c45af26d interface: check ip address format
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-31 22:25:36 +08:00
Giuseppe Scrivano 5120b90fc3 osdict: lazy load data from libosinfo
I've noticed that virt-manager took more time to startup after we
started reading OSes data from libosinfo.

Now the libosinfo data is loaded the first time it is accessed,
without pre-loading it.

This could be further improved by not loading completely an _OsVariant
object but only the data that is requested.

With the lazy load optimization (best of 10 attempts):

$ echo yes | time ./virt-xml --connect __virtinst_test__test:////home/gscrivano/src/virt-manager/tests/testdriver.xml,predictable --confirm test --edit --cpu host-passthrough > /dev/null
0.13user 0.02system 0:00.22elapsed 74%CPU (0avgtext+0avgdata 26756maxresident)k

Without (best of 10 attempts):

$ echo yes | time ./virt-xml --connect __virtinst_test__test:////home/gscrivano/src/virt-manager/tests/testdriver.xml,predictable --confirm test --edit --cpu host-passthrough > /dev/null
1.26user 0.04system 0:01.36elapsed 95%CPU (0avgtext+0avgdata 57996maxresident)k
0inputs+16outputs (0major+17499minor)pagefaults 0swaps

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-29 21:28:50 +01:00
Giuseppe Scrivano a3e1444a28 osdict: handle libosinfo lookup failure
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-26 16:12:13 +01:00
Giuseppe Scrivano 6f52478b19 virtinst: DistroInstaller uses libosinfo detection first
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-26 16:12:13 +01:00
Giuseppe Scrivano af216ebaf6 osdict: add new function lookup_os_by_media
"lookup_os_by_media" fetches the OS of the installation media by
querying libosinfo.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-26 10:51:40 +01:00
Marc-André Lureau 2236275d4c addhw: add CharDevice "spiceport" type
Add a new channel type "spiceport".

Adding a new virtio channel of name org.spice-space.webdav.0 connected
to a Spice port with the same name allows the Spice client to share a
folder.
2014-03-25 17:42:57 -04:00
Marc-André Lureau 5882f05e3e addhw: add CharDevice.source_channel
This property maps to channel/source/@channel domain XML.
2014-03-25 17:42:57 -04:00
Chen Hanxiao e4e39b777d osdict: fix a typo
s/inheiriting/inheriting

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-25 22:34:35 +08:00
Giuseppe Scrivano 2374f8458e osdict: expose libosinfo recommended resources for an OS
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:42 +01:00
Giuseppe Scrivano db6d001b0e tests: fix to not fail with libosinfo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:42 +01:00
Giuseppe Scrivano ad0575f731 virtinstall: add some quirks
It also adds aliases for OS names that are different under libosinfo
to maintain backward compatibility.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:42 +01:00
Giuseppe Scrivano 28273e3374 virtinstall: read OSes information from libosinfo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:41 +01:00
Giuseppe Scrivano 517bbad087 virtinstall: allow to redefine typename in _OSVariant
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:41 +01:00
Cole Robinson b49f647e0c details: Fix unsetting autoport values 2014-03-22 18:29:08 -04:00
Cole Robinson 9050998028 cli: Rename --membacking to --memorybacking
More consistent with the existing --memory option, and the
XML block name.
2014-03-22 12:28:23 -04:00
Cole Robinson a5b3c1d2f8 guest: Drop back compat hugepage attribute 2014-03-22 12:25:28 -04:00
Cole Robinson d1749c614d cli: Move hugepages=on example to membacking 2014-03-22 12:19:44 -04:00
Chen Hanxiao 7096c3708e virt-install: Add --membacking option
Add option --membacking for "Memory Backing".

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-22 12:16:24 -04:00
Chen Hanxiao 58a07d04fb remove memoryBacking parameters from --memory
Remove some "Memory Backing" parameters from --memory,
and keep 'hugepages' for backward compatibility.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-22 12:16:24 -04:00
Cole Robinson 8562c3258e More pylint fixes 2014-03-22 11:21:19 -04:00
Cole Robinson d763126862 Turn off some warnings with latest pylint 2014-03-22 10:01:19 -04:00
Cole Robinson a99da363a4 capabilities: Handle arch=none for CPU lookup 2014-03-20 14:04:29 -04:00
Cole Robinson 1f5b07bea8 capabilities: Handle broken return value of failed CPUModelNames 2014-03-20 14:04:29 -04:00
Cole Robinson 994b1fa4f4 connection: Add explicit API for getting virConnect object 2014-03-20 14:04:29 -04:00
Giuseppe Scrivano ef2206a8f5 virtManager: read the reason for the domain state
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-20 08:48:47 +01:00
Chen Hanxiao 008feeb09a Add more parameters for memoryBacking
Add support for parameters nosharepages and locked
if using option --memory.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-03-14 21:23:23 +08:00
Giuseppe Scrivano 81696a5144 virtinst: use libvirt getCPUModelNames when available
Read the list of CPU models trough getCPUModelNames instead of
accessing directly the file cpu_map.xml.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-13 19:00:54 +01:00
Giuseppe Scrivano 6c2645f0d2 virtinst: drop parsing of cpu features
As for the previous patch, this information is not used anywhere and
this information should be retrieved using the libvirt baselineCPU
API.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-13 16:50:40 +01:00
Giuseppe Scrivano 143a689592 virtinst: drop cpu_map parsing of arch features
This information is not used anywhere and there is no way to read
it directly from libvirt without parsing the cpu_map.xml file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-13 16:50:37 +01:00
Giuseppe Scrivano 75349b9cf0 lxc: define a private network for OS containers
By default, specify the the "<privnet>" feature with LXC operating
system containers.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1040406
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-10 15:48:42 +01:00
Cole Robinson 797afb3b27 virt-install: Fix --location iso again, and test it (bz 1071513) 2014-03-06 12:46:46 -05:00
Cole Robinson df7012a68b Handle libvirt generating invalid volume XML (bz 1072770) 2014-03-06 12:04:08 -05:00
Cole Robinson 75a2e12dc0 tests: Fix a few failures with older libvirt 2014-03-06 11:29:23 -05:00
Cole Robinson b4e4f68376 cli: Add --graphics defaultMode 2014-02-27 17:43:59 -05:00
Chen Hanxiao c1e7da72b7 cli: add missing remove_first method for --blkiotune
Add missing remove_first method for --blkiotune.
Update related man pages.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-26 09:38:20 +08:00
Cole Robinson a2ab8a2643 tests: 'skip' a test if compare check fails
And make latest tests dependent on libvirt.git version
2014-02-25 15:05:58 -05:00
Cole Robinson 0b94c83beb xmlbuilder: Actually import logging 2014-02-25 14:56:54 -05:00
Cole Robinson 3efbefe91a Don't forbid object names that are only all numbers (bz 1067127)
Just let libvirt error, since in the case of things like storage pools
this is totally legitimate.
2014-02-25 14:54:06 -05:00
Cole Robinson 87c2ff1a14 xmlbuilder: Log broken XML if we can't parse it
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1066564
2014-02-25 12:45:15 -05:00