Commit Graph

5305 Commits

Author SHA1 Message Date
Radostin Stoyanov
84419fe90c Remove deprecated GtkMisc:ypad property
GtkMisc:ypad was deprecated since Gtk version 3.14 and should not be
used in newly-written code. Use margin-top and margin-bottom instead.
Both have default value set to 0.

https://developer.gnome.org/gtk3/stable/GtkMisc.html#GtkMisc--ypad

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--margin-top

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--margin-bottom
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
fb46c9dc27 Remove deprecated GtkMisc:xpad property
GtkMisc:xpad was deprecated since Gtk version 3.14 and should not
be used in newly-written code. Use 'margin-start' and 'margin-end'
instead.

https://developer.gnome.org/gtk3/stable/GtkMisc.html#GtkMisc--xpad

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--margin-start

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--margin-end
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
dd59bd6267 Use valign property instead of yalign
GtkAlignment:yalign was deprecated since Gtk version 3.14 and
should not be used in newly-written code. Use valign property instead.

The behaviour of yalign='0' is identical to valign='start', similar
for yalign='1' and valign='end'. The default value of the property
valign is GTK_ALIGN_FILL which has simmilar behaviour to yalign='0.5'.

https://developer.gnome.org/gtk3/stable/GtkAlignment.html#GtkAlignment--yalign

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--valign
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
6f7fb58953 Remove redundant xalign property
GtkAlignment:xalign was deprecated since Gtk version 3.14 and should
not be used in newly-written code. Specifying halign property is not
required when xalign='0.5' because the behaviour is identical to the
default value of halign.

https://developer.gnome.org/gtk3/stable/GtkAlignment.html#GtkAlignment--xalign

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--halign
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
3243a221b5 Replace xalign='1' with halign='end'
GtkAlignment:xalign was deprecated since Gtk version 3.14 and should
not be used in newly-written code. Use halign property instead.

https://developer.gnome.org/gtk3/stable/GtkAlignment.html#GtkAlignment--xalign

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--halign
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
b6731ceaa6 Replace xalign='0' with halign='start'
GtkAlignment:xalign was deprecated since Gtk version 3.14 and should
not be used in newly-written code. Use halign property instead.

https://developer.gnome.org/gtk3/stable/GtkAlignment.html#GtkAlignment--xalign

https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--halign
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
f7bce4cca7 Use GtkButtonBox instead of GtkHButtonBox
GtkHButtonBox was deprecated since Gtk version 3.2 and should not
be used in newly-written code. Use GtkButtonBox instead. The property
orientation is set by default to horizontal.

https://developer.gnome.org/gtk3/stable/GtkHButtonBox.html
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
5a658ef6bd Format UI files with Glade 3.20
Glade performs XML formatting on save. The changes in this commit are
generated by Glade 3.20
2017-05-31 13:27:43 -04:00
Pavel Hrdina
1686511886 virtManager.connection: introduce cb_add_new_pool
The cb_add_new_pool callback will add a newly created storage pool
into virt-manager's cache so we don't have to wait for the libvirt
event to be handled.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-22 19:43:49 +02:00
Pavel Hrdina
713e07d4a2 virtinst.diskbackend: set pool after creating StorageVolume
The _pool_xml in StorageVolume is used unconditionally, we need to
set it right away.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-17 18:35:54 +02:00
Radostin Stoyanov
c5627b1fa9 Remove redundant call of strip()
Remove redundant call of the strip() function. It is already done in lines 1302 and 1303.

https://github.com/virt-manager/virt-manager/blob/master/virtManager/create.py#L1302
https://github.com/virt-manager/virt-manager/blob/master/virtManager/create.py#L1303
2017-05-17 12:26:51 -04:00
Cole Robinson
69f19ca614 tests: test_urls: Update 2017-05-16 17:16:59 -04:00
Brian 'Redbeard' Harrington
c30cdb0ccf virtinst: Fix os-variant ordering
Previously os-variant was not being set before performing location
checks.  This lead to a sitation where the os-variant data could not be
acted on.  This commit re-orders the process to ensure that the correct
ordering happens.

Previous behavior:

```
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (distroinstaller:180) DistroInstaller location is a network source.
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (distroinstaller:181) Sanitized value is https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:57) Using scratchdir=/home/bharrington/.cache/virt-manager/boot
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:477) Finding distro store for location=https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:484) Using os-variant=generic
[Thu, 11 May 2017 12:28:30 virt-install 19296] DEBUG (urlfetcher:486) Supplying urldistro=None
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:186) HTTP hasFile request failed: 404 Client Error: Not Found for url: https://example.com/repo/rhel/7/rhel-7-server-rpms/Fedora
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:145) hasFile(https://example.com/repo/rhel/7/rhel-7-server-rpms/Fedora) returning False
[Thu, 11 May 2017 12:28:34 virt-install 19296] DEBUG (urlfetcher:1114) No treearch found in uri, defaulting to arch=i386
...
```

Current behavior:
```
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (distroinstaller:180) DistroInstaller location is a network source.
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (guest:250) Setting Guest.os_variant to 'rhel7.3'
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (urlfetcher:57) Using scratchdir=/home/bharrington/.cache/virt-manager/boot
[Thu, 11 May 2017 13:20:37 virt-install 22335] DEBUG (urlfetcher:477) Finding distro store for location=https://example.com/repo/rhel/7/rhel-7-server-rpms/
[Thu, 11 May 2017 13:20:38 virt-install 22335] DEBUG (urlfetcher:499) Prioritizing distro store=<class 'virtinst.urlfetcher.RHELDistro'>
```
2017-05-16 17:16:55 -04:00
Cole Robinson
87b37f3049 urlfetcher: More debugging around urldistro prioritizing
Plus we can always depend on guest.os_variant, so drop the check
2017-05-15 08:51:00 -04:00
Pavel Hrdina
86e2c23d71 interface: don't print error for active interface without an IP address
If there is no IP address for active interface we need to skip
probing it.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-10 12:35:42 +02:00
Cole Robinson
fab55c128f Drop use of python2 long() syntax
Plus one more python3 syntax issue
2017-05-05 14:54:35 -04:00
Cole Robinson
a90d675394 Switch deprecating log.warn to log.warning
Same semantics, but the alias is deprecated
2017-05-05 14:53:28 -04:00
Cole Robinson
f551d7e55d Replace file() usage with open()
Same semantics, but the latter is needed for python3
2017-05-05 14:53:12 -04:00
Cole Robinson
55288c4551 Convert to python3 style print() syntax
Use __future__ imports to keep this working for python2
2017-05-05 14:52:37 -04:00
Cole Robinson
34c193108c Use python3 compatible octal notation 2017-05-05 14:52:11 -04:00
Cole Robinson
62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Cole Robinson
fcebefd3bb tests: Stop using deprecated assertEquals
The recommended way is assertEqual
2017-05-05 12:40:52 -04:00
Cole Robinson
ebd2f1dcee man: virt-install: Don't reference deprecated --cpuset 2017-05-05 12:21:44 -04:00
Pavel Hrdina
a2985f07e6 virtinst: add support for memory device
This is the actual memory device that is used to hot(un)plug memory
to(from) a guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-05 12:20:52 +02:00
Pavel Hrdina
3ebbeef80e virtinst: introduce support for <maxMemory> element
This element controls hot(un)plugable memory for the guest in
addition to the initial memory configured by <memory> element.

One has to configure <maxMemory> and guest numa nodes using <numa>
element to enable hot(un)plug of memory modules.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-05 11:49:27 +02:00
Pavel Hrdina
07eecfdcc7 virtinst.cpu: don't validate "cpus" for NUMA cells
This attribute doesn't set pinning to host CPUs, it configures which
guest vCPUs should belong to that guest NUMA node.  If a guest has
more vCPUs than host you wouldn't be able to configure all guest
vCPUs to the NUMA nodes for guest.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-05-04 19:09:27 +02:00
Lin Ma
733d541624 network: add support for network forward mode 'open'
libvirt added network forward mode 'open' by commit 25e8112d, No any
iptables rules are added to this virtual network.

This patch adds support to create such a virtual network.

Signed-off-by: Lin Ma <lma@suse.com>
2017-05-03 14:15:02 -04:00
Lin Ma
ea85a3c680 tests: add test for network forward mode 'open'
Signed-off-by: Lin Ma <lma@suse.com>
2017-05-03 14:08:42 -04:00
Lin Ma
be6566a134 testdriver: Add network example of open network forward mode
Signed-off-by: Lin Ma <lma@suse.com>
2017-05-03 14:08:38 -04:00
Pavel Grunt
1f68cf2b01 Do not use deprecated gdk_cursor_new
It relies on the presence of X cursor fonts in the system. Use
recommended gdk_cursor_new_from_name and use cursor names that works
on different backends.

Deprecated since Gdk 3.16

https://bugzilla.redhat.com/show_bug.cgi?id=1442612
2017-05-03 13:38:23 -04:00
Chen Hanxiao
645edb176d domain: treat VIR_DOMAIN_CRASHED not as runnable but rather as stoppable
If we set on_crash as `preserve`, we'll get a crashed
VM state.
At this time, it's impossible to start this VM.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-05-03 13:38:07 -04:00
Pino Toscano
7866cfec1b osdict: add "macos" type
Give macOS OSes an own type, so they have their own entry in the list of
OS types.
2017-04-27 15:57:40 -04:00
Pino Toscano
fa9ee6cd94 osdict: rename "unix" type to "bsd"
It really holds BSD OSes, so rename it to match the reality.
2017-04-27 15:57:40 -04:00
Pino Toscano
0eabf343ee create: refactor combobox with distros
When showing all the OSes, the list of distributions for some types of
OSes (Linux, UNIX) will get insanely long, and thus very hard to scroll.
As solution, introduce groups for some of the OS families, leaving the
ones without a defined group into a "Others" group.

To keep the completion working in the editable combobox, add a separate
completion model for the completion entry, providing all the OSes
directly there as simple list.

There are a number of changes related to this:
- the model for the OS comboboxes is now a TreeStore, and the iterations
  on the OS variant keep that into account
- there are better UI labels for OS types and groups
- when there are no groups for a type, add all the OSes directly, just
  like now
- optimize the way types are added to the combobox: when not adding all
  of them, filter out those not "supported"
- optimize the way OSes are added to the combobox: query only for the
  list we need (supported or all, not both), and group them according
  to the hash defined
- add separator + "show all" options only when not showing all of them
- _add_os_row now is called only when needed, so remove its "supported"
  parameter
2017-04-27 15:57:40 -04:00
Pino Toscano
03c9a4ff41 osdict: expose the distro from OsVariant
This is used already internally a couple of times, and will be useful
outside as well.
2017-04-27 15:57:40 -04:00
Cole Robinson
7a4acfcd0c devicedisk: Raise proper error on invalid source_volume (bz 1445198)
https://bugzilla.redhat.com/show_bug.cgi?id=1445198
2017-04-27 15:44:46 -04:00
Cole Robinson
cd0e3a897c sshtunnels: Detect listen type=none for VNC (bz 1445714)
https://bugzilla.redhat.com/show_bug.cgi?id=1445714
2017-04-27 15:29:05 -04:00
Cole Robinson
c0a3234633 baseclass: share wizard cursor setting code 2017-04-27 15:00:17 -04:00
Cole Robinson
8181e86098 guest: Only use define+start logic for vz
Handling this for qemu, which may need UNDEFINE_NVRAM flags to do
the cleanup, is a pain, so move this logic to only apply to vz
driver which doesn't support createXML

Mentioned on list: https://www.redhat.com/archives/virt-tools-list/2017-April/msg00037.html
2017-04-27 14:59:41 -04:00
Cole Robinson
7aee124d9a cli: Don't double warn when skipping disk size warning (bz 1433239) 2017-04-27 12:19:53 -04:00
Cole Robinson
4c4d31d67d tests: Fix after vmvga change 2017-04-19 14:08:04 -04:00
Bryan Quigley
984ba6b33e osdict: Remove ubuntu vmvga usage
This is now removed in patches on Ubuntu, so seems no longer necessary.

virt-manager-1.3.2/debian/patches/virtinst/use_qxl_for_ubuntu.patch

That patch is also from Marc Deslauriers on 2016-01-28
2017-04-19 10:03:17 -04:00
Cole Robinson
93085d2b9d guest: Don't repeatedly overwrite self.domain
Since clearing it is important, just set it at the end when things
have succeeded
2017-04-13 14:56:03 -04:00
Christophe Fergeau
2099a1946e Reset Guest.domain to None on domain creation error
When an error occurs when the VM creation wizard tries to start the VM,
it's then not possible to press again the "Finish" button to try again
to start it, as this errors out with:

Traceback (most recent call last):
  File "/home/teuf/redhat/virt/virt-manager/virtManager/asyncjob.py", line 88, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/home/teuf/redhat/virt/virt-manager/virtManager/create.py", line 2341, in _do_async_install
    guest.start_install(meter=meter)
  File "/home/teuf/redhat/virt/virt-manager/virtinst/guest.py", line 457, in start_install
    raise RuntimeError(_("Domain has already been started!"))
RuntimeError: Domain has already been started!

This is caused by code introduced in commit fc6778 which does not reset
self.domain to None when an exception is caught.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-13 14:24:40 -04:00
Pino Toscano
6b23810733 virtinst: tweak distros in the 'supported' workaround
- pick only the latest version for centos6.x, centos7.x, and
  freebsd11.x; the latter two have only one element each currently,
  so this is preparing for future versions
- bump the minimum supported version of Fedora to 24
- enable also mageia >= 5, and centos >= 7.0, since they are supported

Hopefully in the future we can reduce these checks (maybe accepting
directly some families), but for now improve our hacks.
2017-04-13 14:20:02 -04:00
rst0git
04d46d4baa Replace GtkHBox and GtkVBox with GtkBox.
Problem:
    - GtkHBox and GtkVBox have been deprecated since version 3.2 and should not be used in newly-written code.

Solution: Replace GtkHBox and GtkVBox with GtkBox.
    - I have used the find function in text-editor to find all occurances of "GtkVBox" and "GtkHBox" then replaced them with "GtkBox".
    - Then append on a new line immediately after "<property name="orientation">...</property>" with value "horizontal" or "vertical" accordingly.
2017-04-12 09:22:56 -04:00
Cole Robinson
ff3b4dc5b0 cli: Don't overwrite install bootorder with manual --boot (bz 1438946)
--boot should be for post-install bootorder only

https://bugzilla.redhat.com/show_bug.cgi?id=1438946
2017-04-04 18:22:15 -04:00
Rowan Potgieter
a98b456975 Add x86_64 check to urlfetcher to cater for Ubuntu 16.04 2017-04-04 15:24:05 -04:00
Cole Robinson
6d1a3db421 createnet: Cleanups around hostdev UI 2017-04-04 15:20:33 -04:00
Lin Ma
97c8412df6 network: add support to create SR-IOV VF pool
Create a network with a device pool containing all the VFs of an SR-IOV device.

Signed-off-by: Lin Ma <lma@suse.com>
2017-04-03 19:15:11 -04:00