[PATCH 2/3] qemuBlockBitmapsHandleCommitFinish: Use proper variable to iterate

Peter Krempa posted 3 patches 5 years, 10 months ago
[PATCH 2/3] qemuBlockBitmapsHandleCommitFinish: Use proper variable to iterate
Posted by Peter Krempa 5 years, 10 months ago
The function repeatedly checked the first element rather than interating
through the array.

Reported-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 115682c39d..f95ebb6fa7 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -3177,7 +3177,7 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc,
                     char **disabledbitmaps;

                     for (disabledbitmaps = disabledBitmapsBase; *disabledbitmaps; disabledbitmaps++) {
-                        if (STREQ(*disabledBitmapsBase, bitmap->name)) {
+                        if (STREQ(*disabledbitmaps, bitmap->name)) {
                             bitmapdata = g_new0(struct qemuBlockBitmapsHandleCommitData, 1);

                             bitmapdata->create = false;
-- 
2.24.1

Re: [PATCH 2/3] qemuBlockBitmapsHandleCommitFinish: Use proper variable to iterate
Posted by Ján Tomko 5 years, 10 months ago
On a Tuesday in 2020, Peter Krempa wrote:
>The function repeatedly checked the first element rather than interating

iterating

>through the array.
>
>Reported-by: Daniel P. Berrangé <berrange@redhat.com>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Jano