Commit 839ce682 removed deprecated support of save/restore which was replaced by
managedsave feature. This is a leftover that wasn't removed together with that
commit.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1340356
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Commit a0c2fdf4 fixed a bug that there was no way how to close the app.
The original issue isn't present anymore but reverting that commit isn't
enough. We need to increment/decrement window count while
showing/closing the create window in order to not exit right after
the create window is opened.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1331707
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
- If connecting remotely but graphics has no listen address,
like the spice GL case.
- Trying to connect to a TLS using VM over an ssh tunnel, it doesn't
seem to work: https://bugzilla.redhat.com/show_bug.cgi?id=1320331
Basically reverting this commit:
commit 1c8bf88db7
Author: Cole Robinson <crobinso@redhat.com>
Date: Tue Jun 18 08:46:24 2013 -0400
baseclass: Add unregister wrappers for idle and timeout
If an idle handler raises an exception, it isn't unregistered and loops
forever. This is a regression from previous pygobject and pygtk:
https://bugzilla.gnome.org/show_bug.cgi?id=702552
Work around this for now with our own wrappers.
Commit 159e4af1 fixed a case where VM was started if user destroyed VM
while installing it. This moves the code before we check whether we
need to restart the VM in order to continue in installation (windows
requires that).
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1235238
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This is largely left over from the old days when a xen VM could
start up but still take a bit of time for the allocated VNC port
to be reflected in the XML.
This may still be an issue with old old xen, but I suspect it's
not relevant for anything modern, and it causes some issues with
listen=none behavior that spice supports. Just drop it and see if
anyone complains
Function virDomainOpenGraphicsFD() from libvirt can return -1
But in this case libvirt-python will raise an exception.
We should handle this case and return -1 as invalid FD.
In commit 5c451b64 Viewer._open() there is a code to open
graphics console in case of invalid GraphicsFD.
(crobinso: also log the error message)
So far we used only the last --extra-args argument from virt-install
command line, but it makes more sense to use all occurrences of
--extra-args and pass them to kernel.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This allows to connect to VM without any display listening socket, the
fd passing is done through libvirt connection.
Furthermore, since it uses unix socket, spice can use virgl locally
with texture sharing. This effectively enables spice-gtk to display
local virgl rendering.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
In case that libvirtd is stopped, we could receive another type of error
from libvirt "libvirtError: internal error: client socket is closed".
This one is usually reported from local connection.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
libvirt does not allow this and attempt to do so causes error during domain
startup. Prevent this in the beginning instead with correct explanation.
Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
So I was confused here and completely missed that GtkApplication is
meant to handle the common case of invoking actions in an existing
app instance. So drop the manual dbus server and use the simpler
Gtk support.
Fix a bunch of other errors in this area too
Traceback (most recent call last):
File "/home/crobinso/src/virt-manager/virtManager/details.py", line 1257, in switch_page
self.console.details_refresh_can_fullscreen()
File "/home/crobinso/src/virt-manager/virtManager/console.py", line 965, in details_refresh_can_fullscreen
return self._refresh_can_fullscreen()
File "/home/crobinso/src/virt-manager/virtManager/console.py", line 464, in _refresh_can_fullscreen
self.widget("control-fullscreen").set_sensitive(allow_fullscreen)
TypeError: Argument 1 does not allow None as a value
This allows virt-manager command line that launch windows to work for an
existing virt-manager instance. This is handy for scripting, and giving
other apps a reasonable way to launch a virt-manager VM window for
example.
This UI exposed the old NUMA allocation policy detailed in the last commit.
It's very much sub-optimal, and should be removed.
Manual cpuset configuration is also quite uncommon and not really something
worth exposing in the UI. It can easily be done from the command line
with virt-xml.
If people complain, I'd consider adding a checkbox for vcpu placement=auto,
or an option to do that by default for new VMs.
Currently we show channel label by its name.
If we use name com.redhat.spice.0 but set it
as unix socket, the label in details keep unchanged.
This patch will set label according to device type
if we failed matching target_name
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Most of this is lifted from 'meld'. The bits are
- compile gsettings schemas at setup.py install time
- add options to disable that, and use them in the RPM
- always pass GSETTINGS_SCHEMA_DIR so gsettings loading always works
regardless of the install dir
https://bugzilla.redhat.com/show_bug.cgi?id=1267377
Since qemu has the setuid qemu-bridge-helper, give a way in the UI
to specify a manual bridge name for qemu:///session. Might not work
all the time but at least the users can try
https://bugzilla.redhat.com/show_bug.cgi?id=1212443
Simplest is to have a separate UI area for the arch warning, since
the standard startup warning may still apply too.
Reported-by: João Pirralha <joaopirralha@gmail.com>
pygobject doesn't seem to choke on debug_leak_check anymore, so we
can use it to find object leaks. just doing a few for now since it's
generally not a big deal.
This is so we can drop the dep on system python-urlgrabber, which will
block us from going to python3.
All we need is like 300 lines from python-urlgrabber for the progress
bar. In reality our needs are much lower, we don't need the fancy
progress bar that urlgrabber provides, but it's nice to have. So if
keeping a copy of this code causes issues in the future, we can probably
come up with something simpler (or hopefully there's a more common
python progressbar impl that we can use at that point).
It happens every now and then that a libvirt bug means calling XMLDesc
on an object will always fail. For example:
https://bugzilla.redhat.com/show_bug.cgi?id=1225771
We don't handle this very well and it can bleed into many other parts of
the code in a bad way. So if the initial polling of the object fails,
blacklist it entirely and ignore it for all future polling.
Originally this made sense, as it was the only way to specify a non-default
storage format when creating new storage.
Nowadays the storage browser is a full featured storage manager... and
this field is a bit confusing WRT whether it's used for creating new
storage, or informing libvirt about an existing image's format.
Drop it from the addhardware wizard, and simplify what we show in the
details wizard as well.
This is a little low level and rarely used IMO to have it in the UI.
If people want to edit this we should point them at virt-xml which
seems like the appropriate user friendlyness for this feature.
This made more sense when raw was the disk image default, but nowadays
we use qcow2 which doesn't even support non-sparse, so the UI is always
disabled.
If the user changed their preference to raw, it still doesn't make much
sense to show the option, since they are likely using raw for performance
in which case they are going to want to preallocate anyways.
So just default to sparse=False. If users want to override it, they can
do it via custom created storage.
- Privatize a bunch of functions
- Rename functions to make their purpose cleared
- Document some functions
- Group functions into logical groups and use comment blocks to separate them
Similar to the virt-install change, we only do this with default storage
if the installed failed in such a way that we never left the wizard.
It isn't going to cover all cases, but should handle the common issue
of stranded disk images
https://bugzilla.redhat.com/show_bug.cgi?id=799721
It's not consistently applied. If I had a setup to test against old xen
that still listed dom0, I'd make it so we never even show dom0 so we
can sidestep the problem entirely.
This has been supported for a long time now, and is more tested these
days, so let's use it rather than the old style AttachDevice method
It also works around a libvirt issue described in bz 1229819
Libvirt commit#742d49f introduces vgamem attribute to set the VGA
framebuffer size for QXL device of qemu, So we use vgamem instead
of vram here for qxl.
Signed-off-by: Lin Ma <lma@suse.com>
This feature has been added few years ago. I don't think, that it's a
good feature, as it can ask a user to use different storage than he
actually wants to use. One thing is automatically create a new storage
for user, if he let as do that, but we shouldn't annoy a user with this
question as he probably don't want to use the proposed storage. For
example he would like to use different storage pool or while importing
existing storage.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1232599
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
There is no virtio-scsi or spapr-vscsi bus, but only 'scsi' bus. There
are several types of SCSI controllers, but the SCSI storage don't care
about the SCSI controller and there is also no difference in address
specification or address type. Use only 'scsi' bus for all SCSI storages
to correspond the reality and also the libvirt domain XML. The only
difference is in the type of SCSI controller
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Commint 0ddec919 updated the details page. Now the detail page of
existing domain cannot update the 'machine' value, only prints that
value. If we cannot get the machine from domain XML, don't pass a None,
but "Unknown" instead. This can happen if you are connecting with
virt-manager to really old libvirt, the machine value is present in
domain XML since libvirt v0.9.5.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238981
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This issue was fixed for few years but only in virt-manager,
virt-install has the same bug. If you have two USB devices with same
vendor and product ID, you need to use also address element to create
a valid XML to define that device into a guest.
This patch moves the logic from vmmAddHardware into VirtualHostDevice in
order to not duplicate that code for virt-manager and virt-install.
Also update the tests files to properly check this functionality. I've
changed the USB device according the 'tests/testdriver.xml' and picked
one of the USB HUBs, because they have the same vendor and product ID.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1230611
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
We need to update/initialize the capsinfo sooner in that function to be
able to call has_install_options().
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1244566
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Each guest type can have its own capabilities and we should always ask
only for those capabilities.
The old approach was to get capabilities from libvirt and then for
example cycle trough all guests and return True, if any guest type
supports kvm or pae, etc.
Now we check those capabilities only for the correct guest type
according to defaults and input from user.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
For architecture "s390x",the disk and the network device are base
on "virtio" bus.The cdrom is based on "scsi".So set the default
cdrom bus as "scsi",the default bus as "virtio".Also the default
machine type is set to "s390-ccw-virtio" as it is the only supported
in "s390x".Also add a test cast of virt-install by cdrom in s390x.
(crobinso: Tweak test suite and minor formatting stuff)
All the strings have to be at first translated and then we can fill the
formated and translated string.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Drop horizontal scrolling, since with gtk3 hidden scrollbars it might
mean users don't realize there's info that is scrolled off.
Adjust the default sizing to match that pattern
commit 938060ae53 moved default devices
setup to happen before UEFI is set invalidating what the commit
5acfccf6032abb9e8be89130d05b661e8b3f42c7 does.
Add another check to happen before installing the guest to disable
HYPER-V when not supported.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1185253
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Repopulating the ostype/variant list triggers a bunch of change events,
which causes us to enter an infinite loop due to some minor behavior
change in the uiutil helpers.
The uiutil helpers are still correct, the root problem is we should be
disabling change events when repopulating those UI lists (we already
have to do a similar trick in a few other places, like host.py)
This is really only useful for building default XML internally, and
for virt-install stuff like --watchdog default. Instead just select
the 'default' value in the wizard
commit 5357b91402 changed the semantic of
conn.get_(vm|pool|interface|nodedev|net), to return None instead of
raising KeyError. Leave the exception handling code in case the
semantic is going to be reverted.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1219427
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
memory doesn't have a separate input/output stats, so we shouldn't use
the in_out_vector_helper. This resulted in shutoff VMs appearing to still
use memory in the manager window.
Trying to fall back to the create wizard can give weird results, since
it's really hard to ensure the customized changes are preserved if
the user changes things in the 'new' wizard.
Apparently xen doesn't set <serial> device alias names, and OpenConsole
just opens the first <console> device unconditionally.
Properly handling that would be to report it in the UI that we can
only open the first console, but for now just drop the alias check.
Apparently SUSE already does this as mentioned in the RH bug
https://bugzilla.redhat.com/show_bug.cgi?id=1215357
It's largely the same, but now
- The code is better organized
- The UI is much more streamlined, only showing relevant fields when
required.
- We warn about the hostname/URI cases that we know libvirt will error on
- Drop some of the attempts at being smart, and just mimic what libvirt
will do.
Leaving a VM defined on the source is dangerous: if they are sharing
storage, and aren't using virtlockd, then they might be inadvertently
started in two places at once and trash a disk image.
Some people might still need the option to turn this off, so maybe we
will revive it. Not sure though
This is only needed when people have very specific downtime constraints
on public facing services. I don't think that covers many virt-manager
users. So suggest they just use the command line for this.
This is a non-essential feature. I just hit a backtrace when trying
to refresh XML. It's fixed by the previous patch, but we should avoid
these errors from killing the create.py wizard at least.
We are just mirroring the behavior that virt-manager (and boxes) have
used for a while now.
In my experience the average user is confused by their VMs suspending,
so for our sake I'd rather make people opt into this feature.
We tried to split up status vs XML refreshing, but they are tied together
in various ways (like the runtime XML changes when a VM starts). This
was breaking console connecting when starting a VM
All major drivers either support it, or don't support save at all,
so I think we can safely drop it. If people still need it they can
get by with virsh.
We've had multiple requests over the years for something similar. People
might have to connect to multiple IP addresses, or really large hostnames,
that become difficult to distinguish in the UI.
Add a field in the host details page that allows setting a custom name,
and store it in gsettings.
Unify all the callers, and use some UI ellipsizing to handle
crazy long hostnames.
This drops the conn name collision prevention stuff which can be
useful when you have lots of similar connection names. But upcoming
patches will make it mostly redundant.
qemu has provided this feature for a long time, and every other driver
we care about provides a reboot implementation as well, so drop our
handling of it.
There's no external callers anymore, and the prospect of keeping this
stuff cached but potentially having a thread invalidate it makes me nervous,
so simplify things by making callers explicitly request the object they
want to redefine.
Have libvirtobjects advertise a routine specifically for initial setup,
and emit a signal when it's complete. Then dispatch the associated conn
signal on demand as the objects are initialized. This should avoid a
whole class of ordering issues, and is easier to follow IMO.
We were already sharing a chunk of this in a haphazard way. Now officially
break it all out, similar to netlist.py. This mostly unifies the views
of host->storage and storagebrowser.py
And not the other way around. It's less confusing this way IMO, particularly
if virtio is selected by default and the user is confused, wondering
where the cdrom option is.
Take the opportunity to actually share the bus combo logic between details
and addhardware
People should rarely need to edit the mac address, so remove it from
the create wizard. However we only allow editing the mac address in
the 'customize' dialog: regular network details disables editing, since
that should be a rare and potentially dangerous operation.
Right now we aren't showing the defaults like disk buses, sound devices,
disk cache modes, etc. This is confusing to the user and not that useful.
Encode the defaults before launching the wizard, so the user can see what
the end config will actually look like.
This might cause weirdness if going back to the create.py wizard, but
we'll see if anyone complains before handling that.
It's really a useless hold over from the days when we manually talked
to HAL.
One semi useful bit lost in the shuffle is the option to repoll cdroms
for media. But since virt-manager allows attaching a device to the
VM regardless of whether it notices media change, this plumbing is
really overkill. If libvirt ever grows nodedev events we will get this
much easier.
Takes a comma separated list of HVs, and only shows those as options in
the 'Open Connection' wizard. This option can be used to hide the bhyve
option as well, so drop --with-bhyve
It's out of date, and doesn't even seem to work with current RHEL versions
and no one is complaining.
If we want to add it back, it should be an explicit setup.py configure
option.
It's very difficult to tell what bits of Viewer that vmmConsolePages
accesses, and what bits of vmmConsolePages that vmmDetails will access.
Clean up the Viewer side with consistent function names, lots of comments,
and privatizing everything that shouldn't be shared.
Yeah this is a big ugly commit...
These only work for xen x86, and are less relevant nowadays since HW
virt has been around for a very long time. Also it's tough to be sure
that we aren't giving a bogus warning.
When starting the 'Create virtual network' wizard, you are allowed to proceed
without specifying a Network Name. An error only occurs after all else is
completed with the wizard. This patch stops the user from proceeding if a
network name has not been specified.
The check for an empty string is done in util.py which also effects storage
pool names and guest names neither of which should have empty strings.
Signed-off-by: Charles Arnold <carnold@suse.com>
Message-Id: <551D664702000091000F42E8@prv-mh.provo.novell.com>
If the mainloop is backed up, tick_send_signals might not run before
another conn.tick call is scheduled by the tick thread. conn.tick would
then be operating on incorrect self._vms since it was never updated.
Don't run another tick() until tick_send_signals has released a lock.
https://www.redhat.com/archives/virt-tools-list/2015-April/msg00009.html
Reported-by: Charles Arnold <carnold@suse.com>
All of the gsettings values of the "prefs-add-spice-usbredir" combo box
result in the preference being set to true, causing all new VMs to have
USB redirection added. This commit corrects the value of the "No" row to
correctly disable the setting when selected.
Signed-off-by: Dustin C. Hatch <dustin@hatch.name>
After the caching changes over the past year, virt-manager's internal state
isn't accurate when virtinst creates new disk storage.
Manually update the pools at the two virtinst entry points: create.py and
addhardware.py
When a new disk is added, by default choose a bus that is already used
by an existing disk, if any.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1206097
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Since commit dfa23765, page_changed() sets page visibilities based on the
value of the newpage parameter. Calling the function without it being set
makes all pages invisible at once during initialization, resulting in a
weird scenario which prevents the window from getting proper focus events
when another window partially overlaps it, resulting in stuck grabs.
Message-Id: <55114787.6070401@canonical.com>
Not passing an emulator is only for showing ideal defaults in the UI.
When doing internal checks, we only want to disable features if we know
the emulator doesn't support them.
It is added only in the details window, and intentionally not added to
the addhardware UI to keep it simpler. Users can edit this after a
new device is added.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
I've noticed twice today that 'guestcpus' was set to 0 while the
domain was shutting down. Play safe and check that 'guestcpus' is > 0
before divide by it.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
When XEN is used, disable domain events and use polling.
On RHEL-5.9 virDomainInfo() seems to not report correctly the domain
status when called immediately after the event is received.
Solves: https://bugzilla.redhat.com/show_bug.cgi?id=1177207
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
If we detect AAVMF, set it up, and allow all install options.
If we don't find AAVMF, disable all options except import install (the
current behavior) and show a warning.
If libosinfo fails to detect the operating system or the user doesn't
select any, use 20G by default.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
If we were focused on the VM details page for a container, then clicked
'Run', the console page wouldn't be switched to view the serial console.
Make that work, but continue to not switch focus away from the current
non-console page.
Based on Cédric's patch here: http://www.redhat.com/archives/virt-tools-list/2015-January/msg00078.html
the introspection page could be missing, in this case the tabs values
are shifted by one. The new code looks for the correct row number
before selecting it.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1167600
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
VirtualConnection.get_uri_host_port already splits this information
taking care of IPv6 addresses, do not split it again.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1094631
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
It fixes a race condition if the ERROR_AUTH error if received while
still on the CONSOLE_PAGE_AUTHENTICATE and skipping the page_changed
event.
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1165990
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
The fd is handed to spice-gtk and gtk-vnc. They will close it when no
longer needed. Double closing leads to various race issues, since the
same fd may be opened for a different usage.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1081227
Fixes this exception:
Traceback (most recent call last):
File "virt-manager/virtManager/create.py", line 1780, in finish
self.customize(guest)
File "virt-manager/virtManager/create.py", line 1812, in customize
self.config_window = vmmDetails(virtinst_guest, self.topwin)
File "virt-manager/virtManager/details.py", line 560, in __init__
self.populate_hw_list()
File "virt-manager/virtManager/details.py", line 3165, in populate_hw_list
self.repopulate_hw_list()
File "virt-manager/virtManager/details.py", line 3220, in repopulate_hw_list
update_hwlist(HW_LIST_TYPE_NIC, dev)
File "virt-manager/virtManager/details.py", line 3195, in update_hwlist
label = _label_for_device(dev)
File "virt-manager/virtManager/details.py", line 188, in _label_for_device
return "NIC %s" % dev.macaddr[-9:]
TypeError: 'NoneType' object has no attribute '__getitem__'
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1164123
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This patches adds the support to check the thread # against the
selected CPU model. If the selected # of CPU threads > 1 and CPU
model does not support hyper-threading, a warning message will be shown.
Signed-off-by: Wei Huang <wei@redhat.com>
It's no longer present in Gtk+ 3.14 and deprecated since at least 3.10 in favor
of named "folder" icon. That seems a good fit, a quick check on my system finds
it present in all themes that are available.
(1) A separate nvram (ie. variable store) file for the domain exists if
and only if the following condition holds:
(self.get_xmlobj().os.loader_ro is True and
self.get_xmlobj().os.loader_type == "pflash")
(Refer to libvirtd's qemuPrepareNVRAM() function, as of commit 742b08e30.)
(2) The
self.get_xmlobj().os.nvram
condition is sufficient, but not necessary, for the separate varstore file
to exist. That is, if the condition holds, then the separate varstore file
exists for sure, but if the condition doesn't hold, the file may exist
nonetheless. (Because libvirtd can auto-generate the varstore file's
pathname.)
This means that requiring condition (2) for setting UNDEFINE_NVRAM on
domain deletion will miss a subset of the cases, ie. when the necessary
and sufficient condition (1) holds, but the sufficient-only condition (2)
doesn't.
Make sure that the code uses the necessary and sufficient condition (1).
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Rework things a bit to simplify everything we pass around.
The specific bug fix is making sure we update the object list in place,
otherwise the event loop detects it as the VM being deleted and closes
the details window.
As of now, the only uses of nvram likely in the domain XML are with
libvirt configurations that also support the UNDEFINE_NVRAM flag, so
listing it here is kind of redundant. And in the common config of
non-root user connected to qemu:///system with template based nvram
in /var/lib, we won't be able to remove it anyways.
We expose a simple combobox with two entries: BIOS, and UEFI. The
UEFI option is only selectable if 1) libvirt supports the necessary
domcapabilities bits, 2) it detects that qemu supports the necessary
command line options, and 3) libvirt detects a UEFI binary on the
host that maps to a known template via qemu.conf
If those conditions aren't met, we disable the UEFI option, and show
a small warning icon with an explanatory tooltip.
The option can only be changed via New VM->Customize Before Install.
For existing x86 VMs, it's a readonly label.