Commit Graph

5224 Commits

Author SHA1 Message Date
Yuri Arabadji
4be3d030b5 cli: Add --disk logical/physical_block_size 2017-06-16 13:28:25 -04:00
Cole Robinson
4e7a6ad728 tests: pylint: Silence/fix a bunch of new warnings 2017-06-16 12:54:56 -04:00
Cole Robinson
c75b3a99b1 tests: pylint: Slim down the configuration file
Only list things that we change defaults for, or may want to in the future
2017-06-15 08:12:06 -04:00
Cole Robinson
ced1d3cadb setup: pylint: use pylint-2 binary if available 2017-06-15 08:11:34 -04:00
Pavel Hrdina
b690908aa4 virtinst: enable secure feature together with smm for UEFI
The secure feature actually enforce the secure boot if Secure Boot
Mode is configured.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-07 20:49:45 +02:00
Cole Robinson
1c22105a54 tests: inject: Update URL list 2017-06-07 12:40:46 -04:00
Cole Robinson
1d0b4a0a9e connect: Handle \ in username
We need to quote URL values in the username, that's what libvirt expects.
Unquote the values before caching them in the URI object, so console
connections continue to work

https://bugzilla.redhat.com/show_bug.cgi?id=1452389
2017-06-01 14:26:46 -04:00
Cole Robinson
860268f735 ui: create: Fix vertical alignment of storage summary 2017-06-01 13:55:41 -04:00
Cole Robinson
f30ca19b87 ui: clone: fix alignment of disk checkbox 2017-06-01 13:48:16 -04:00
Radostin Stoyanov
6f6727f78b Use consistent alignment for memory/cpu grid 2017-06-01 13:46:24 -04:00
Radostin Stoyanov
fc5ecbcdf8 Resolve incorrect label alignment
The "xalign" property determines the horizontal alignment of the label
text inside the labels size allocation. Compare this to “halign”,
which determines how the labels size allocation is positioned
in the space available for the label. [1]

When the "width_chars" property is used, labels appear to be centered.
This could be resolved when the property "width_chars" is replaced
with "max_width_chars" or removed in case "max_width_chars" is already
set. [2]

[1] https://developer.gnome.org/gtk3/stable/GtkLabel.html#GtkLabel--xalign
[2] https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkAlign
2017-06-01 13:46:20 -04:00
Pavel Hrdina
4f8e795c6a virtinst: if required by UEFI enable SMM feature and set q35 machine type
If we detect that the UEFI image is build to require SMM feature we
should configure the guest to enable SMM feature and set q35 machine
type.  Without this user wouldn't be able to boot the guest.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
24f9d05329 virt-install: add support for loader secure attribute
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Pavel Hrdina
f38c56c971 virt-install: add support for SMM feature
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-06-01 09:58:46 +02:00
Radostin Stoyanov
e7671a63ba Use GtkPaned instead of GtkHPaned
GtkHPaned was deprecated since Gtk version 3.2 and should not be
used in newly-written code.[1] Use GtkPaned instead.[2]

By default, GtkPaned's orientation is set to horizontal.[3]

[1] https://developer.gnome.org/gtk3/stable/GtkHPaned.html

[2] https://developer.gnome.org/gtk3/stable/GtkPaned.html

[3] https://developer.gnome.org/gtk3/stable/gtk3-Orientable.html#GtkOrientable--orientation
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
7b44967bf7 Use GtkSeparator instead of GtkHSeparator
GtkHSeparator was deprecated since Gtk version 3.2 and should not be
used in newly-written code.[1] Use GtkSeparator instead.[2]

By default, GtkSeparator's orientation is set to horizontal.[3]

[1] https://developer.gnome.org/gtk3/stable/GtkHSeparator.html

[2] https://developer.gnome.org/gtk3/stable/GtkSeparator.html

[3] https://developer.gnome.org/gtk3/stable/gtk3-Orientable.html#GtkOrientable--orientation
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
951d3fd4fc Remove deprecated GtkActivatable:use-action-appearance property
GtkActivatable:use-action-appearance was deprecated since
Gtk version 3.10 and should not be used in newly-written code.

https://developer.gnome.org/gtk3/stable/GtkActivatable.html#GtkActivatable--use-action-appearance
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
e6ae060ceb Convert GtkTable to GtkGrid
GtkTable was deprecated since Gtk version 3.4 and should not be used
in newly-written code. It should be replaced by GtkGrid.

https://developer.gnome.org/gtk3/stable/GtkTable.html
https://developer.gnome.org/gtk3/stable/GtkGrid.html

GtkTable is mapped to GtkGrid following these rules:
----------------
- n_(row|columns) are removed because they are not required for
  GtkGrid

----------------
- Missing "left_attach" and "top_attach" are added with value set to
  0.
  Example:
    <property name="left_attach">0</property>
    <property name="top_attach">0</property>
----------------
- (right_attach - left_attach) > 1 is stored in new "width" property

  Example:
    In case of: (GtkTable)
      <property name="left_attach">1</property>
      <property name="right_attach">4</property>

    Equivalent to: (GtkGrid)
      <property name="width">3</property>

----------------
- (bottom_attach - top_attach) > 1 is stored in new "height" property

  Example:
    In case of: (GtkTable)
      <property name="top_attach">1</property>
      <property name="bottom_attach">3</property>

    Equivalent to: (GtkGrid)
      <property name="height">2</property>

----------------
- Missing packing "(x|y)_options" property is represented as no
  "(h|v)align" object property and "(h|v)expand" object property
  set to "true"

  Example:
    In case of: (GtkTable)
      # Missing y_options property
    Equivalent to: (GtkGrid)
      <property name="vexpand">True</property>
      # No valign property

----------------
  - Packing "(x|y)_options" property set to "GTK_FILL" is represented
    as no "(h|v)expand" object property and no "(h|v)align" object
    property

    Example:
      In case of: (GtkTable)
          <property name="x_options">GTK_FILL</property>
    Equivalent to: (GtkGrid)
        # No hexpand property
        # No halign property

----------------
  - Packing "(x|y)_options" property set to "GTK_EXPAND" is
    represented as "(h|v)expand" object property set to "true" and
    "(h|v)align" object property set to "center"

    Example:
      In case of: (GtkTable)
        <property name="x_options">GTK_EXPAND</property>

      Equivalent to: (GtkGrid)
        <property name="hexpand">True</property>
        <property name="halign">center</property>

----------------
  - Packing "(x|y)_options" property set to nothing is represented as
    "(h|v)align" object property set to "center"

    Example:
      In case of: (GtkTable)
        <property name="y_options" />

      Equivalent to: (GtkGrid)
        <property name="valign">center</property>

----------------
  - All "(x|y)_options" rules apply but don't change existing
    "(h|v)align" and "(h|v)expand" object properties

----------------
  - Packing "x_padding" property is converted to "margin_(start|end)"
    object property

    Example:
      In case of: (GtkTable)
        <property name="x_padding">6</property>

      Equivalent to: (GtkGrid)
        <property name="margin_start">6</property>
        <property name="margin_end">6</property>

----------------
  - Packing "y_padding" property is converted to "margin_(top|bottom)"
    object property

    Example:
      In case of: (GtkTable)
        <property name="y_padding">6</property>

      Equivalent to: (GtkGrid)
        <property name="margin_top">6</property>
        <property name="margin_bottom">6</property>
2017-05-31 13:27:43 -04:00
Radostin Stoyanov
e3b4b2bf11 Fix typo in Pre-requisite software 2017-05-31 13:27:43 -04:00
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