In Python 2 comparison between int and None is allowed but in
Pyhton 3 it is not.
Example:
Pyhton 2
>>> None > 0
False
Python 3
>>> None > 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>' not supported between instances of 'NoneType' and 'int'
We cannot use os.statvfs() if the clone disk is a block device because
it gets stats about filesystem which in this case is "devtmpfs" mounted
as "/dev".
As a workaround we can seek to the end of the block device to get
the actual size.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450908
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
If we convert to long the disk size, it may end up "0". The size is
in GiB so it can be "0.1".
Introduced by commit <fab55c128ff3f092039bb950ecfd337568d2a9a8>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
On a host system with keyboard configured to en-US, it was noticed
that virt-install created install XML with keymap='de'. The host
system did not have /etc/vconsole.conf, so /etc/sysconfig/keyboard
was the next file to check, which contained the following
KEYTABLE=""
Currently the parsing code does not ignore comments and incorrectly
parsed a 'de' keymap. Fix by ignoring any lines that start with '#'
after trimming whitespace.
The current order of check operations is wrong. First we set the new
path for the disk in question and after that we check whether some
guest already uses a disk with the same path.
The issue is that virt-manager returns a cached list of guests in
path_in_use_by() and the cached guest has the disk path already
updated.
Ideally we don't update the path at all, but we do it to run some
checks before the path is actually changed. In order to fix the
referenced bug, change the order of check operations.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1453094
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
libvirt supports guest CPU cache by commit df13c0b, So add this feature
to virt-install to configure cpu L3 cache mode.
Currently, The valid values are 'passthrough', 'emulate' or 'disable'.
say:
--cpu host-passthrough,cache.mode=passthrough
or
--cpu $CPU,cache.mode=emulate,cache.level=3
or
--cpu $CPU,cache.mode=disable
Signed-off-by: Lin Ma <lma@suse.com>
The Ubuntu c recognition was looking for a file .disk/mini-info.
However, the correct name is .disk/info.
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
If initialization of new object fails we put it into blacklist and
newer parse it again until virt-manager is restarted. This helps to
reduce number of failures if some object fails initialization every
time.
However, there are some cases where we put object into blacklist
incorrectly. One of the cases is while creating new storage pool.
If the storage pool requires to be build before started but user
doesn't check to build it as well the start of the new storage pool
fails. The issue is that at first we define that object which triggers
a lifecycle event for storage pool and queues new poll operation over
storage pools. Before the poll operation starts the starting of the
storage pools fails and we undefine that storage pool before it is
initialized. The initialization fails and the storage pool is never
managed from that point.
This patch modifies the blacklist to allow 3 failures before we give up
on a specific object and if the object is initialized without error
we remove it from blacklist completely.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1446486
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1093394
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Graphics devices has a new XML element to configure UNIX socket path:
<graphics type='vnc' socket='/path/to/socket'>
<listen type='socket' socket='/path/to/socket'/>
</graphics>
<graphics type='spice'>
<listen type='socket' socket='/path/to/socket'/>
</graphics>
and as you can see SPICE uses only the new XML element. For VNC the
old 'socket' attribute is for backward compatibility.
In order to connect to SPICE graphics on remote host using SSH tunnel
we need to get the UNIX socket path from <listen> element.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1441127
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>