From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
This patch need to be changed with Shaohe's metadata patch,
and cannot be merged directly.As metadata patch cannot pass all tests.
v1>v3,
Choose bus type according to os info in metadata.
When adding a disk, specify a pool and vol name,
so that kimchi can chek ref_cnt to make sure no others
using that volume,
also volume format is filled to driver so that qcow2 image
will not recognized as raw.
Tested:
1. when no bus is specified,
kimchi chose 'ide' for cdrom and 'virtio' for disk
2. when bus is specified,
kimchi attach disk with specified bus.
3. ide does not support hot plug.
4. Disk size for qcow2 and raw is right.
Depend on Sheldon's patch:
[PATCH]manually manage the metadata element
[PATCH]write the template OS info to vm metadata
[PATCH]Add two function to set and get domain xml metadata
[PATCH]bug fix: get user and group when vm is living.
[PATCH]update test case to set/get user and group when VM is running
Royce Lv (7):
Guest disks: Update doc to support manage guest disks
Guest disks: Update api definition and error reporting
Guest disks: Choose proper bus for device
Guest disks: Abstract vm disk functions
Guest disk: deals with disk attachment
Multiple pep8 fixes
Guest disks: Update testcase
docs/API.md | 12 ++--
src/kimchi/API.json | 37 +++++++---
src/kimchi/i18n.py | 28 ++++----
src/kimchi/mockmodel.py | 18 ++---
src/kimchi/model/storagevolumes.py | 9 +--
src/kimchi/model/vmstorages.py | 138 ++++++++++++++++++-------------------
src/kimchi/vmdisks.py | 58 ++++++++++++++++
tests/test_model.py | 75 ++++++++++++++++++++
8 files changed, 265 insertions(+), 110 deletions(-)
create mode 100644 src/kimchi/vmdisks.py
--
1.8.3.2