block: simple changes
cover block: simple changes
First patch here is one we have agreed on during the initial discussion about truncate() in parallels format driver, another one is simple coding style change spotted by my student.
Denis V. Lunev (1):
block: assert no image modification under BDRV_O_INACTIVE
Klim Kireev (1):
block: fix obvious coding style mitakes in block_int.h
block.c | 2 ++ include/block/block_int.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/2 block: fix obvious coding style mitakes in block_int.h
From: Klim Kireev <[email protected]>
--- include/block/block_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/block/block_int.h +3 -3
@@ -252,7 +252,7 @@ struct BlockDriver {* Returns 0 for completed check, -errno for internal errors. * The check results are stored in result. */ -int (*bdrv_check)(BlockDriverState * bs,BdrvCheckResult *result, +int (*bdrv_check)(BlockDriverState *bs,BdrvCheckResult *result,BdrvCheckMode fix); int (*bdrv_amend_options)(BlockDriverState *bs, QemuOpts *opts,
@@ -454,13 +454,13 @@ struct BdrvChildRole {/* Returns a name that is supposedly more useful for human users than the * node name for identifying the node in question (in particular, a BB * name), or NULL if the parent can't provide a better name. */ -const char * (*get_name)(BdrvChild *child); +const char *(*get_name)(BdrvChild *child);/* Returns a malloced string that describes the parent of the child for a * human reader. This could be a node-name, BlockBackend name, qdev ID or * QOM path of the device owning the BlockBackend, job type and ID etc. The * caller is responsible for freeing the memory. */ -char * (*get_parent_desc)(BdrvChild *child); +char *(*get_parent_desc)(BdrvChild *child);/* * If this pair of functions is implemented, the parent doesn't issue new
Signature · 1 line
2.7.4
PATCH 2/2 block: assert no image modification under BDRV_O_INACTIVE
In reply to Denis V. LunevAs long as BDRV_O_INACTIVE is set, the image file is only opened so we have a file descriptor for it. We're definitely not supposed to modify the image, it's still owned by the migration source.
This commit is an addition to 09e0c771 but the assert() is added to bdrv_truncate().
--- block.c | 2 ++ 1 file changed, 2 insertions(+)
block.c +2 -0
@@ -3279,6 +3279,8 @@ int bdrv_truncate(BdrvChild *child, int64_t offset)if (bs->read_only)return -EACCES ; +assert (!(bs->open_flags &BDRV_O_INACTIVE )); + ret = drv->bdrv_truncate (bs, offset);if (ret ==0 ) { ret =refresh_total_sectors (bs, offset >>BDRV_SECTOR_BITS );
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH 1/2] block: fix obvious coding style mitakes in block_int.h
In reply to Denis V. LunevQuoted 1 line · Denis V. Lunev
From: Klim Kireev <[email protected]>
s/mitakes/mistakes/ in the subject
A blank commit message body doesn't help - the subject says what was changed but not why (for example, output of checkpatch.pl without the patch applied); and details may help in grepping past history when looking for the change or even to justify that the change is not just churn.
Quoted 9 lines
Signed-off-by Klim Kireev <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>--- include/block/block_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
At any rate, all of the changes (the fact that we prefer binding the pointer operator * to the name on the right rather than the type on the left) look sane.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 2/2] block: assert no image modification under BDRV_O_INACTIVE
In reply to Denis V. LunevQuoted 7 lines · Denis V. Lunev
As long as
BDRV_O_INACTIVEis set, the image file is only opened so we have a file descriptor for it. We're definitely not supposed to modify the image, it's still owned by the migration source.This commit is an addition to
09e0c771but theassert()is added tobdrv_truncate().
Quoted 6 lines
Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>--- block.c | 2 ++ 1 file changed, 2 insertions(+)
I don't feel comfortable adding an assert this late in the 2.9 phase, but think it makes perfect sense as a 2.10 addition.
Quoted 15 lines
block.c +2
-0@@ -3279,6 +3279,8 @@ int bdrv_truncate(BdrvChild *child, int64_t offset)if (bs->read_only)return -EACCES ; +assert (!(bs->open_flags &BDRV_O_INACTIVE )); + ret = drv->bdrv_truncate (bs, offset);if (ret ==0 ) { ret =refresh_total_sectors (bs, offset >>BDRV_SECTOR_BITS );
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Re: [Qemu-devel] [PATCH 2/2] block: assert no image modification under BDRV_O_INACTIVE
Quoted 14 lines · Eric Blake
Quoted 7 lines · Denis V. Lunev
As long as
BDRV_O_INACTIVEis set, the image file is only opened so we have a file descriptor for it. We're definitely not supposed to modify the image, it's still owned by the migration source.This commit is an addition to
09e0c771but theassert()is added tobdrv_truncate().Quoted 6 lines
Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>--- block.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 4 lines
I don't feel comfortable adding an assert this late in the 2.9 phase, but think it makes perfect sense as a 2.10 addition.
Reviewed-by Eric Blake <[email protected]>
no-no, this is for 2.10 for sure. No way for 2.9. I have stated that in cover letter :(
Sorry for inconvenience.
Den
Re: [Qemu-devel] [PATCH 1/2] block: fix obvious coding style mitakes in block_int.h
In reply to Eric BlakeQuoted 20 lines · Eric Blake
Quoted 1 line · Denis V. Lunev
From: Klim Kireev <[email protected]>
s/mitakes/mistakes/ in the subject
A blank commit message body doesn't help - the subject says what was changed but not why (for example, output of checkpatch.pl without the patch applied); and details may help in grepping past history when looking for the change or even to justify that the change is not just churn.
Quoted 9 lines
Signed-off-by Klim Kireev <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>--- include/block/block_int.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 3 lines
At any rate, all of the changes (the fact that we prefer binding the pointer operator * to the name on the right rather than the type on the left) look sane.
I know someone who disagrees but that someone also knows that I will support and accept this kind of patches gladly. O:-)
Max
Quoted 1 line
Reviewed-by Eric Blake <[email protected]>
Re: [Qemu-devel] [PATCH 2/2] block: assert no image modification under BDRV_O_INACTIVE
In reply to Denis V. LunevQuoted 7 lines · Denis V. Lunev
As long as
BDRV_O_INACTIVEis set, the image file is only opened so we have a file descriptor for it. We're definitely not supposed to modify the image, it's still owned by the migration source.This commit is an addition to
09e0c771but theassert()is added tobdrv_truncate().
Quoted 6 lines
Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>--- block.c | 2 ++ 1 file changed, 2 insertions(+)
Thanks to the new op blockers I'm not sure this is really necessary anymore (that assertion should cover this, once it's reinstated, that is...), but it won't hurt, I guess.
Max
Quoted 11 lines · Denis V. Lunev
First patch here is one we have agreed on during the initial discussion about
truncate()in parallels format driver, another one is simple coding style change spotted by my student.Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Max Reitz <[email protected]>Denis V. Lunev (1):
block: assert no image modification underBDRV_O_INACTIVE
Quoted 6 lines
Klim Kireev (1):
block: fix obvious coding style mitakes inblock_int.hblock.c | 2 ++ include/block/block_int.h | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-)
Thanks, fixed the subject of the first patch and applied to my block-next branch:
https://github.com/XanClic/qemu/commits/block-next
Max