All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm
@ 2014-09-29  8:38 Zhang Haoyu
  2014-09-29  9:18 ` Markus Armbruster
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zhang Haoyu @ 2014-09-29  8:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Markus Armbruster, Stefan Hajnoczi, xiawenc

The while loop variabal is "bs1", 
but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
Broken in commit a89d89d, v1.7.0.

v1 -> v2:
* add broken commit id to commit message

Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 savevm.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/savevm.c b/savevm.c
index e19ae0a..2d8eb96 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1245,19 +1245,18 @@ int load_vmstate(const char *name)
 
 void do_delvm(Monitor *mon, const QDict *qdict)
 {
-    BlockDriverState *bs, *bs1;
+    BlockDriverState *bs;
     Error *err = NULL;
     const char *name = qdict_get_str(qdict, "name");
 
-    bs = find_vmstate_bs();
-    if (!bs) {
+    if (!find_vmstate_bs()) {
         monitor_printf(mon, "No block device supports snapshots\n");
         return;
     }
 
-    bs1 = NULL;
-    while ((bs1 = bdrv_next(bs1))) {
-        if (bdrv_can_snapshot(bs1)) {
+    bs = NULL;
+    while ((bs = bdrv_next(bs))) {
+        if (bdrv_can_snapshot(bs)) {
             bdrv_snapshot_delete_by_id_or_name(bs, name, &err);
             if (err) {
                 monitor_printf(mon,
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm
  2014-09-29  8:38 [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm Zhang Haoyu
@ 2014-09-29  9:18 ` Markus Armbruster
  2014-09-29  9:54   ` Stefan Hajnoczi
  2014-09-29  9:51 ` Kevin Wolf
  2014-09-29 10:15 ` Stefan Hajnoczi
  2 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2014-09-29  9:18 UTC (permalink / raw)
  To: Zhang Haoyu; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi, qemu-stable

Dropping cc: xiawenc@linux.ibm.com, because I got a "user unknown"
bounce.

Copying qemu-stable.

"Zhang Haoyu" <zhanghy@sangfor.com> writes:

> The while loop variabal is "bs1", 
> but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
> Broken in commit a89d89d, v1.7.0.
>
> v1 -> v2:
> * add broken commit id to commit message

Patch version information...

> Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---

... goes here, so it doesn't go into the permanent commit message.
Maybe Kevin or Stefan can clean it up on commit.

>  savevm.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm
  2014-09-29  8:38 [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm Zhang Haoyu
  2014-09-29  9:18 ` Markus Armbruster
@ 2014-09-29  9:51 ` Kevin Wolf
  2014-09-29 10:15 ` Stefan Hajnoczi
  2 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2014-09-29  9:51 UTC (permalink / raw)
  To: Zhang Haoyu
  Cc: xiawenc, qemu-stable, qemu-devel, Stefan Hajnoczi, Markus Armbruster

Am 29.09.2014 um 10:38 hat Zhang Haoyu geschrieben:
> The while loop variabal is "bs1", 
> but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
> Broken in commit a89d89d, v1.7.0.
> 
> v1 -> v2:
> * add broken commit id to commit message
> 
> Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>

Cc: qemu-stable@nongnu.org
Reviewed-by: Kevin Wolf <kwolf@redhat.com>

We should probably add a qemu-iotests case for the handling of internal
snapshots on VMs with multiple images. Any volunteer?

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm
  2014-09-29  9:18 ` Markus Armbruster
@ 2014-09-29  9:54   ` Stefan Hajnoczi
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2014-09-29  9:54 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: Kevin Wolf, Zhang Haoyu, qemu-devel, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 676 bytes --]

On Mon, Sep 29, 2014 at 11:18:33AM +0200, Markus Armbruster wrote:
> > The while loop variabal is "bs1", 
> > but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
> > Broken in commit a89d89d, v1.7.0.
> >
> > v1 -> v2:
> > * add broken commit id to commit message
> 
> Patch version information...
> 
> > Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
> > Reviewed-by: Markus Armbruster <armbru@redhat.com>
> > ---
> 
> ... goes here, so it doesn't go into the permanent commit message.
> Maybe Kevin or Stefan can clean it up on commit.

No problem, we'll drop the changelog when applying the patch this time.

Thanks for reviewing, Markus.

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm
  2014-09-29  8:38 [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm Zhang Haoyu
  2014-09-29  9:18 ` Markus Armbruster
  2014-09-29  9:51 ` Kevin Wolf
@ 2014-09-29 10:15 ` Stefan Hajnoczi
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2014-09-29 10:15 UTC (permalink / raw)
  To: Zhang Haoyu; +Cc: Kevin Wolf, xiawenc, qemu-devel, Markus Armbruster

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

On Mon, Sep 29, 2014 at 04:38:02PM +0800, Zhang Haoyu wrote:
> The while loop variabal is "bs1", 
> but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
> Broken in commit a89d89d, v1.7.0.
> 
> v1 -> v2:
> * add broken commit id to commit message
> 
> Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---
>  savevm.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-29 10:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-29  8:38 [Qemu-devel] [PATCH bugfix v2] snapshot: fix referencing wrong variable in while loop in do_delvm Zhang Haoyu
2014-09-29  9:18 ` Markus Armbruster
2014-09-29  9:54   ` Stefan Hajnoczi
2014-09-29  9:51 ` Kevin Wolf
2014-09-29 10:15 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.