Commit Graph

70 Commits

Author SHA1 Message Date
Cole Robinson
4c759ad23d util: Move default_* network bits to deviceinterface 2016-08-24 16:14:33 -04:00
Cole Robinson
927be95b95 util: default_route: Handle lack of /proc/net/route
Which doesn't exist on freebsd for example

https://bugzilla.redhat.com/show_bug.cgi?id=1369803
2016-08-24 16:00:46 -04:00
Cole Robinson
eb2a56f700 util: Move xml_indent to XMLBuilder 2016-08-24 15:56:13 -04:00
Cole Robinson
5dea1c2d80 util: privatize stat_disk() 2016-08-24 15:56:13 -04:00
Cole Robinson
49ad2df0cb util: Remove some unused functions 2016-08-24 15:37:34 -04:00
Cole Robinson
7c10d8a27f devicedisk: Tweak driver defaults for xen
Following some discussion here:

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

jfehlig suggested better defaults for modern xen. End result is:

- Drop the blktap check, since it's deprecated (yaay)
- If xen + block device, use driver_name=phy
- Otherwise if on modern enough libvirt + libxl, do the same thing we
  do for qemu.
2015-09-23 17:26:48 -04:00
Cole Robinson
d5d6cfff2c Copy urlgrabber progress bar code into virt-manager.git
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).
2015-09-18 20:55:44 -04:00
Cole Robinson
697164f2e5 virtinst: Centralize urlgrabber meter lookup
We will eventually want to drop this dep since it's basically dead
upstream, this is a small step in that direction
2015-09-06 15:09:44 -04:00
Cole Robinson
1d7b74ba52 uri: Add a MagicURI class for handling magic virtinst URIs
And document it
2015-09-06 12:00:25 -04:00
Cole Robinson
45ae269950 storage: Use XMLBuilder for pool enumerate parsing
And kill the parse_node_helper function, since that paradigm is dead.
2015-04-03 16:45:43 -04:00
Charles Arnold
20fe287341 virt-manager: Don't allow an empty string for a network name
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>
2015-04-03 10:49:42 -04:00
Cole Robinson
0273ee2fac tests: Move some test suite hacks into the code, increase coverage 2015-03-23 16:25:31 -04:00
Cole Robinson
cff08223ba util: Move uri_split to its own URISplit class
Does what uri_split did, but wraps it all up in an object that makes
handling the data easier, and makes it easy to extend.
2014-12-09 08:43:19 -05:00
Cole Robinson
baee53fbaa util: Simplify default_bridge to not confuse pylint 2014-10-27 19:53:25 -04:00
Cole Robinson
8cd4958a19 cli: Break out function to disable libvirt error printing
We need it early in the test suite
2014-09-20 12:04:37 -04: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
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
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
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
d76aab264e tests: Only use one env variable to notify we are running tests 2014-02-10 14:47:20 -05:00
Cole Robinson
0b4a72fd77 virt-convert: Reimplement it
We totally break CLI compat here, but the previous tool wasn't sustainable.
Instead, repurpose the tool as strictly converting external formats
like ovf/vmx to native libvirt XML, and launch the guest.

So we drop vmx/virt-image output, and virt-image input, and a slew of
command line options. I don't think anyone was depending on this in a
scripted fashion, so in practice I don't think anyone will care.

Add much more comprehensive unit tests while we are at it.
2014-02-07 21:16:09 -05:00
Cole Robinson
a8dd7bd213 util: Fix validate_name error reporting 2014-02-05 19:02:42 -05:00
Cole Robinson
4ce356985a util: Relax name validation (bz 917444)
Warn about common cases like spaces in name, and let libvirt error on
the rest.
2014-02-01 08:37:28 -05:00
Cole Robinson
58d5e0b799 uihelpers: Move a few more functions closer to their callers 2014-01-26 17:51:15 -05:00
Cédric Bosdonnat
796ddd966a Moved vmmFSDetail.convert_units to virtinst.util 2014-01-25 11:58:24 -05:00
Cole Robinson
d040bf3573 Drop the len <= 50 validation check for domain names
Just let libvirt error out, since we have no idea if this is still
relevant.
2014-01-17 18:42:15 -05:00
Giuseppe Scrivano
2a040ccd17 mass update: remove double spaces from comments
Updated by this script:

find -name '*.py' -exec sed -i "s|^\(#.*[^.?\!]\)  \(.*[^#]\)$|\1 \2|g" \{\} \;

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2013-10-28 17:22:31 +01:00
Cole Robinson
3f532fe263 VirtualDisk: Handle the blktap default
And cache the blktap lookup once for the localhost
2013-10-06 13:17:35 -04:00
Cole Robinson
98187eb4b7 util: Fix generate_name start_num logic
We would start at start_num+1 which was confusing, fix it to do
the right thing.
2013-10-05 10:22:27 -04:00
Cole Robinson
67c62e68de create: Move name to last page, arch/type to first page
Moving name to the end allows us to do things like generate a default
name based on the chosen OS type, which we do here. This is bz 736951

Moving arch/type to the front page of the wizard simplifies validation
and will be needed to intuitively install arm guests without a bunch
of hacky workarounds.
2013-10-01 16:53:59 -04:00
Cole Robinson
0b58badfc1 Storage debug and scratch files in ~/.cache/virt-manager (bz 693028) 2013-10-01 08:28:15 -04:00
Cole Robinson
a6d92c7001 Drop a lot of usage of utility XML functions 2013-09-22 17:34:53 -04:00
Cole Robinson
aff0ddb259 Use XMLBuilder for Storage object handling
Simplify the API a bunch while we are at it, add tests, etc.
2013-09-20 10:00:08 -04:00
Cole Robinson
38545e3af8 Fix pylint warnings with latest version 2013-09-19 13:14:44 -04:00
Martin Kletzander
64b1ca15f2 Fix UUID generation according to RFC 4122
In commit 74aa8c8a, I somehow made an off-by-one error even though
that code was almost copy-paste from libvirt's commit 396c4d34.
2013-08-19 10:56:56 +02:00
Cole Robinson
7c55cfeb39 virtManager: Drop util, combine it with virtinst.util and uihelpers 2013-08-11 12:39:28 -04:00
Cole Robinson
43d15d67ac util: Have set_xml_path use xml_parse_wrapper 2013-07-24 12:08:00 -04:00
Cole Robinson
012d1cdc52 Installer: Drop all XML handling, just have it setup install info 2013-07-23 17:34:33 -04:00
Cole Robinson
0d5fe93048 Centralize XML helpers in virtinst/util.py 2013-07-12 13:10:23 -04:00
Cole Robinson
534e613d40 VirtualNetworkInterface: Absord MAC generating routines 2013-07-12 13:10:23 -04:00
Cole Robinson
7a2caee6e1 VirtualConnection: Allow using virt-manager object caches
So when we call into virtinst it doesn't do a whole round of object
lookup and XML fetching.
2013-07-07 18:54:08 -04:00
Cole Robinson
d5dc06148d virtinst: Move fetch_all_guests to connection object
And fetch_all_pools. And have it use pollhelpers
2013-07-07 15:14:59 -04:00
Cole Robinson
ee7d0b620d connection: Support listAll* object lookups
These calls save us a few API lookups, but are not supported by all
libvirt versions.

Since these bits were getting quite large, move them all to a separate
pollhelpers file.

However listAllInterfaces is returning an empty list for now, so we
disable the check: https://bugzilla.redhat.com/show_bug.cgi?id=982014
2013-07-07 15:06:09 -04:00
Cole Robinson
d427800f11 Share default_uri function 2013-07-06 20:09:18 -04:00
Cole Robinson
c406a6433c VirtualConnection: cache version lookups 2013-07-06 15:39:00 -04:00
Cole Robinson
3005382e0d Make is_blktap_capable take a connection
So we don't perform the check if we're using a remote connection
2013-07-06 12:44:53 -04:00
Cole Robinson
ba3aa9ecca Drop conn_max_vcpus validation
Let's just let libvirt throw an error in the rare occasion that we
exceed max vcpus.
2013-07-06 12:40:24 -04:00
Cole Robinson
492a039f7d VirtualConnection: proxy virtinst.support API
Simplifies the lives of callers, and will allow us to do caching later
2013-07-06 12:40:24 -04:00
Cole Robinson
ec734191fc virtinst: connection: Absorb all scattered URI helpers 2013-07-06 12:40:24 -04:00
Cole Robinson
57e86259d8 Make conn required for all virtinst objects
This was the way the API had been heading, this just formalizes it.
2013-07-05 20:28:21 -04:00