commit c42273fbc1983b146180c82b8a34b0d832a6f431
Author: John Griffith <email address hidden>
Date: Tue Oct 7 11:49:58 2014 -0600
Make sure device support Direct before setting
We added '-t none' option to the qemu-img convert operation
in image_utils.py a while back to accomodate a couple of
backend devices that didn't flush writes on disconnect.
(Change: I7a04f683add8c23b9125fe837c4048ccc3ac224d)
The only problem here is that some backend devices don't
support Direct mode and raise an exception and fail when
setting this option.
This patch adds a simple check using dd to see if the dest
supports the Direct flag and only sets '-t none' if the device
does in fact support it.
Additionally it was brought up that even yet other backends
are using file devices not blk devices. In their case setting
Direct will still work, however it's sub-optimal as qemu-convert
has internal mechanisms to make sure flushing etc are done
correctly and efficiently for those devices. So to accomodate
that particular use case I'm also adding a check if blk dev
that can be used for determining whether to set Direct for the
qemu-convert process.
Reviewed: https:/ /review. openstack. org/126637 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=c42273fbc19 83b146180c82b8a 34b0d832a6f431
Committed: https:/
Submitter: Jenkins
Branch: master
commit c42273fbc1983b1 46180c82b8a34b0 d832a6f431
Author: John Griffith <email address hidden>
Date: Tue Oct 7 11:49:58 2014 -0600
Make sure device support Direct before setting
We added '-t none' option to the qemu-img convert operation 3b9125fe837c404 8ccc3ac224d)
in image_utils.py a while back to accomodate a couple of
backend devices that didn't flush writes on disconnect.
(Change: I7a04f683add8c2
The only problem here is that some backend devices don't
support Direct mode and raise an exception and fail when
setting this option.
This patch adds a simple check using dd to see if the dest
supports the Direct flag and only sets '-t none' if the device
does in fact support it.
Additionally it was brought up that even yet other backends
are using file devices not blk devices. In their case setting
Direct will still work, however it's sub-optimal as qemu-convert
has internal mechanisms to make sure flushing etc are done
correctly and efficiently for those devices. So to accomodate
that particular use case I'm also adding a check if blk dev
that can be used for determining whether to set Direct for the
qemu-convert process.
Change-Id: I34127ac373cead cfb6fc2662628b1 a91eb7b0046
Closes-Bug: 1375487