Wait ... I have some comments here:
params is a very sensitive data structure, for instance , it is used to
store template data in objectstore.
We must be careful to add new fields in it.
So, I have a question: Why did you create "params['pool'] =
disk['pool']
", instead of simply use params['disks'][x]['pool']['type']
???
Notice you can have more than one disk and seems that params['pool']
will always have the last disk pool set!!
Anyway, I am against add 'pool' to params ... once we have just removed
'storagepool' from it.
Rodrigo Trujillo
On 12/08/2015 03:55 PM, Paulo Vital wrote:
Reviewed-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
On 12/08/2015 12:55 PM, Ramon Medeiros wrote:
> Instead of add io=native for all disks, add only if disk is in a netfs
> pool.
>
> Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
> ---
> vmtemplate.py | 2 +-
> xmlutils/disk.py | 4 +++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/vmtemplate.py b/vmtemplate.py
> index b90f221..1162cf2 100644
> --- a/vmtemplate.py
> +++ b/vmtemplate.py
> @@ -213,7 +213,7 @@ class VMTemplate(object):
> img = "%s-%s.img" % (vm_uuid, params['index'])
> storage_path =
self._get_storage_path(disk['pool']['name'])
> params['path'] = os.path.join(storage_path, img)
> -
> + params['pool'] = disk['pool']
> disks_xml += get_disk_xml(params)[1]
>
> return unicode(disks_xml, 'utf-8')
> diff --git a/xmlutils/disk.py b/xmlutils/disk.py
> index 2ed2ef4..7fed9cf 100644
> --- a/xmlutils/disk.py
> +++ b/xmlutils/disk.py
> @@ -53,7 +53,9 @@ def get_disk_xml(params):
> driver = E.driver(name='qemu', type=params['format'])
> if params['type'] != 'cdrom':
> driver.set('cache', 'none')
> - driver.set("io", "native")
> +
> + if params['pool']['type'] == "netfs":
> + driver.set("io", "native")
>
> disk.append(driver)
>
_______________________________________________
Kimchi-devel mailing list
Kimchi-devel(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel