qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6695] block: Improve bdrv_iterate (Jan Kiszka)
Date: Thu, 05 Mar 2009 19:42:16 +0000	[thread overview]
Message-ID: <E1LfJSS-0002Un-8Y@cvs.savannah.gnu.org> (raw)

Revision: 6695
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6695
Author:   aliguori
Date:     2009-03-05 19:42:15 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
block: Improve bdrv_iterate (Jan Kiszka)

Make bdrv_iterate more useful by passing the BlockDriverState to the
iterator instead of the device name.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    branches/stable_0_10_0/block.c
    branches/stable_0_10_0/block.h
    branches/stable_0_10_0/monitor.c

Modified: branches/stable_0_10_0/block.c
===================================================================
--- branches/stable_0_10_0/block.c	2009-03-05 19:42:11 UTC (rev 6694)
+++ branches/stable_0_10_0/block.c	2009-03-05 19:42:15 UTC (rev 6695)
@@ -1011,12 +1011,12 @@
     return NULL;
 }
 
-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque)
+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs), void *opaque)
 {
     BlockDriverState *bs;
 
     for (bs = bdrv_first; bs != NULL; bs = bs->next) {
-        it(opaque, bs->device_name);
+        it(opaque, bs);
     }
 }
 

Modified: branches/stable_0_10_0/block.h
===================================================================
--- branches/stable_0_10_0/block.h	2009-03-05 19:42:11 UTC (rev 6694)
+++ branches/stable_0_10_0/block.h	2009-03-05 19:42:15 UTC (rev 6695)
@@ -141,7 +141,8 @@
                         void (*change_cb)(void *opaque), void *opaque);
 void bdrv_get_format(BlockDriverState *bs, char *buf, int buf_size);
 BlockDriverState *bdrv_find(const char *name);
-void bdrv_iterate(void (*it)(void *opaque, const char *name), void *opaque);
+void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs),
+                  void *opaque);
 int bdrv_is_encrypted(BlockDriverState *bs);
 int bdrv_set_key(BlockDriverState *bs, const char *key);
 void bdrv_iterate_format(void (*it)(void *opaque, const char *name),

Modified: branches/stable_0_10_0/monitor.c
===================================================================
--- branches/stable_0_10_0/monitor.c	2009-03-05 19:42:11 UTC (rev 6694)
+++ branches/stable_0_10_0/monitor.c	2009-03-05 19:42:15 UTC (rev 6695)
@@ -2679,8 +2679,9 @@
     closedir(ffs);
 }
 
-static void block_completion_it(void *opaque, const char *name)
+static void block_completion_it(void *opaque, BlockDriverState *bs)
 {
+    const char *name = bdrv_get_device_name(bs);
     const char *input = opaque;
 
     if (input[0] == '\0' ||

                 reply	other threads:[~2009-03-05 19:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LfJSS-0002Un-8Y@cvs.savannah.gnu.org \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).