Commit Graph

73 Commits

Author SHA1 Message Date
Cole Robinson
a773a66a3f virtcli: Export config variables in a class object
Makes things easier to extend later
2015-04-06 15:54:35 -04:00
Cole Robinson
cac4ac1401 capabilities: Switch to use XMLBuilder
Just a cleanup to finally unify all the XML objects around the same
API, and drop a bunch of old cruft.
2015-04-03 16:45:42 -04:00
Giuseppe Scrivano
31836e2b5d virtinst: add support for <disk> sgio attribute
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-03-16 20:32:40 +01:00
Anatoly Belikov
e44b95149b devicedisk: fix source name attribute for gluster volumes
(crobinso: Small code tweak, and add test cases)
2015-01-29 11:31:43 -05:00
Cole Robinson
a1d82a162c devicedisk: Add logging of pool/vol XML 2015-01-29 10:20:18 -05:00
Cole Robinson
0370d3b796 devicedisk: Never raise error for missing TYPE_VOLUME
We can't predict when it's expected or not, so just never raise the
error and let libvirt error if the user is trying do things at
create time.
2014-12-10 13:22:42 -05:00
Cole Robinson
9ae3dbe05b virt-install: Fix --disk pool=NETPOOL,size=... creation 2014-12-10 13:22:42 -05:00
Cole Robinson
12340a3858 diskbackend: Try looking up network volumes by path
For gluster volumes, which have unique URLs for volume paths, this
makes selecting network volumes via the storagebrowser UI work.

Sheepdog and RBD volumes don't work yet
2014-12-10 09:04:29 -05:00
Cole Robinson
464ebabc5a virt-install: Wire up --disk vol= for network volumes
This involves convering pool/vol XML to disk source bits
2014-12-09 18:23:22 -05:00
Cole Robinson
f7c17d4c46 diskbackend: Mandate parent_pool when vol_object is passed
We will need parent pool for looking up info about network volumes
2014-12-09 17:03:48 -05:00
Cole Robinson
208672eea9 diskbackend: Minor simplifications 2014-12-09 16:57:32 -05:00
Cole Robinson
9952764dda virt-install: Make --disk $URL 'just work'
If VirtualDisk.path is set to a URL, parse it and fill in all the
source_* values automagically.
2014-12-09 10:45:26 -05:00
Cole Robinson
1c79b936f5 diskbackend: Check if the passed path is a url 2014-12-09 08:44:45 -05:00
Cole Robinson
c5ccd68e4d devicedisk: Handle an empty storage backend
Rather than have every little bit depend on a present storage backend,
only create one when it really matters.
2014-12-09 08:44:45 -05:00
Cole Robinson
f0b8062226 devicedisk: Unify StorageCreator vs StorageBackend handling 2014-12-09 08:44:45 -05:00
Cole Robinson
00957db6e0 devicedisk: Clarify _xmlpath 2014-12-07 10:08:33 -05:00
Cole Robinson
cd305da3f8 virt-install: support network --disk's
Handle type=network in devicedisk.py, and wire up all the network fields
for virt-install --disk. Right now it requires manually spelling out
all the protocol, name, host/port etc fields.

The one 'magic' bit is that VirtualDisk.path will be a pretty URL when
all those network fields are specified. This is keeps things mostly
working in various parts of the code where we expect 'path' to be an
identifier for a VirtualDisk.
2014-12-06 21:00:51 -05:00
Cole Robinson
0f6fddf610 devicedisk: Simplife get_xmlpath
Rather than deal with hacks, just read the backing paths and return
the first hit
2014-12-06 17:29:05 -05:00
Cole Robinson
86682c8c54 virt-install: Support --disk source_pool,source_volume
For setting type=volume disks. This requires some reworking of
devicedisk bits
2014-12-06 17:14:16 -05:00
Cole Robinson
9b62c2260d devicedisk: Catch --disk /dev/idontexist,size=2 2014-12-06 16:44:21 -05:00
Cole Robinson
52691c511e devicedisk: Move more validation into diskbackend 2014-12-06 16:44:21 -05:00
Cole Robinson
cf0206a58c devicedisk: Break apart set_create_storage
And break about the vol_install vs local clone storage creators. And
just generally delete a lot of code. The commit aint pretty but it works
and deletes a ton of hacks
2014-12-05 23:28:53 -05:00
Cole Robinson
7e2ea81a2c addstorage: Switch away from set_create_storage 2014-12-05 21:49:10 -05:00
Cole Robinson
92663eb1de devicedisk: Drop transient parameter
Just patch it in from distroinstaller
2014-12-05 21:49:10 -05:00
Cole Robinson
40a5ec75b7 tests: Switch away from set_create_storage 2014-12-05 21:49:10 -05:00
Cole Robinson
210ab4d8e0 devicedisk: Add set_vol_install
And use it in places where we don't need set_create_storage
2014-12-05 21:49:10 -05:00
Cole Robinson
2acbf52ce3 cli: If creating storage, always build vol_install
This is the start of moving this logic out of devicedisk
2014-12-05 20:00:11 -05:00
Cole Robinson
ef0beeb18b cli: Clean up disk source handling
...sort of. This stuff is a hairy mess, but this makes it more stream line
and easier to extend.
2014-12-05 19:05:15 -05:00
Cole Robinson
0cdf6032fb devicedisk: Remove some redundant validation 2014-12-05 15:31:13 -05:00
Cole Robinson
3e87aadeb7 devicedisk: Clarify backend vs creator code 2014-12-04 21:25:49 -05:00
Cole Robinson
6489df83ca devicedisk: Rename path_exists -> path_definitely_exists
Since it's a best effort attempt, try to make it more clear that
we aren't certain if paths exist in some cases.
2014-12-04 20:10:37 -05:00
Cole Robinson
ba05e1cd43 diskbackend: Drop all pool source matching
It's only used to try and determine if a path actually exists, however
in the pool source case there isn't much we can actually do with that
info.
2014-12-04 20:10:37 -05:00
Cole Robinson
0389ab23a7 diskbackend: Remove backing by pool object
It just muddles things up for a minor edge case. The autopoolify logic
should catch all practical cases we care about.
2014-12-04 19:45:00 -05:00
Cole Robinson
a75aa47daf devicedisk: Use consistent capitalization for property names 2014-12-04 16:30:18 -05:00
Cole Robinson
e71e5cd9dd devicedisk: Open code _xmlpath handling
Rather than depend on xmlbuilder infrastructure. We will need to extend
this logic for network disks, and it's easier this way.
2014-12-04 15:28:14 -05:00
Chen Hanxiao
43550c6daa devicedisk: add qed in driver_types
We already used 'qed' in our codes,
but seems we forgot to add this in driver_types.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-12-04 08:57:06 +08:00
Giuseppe Scrivano
cce5827195 virtinst: add support for disk type="volume"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-09-26 16:24:59 +02:00
Cole Robinson
439e5ad0fe details: Reorg a bunch of the global helpers
Some were redundant, some should be in virtinst
2014-09-20 10:23:19 -04:00
Cole Robinson
eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Jim Minter
764063dfe9 virt-install --disk discard= support
(crobinso: Remove default overriding, add test cases)
2014-04-29 10:38:30 -04:00
Chen Hanxiao
0dceb24b3b virtinst: fix an issue of disk bus caculation
commit 466c2bcf9c
will generate the same index for
'hda' and 'hdaa'.
Also break test cases.

This patch will fix this.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-23 13:31:48 +08:00
Martin Kletzander
466c2bcf9c disk: calculate the disk bus properly
I forgot to amend this change when changing it the last time.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-19 10:12:53 +01:00
Martin Kletzander
55d5b35e50 Fix generate_target once more
Passing a zero to the generate_target() function's as pref_ctrl
parameter makes the 'if pref_ctrl' conditions obviously false.  Also
the range created was starting from 0 and not from 1.  Apart from
fixing this, also fix tests so they actually test something this time.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-18 08:14:32 +01:00
Martin Kletzander
6c4302b0a7 disk: generate target controller-wise
Add an optional parameter to generate_target() that controls what
controller the disk should reside in (using libvirt's rules to create
addresses).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-12 21:55:32 +01:00
Martin Kletzander
a9c791b5b8 Add target_to_num method
Opposite to num_to_target.  It will be used in future patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-12 21:55:32 +01:00
Cole Robinson
d0f44491ff cli: Warn if disk path isn't searchable by qemu 2014-02-10 18:09:15 -05:00
Cole Robinson
c5f6c6852a VirtualDisk: Always use storage APIs for provisioning
This means if we are passed an unmanaged path, we try to create a
storage pool for the parent directory.

We skip directories like /dev where doing this might be problematic.

This makes things much friendlier to use for remote connections, and
means we can always rely on having libvirt's storage APIs to use
for format probing.
2014-02-08 19:24:14 -05:00
Cole Robinson
e0103286bd devicedisk: Short circuit path_exists(None) 2014-02-03 16:43:25 -05:00
Chen Hanxiao
4b72c5f2a0 virtinst: clearer error message when disks upper limits reached
We set upper limits for virtio, hd ... disks in virtinst.
So we should let users know this.

Improve error message suggested by:
https://bugzilla.redhat.com/show_bug.cgi?id=822331

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-01-27 10:22:08 +08:00
Cole Robinson
57e89cda8b virt-xml: Create storage if necessary 2014-01-26 13:09:26 -05:00