qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction
@ 2013-05-13  8:46 Kevin Wolf
  2013-05-13 12:35 ` Stefan Hajnoczi
  2013-05-13 12:51 ` Eric Blake
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Wolf @ 2013-05-13  8:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

There's no reason to restrict transactions to operations related to
block devices, so rename the type now before schema introspection stops
us from doing so.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c       | 22 +++++++++++-----------
 qapi-schema.json |  8 ++++----
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 617501c..d1ec99a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -750,8 +750,8 @@ void do_commit(Monitor *mon, const QDict *qdict)
 
 static void blockdev_do_action(int kind, void *data, Error **errp)
 {
-    BlockdevAction action;
-    BlockdevActionList list;
+    TransactionAction action;
+    TransactionActionList list;
 
     action.kind = kind;
     action.data = data;
@@ -773,8 +773,8 @@ void qmp_blockdev_snapshot_sync(const char *device, const char *snapshot_file,
         .has_mode = has_mode,
         .mode = mode,
     };
-    blockdev_do_action(BLOCKDEV_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC, &snapshot,
-                       errp);
+    blockdev_do_action(TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC,
+                       &snapshot, errp);
 }
 
 
@@ -803,7 +803,7 @@ typedef struct BdrvActionOps {
  * Later it will be used in free().
  */
 struct BlkTransactionStates {
-    BlockdevAction *action;
+    TransactionAction *action;
     const BdrvActionOps *ops;
     QSIMPLEQ_ENTRY(BlkTransactionStates) entry;
 };
@@ -828,10 +828,10 @@ static void external_snapshot_prepare(BlkTransactionStates *common,
     enum NewImageMode mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;
     ExternalSnapshotStates *states =
                              DO_UPCAST(ExternalSnapshotStates, common, common);
-    BlockdevAction *action = common->action;
+    TransactionAction *action = common->action;
 
     /* get parameters */
-    g_assert(action->kind == BLOCKDEV_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC);
+    g_assert(action->kind == TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC);
 
     device = action->blockdev_snapshot_sync->device;
     new_image_file = action->blockdev_snapshot_sync->snapshot_file;
@@ -927,7 +927,7 @@ static void external_snapshot_abort(BlkTransactionStates *common)
 }
 
 static const BdrvActionOps actions[] = {
-    [BLOCKDEV_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC] = {
+    [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC] = {
         .instance_size = sizeof(ExternalSnapshotStates),
         .prepare  = external_snapshot_prepare,
         .commit   = external_snapshot_commit,
@@ -940,9 +940,9 @@ static const BdrvActionOps actions[] = {
  *  then we do not pivot any of the devices in the group, and abandon the
  *  snapshots
  */
-void qmp_transaction(BlockdevActionList *dev_list, Error **errp)
+void qmp_transaction(TransactionActionList *dev_list, Error **errp)
 {
-    BlockdevActionList *dev_entry = dev_list;
+    TransactionActionList *dev_entry = dev_list;
     BlkTransactionStates *states, *next;
     Error *local_err = NULL;
 
@@ -954,7 +954,7 @@ void qmp_transaction(BlockdevActionList *dev_list, Error **errp)
 
     /* We don't do anything in this loop that commits us to the snapshot */
     while (NULL != dev_entry) {
-        BlockdevAction *dev_info = NULL;
+        TransactionAction *dev_info = NULL;
         const BdrvActionOps *ops;
 
         dev_info = dev_entry->value;
diff --git a/qapi-schema.json b/qapi-schema.json
index 199744a..2dd32eb 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1609,12 +1609,12 @@
             '*mode': 'NewImageMode' } }
 
 ##
-# @BlockdevAction
+# @TransactionAction
 #
 # A discriminated record of operations that can be performed with
 # @transaction.
 ##
-{ 'union': 'BlockdevAction',
+{ 'union': 'TransactionAction',
   'data': {
        'blockdev-snapshot-sync': 'BlockdevSnapshot'
    } }
@@ -1628,7 +1628,7 @@
 # supported is currently blockdev-snapshot-sync.
 #
 #  List of:
-#  @BlockdevAction: information needed for the device snapshot
+#  @TransactionAction: information needed for the device snapshot
 #
 # Returns: nothing on success
 #          If @device is not a valid block device, DeviceNotFound
@@ -1640,7 +1640,7 @@
 # Since 1.1
 ##
 { 'command': 'transaction',
-  'data': { 'actions': [ 'BlockdevAction' ] } }
+  'data': { 'actions': [ 'TransactionAction' ] } }
 
 ##
 # @blockdev-snapshot-sync
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction
  2013-05-13  8:46 [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction Kevin Wolf
@ 2013-05-13 12:35 ` Stefan Hajnoczi
  2013-05-13 12:51 ` Eric Blake
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-05-13 12:35 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

On Mon, May 13, 2013 at 10:46:14AM +0200, Kevin Wolf wrote:
> There's no reason to restrict transactions to operations related to
> block devices, so rename the type now before schema introspection stops
> us from doing so.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c       | 22 +++++++++++-----------
>  qapi-schema.json |  8 ++++----
>  2 files changed, 15 insertions(+), 15 deletions(-)

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

Stefan

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

* Re: [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction
  2013-05-13  8:46 [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction Kevin Wolf
  2013-05-13 12:35 ` Stefan Hajnoczi
@ 2013-05-13 12:51 ` Eric Blake
  2013-05-13 14:53   ` Stefan Hajnoczi
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Blake @ 2013-05-13 12:51 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, stefanha

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

On 05/13/2013 02:46 AM, Kevin Wolf wrote:
> There's no reason to restrict transactions to operations related to
> block devices, so rename the type now before schema introspection stops
> us from doing so.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c       | 22 +++++++++++-----------
>  qapi-schema.json |  8 ++++----
>  2 files changed, 15 insertions(+), 15 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

However,

>  #
>  #  List of:
> -#  @BlockdevAction: information needed for the device snapshot
> +#  @TransactionAction: information needed for the device snapshot

Is this comment now out of date?

>  #
>  # Returns: nothing on success
>  #          If @device is not a valid block device, DeviceNotFound
> @@ -1640,7 +1640,7 @@
>  # Since 1.1
>  ##
>  { 'command': 'transaction',
> -  'data': { 'actions': [ 'BlockdevAction' ] } }
> +  'data': { 'actions': [ 'TransactionAction' ] } }
>  
>  ##
>  # @blockdev-snapshot-sync
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

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

* Re: [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction
  2013-05-13 12:51 ` Eric Blake
@ 2013-05-13 14:53   ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2013-05-13 14:53 UTC (permalink / raw)
  To: Eric Blake; +Cc: Kevin Wolf, qemu-devel

On Mon, May 13, 2013 at 06:51:06AM -0600, Eric Blake wrote:
> On 05/13/2013 02:46 AM, Kevin Wolf wrote:
> > There's no reason to restrict transactions to operations related to
> > block devices, so rename the type now before schema introspection stops
> > us from doing so.
> > 
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> >  blockdev.c       | 22 +++++++++++-----------
> >  qapi-schema.json |  8 ++++----
> >  2 files changed, 15 insertions(+), 15 deletions(-)
> 
> Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> However,
> 
> >  #
> >  #  List of:
> > -#  @BlockdevAction: information needed for the device snapshot
> > +#  @TransactionAction: information needed for the device snapshot
> 
> Is this comment now out of date?

kwolf: feel free to send a v2 and I'll replace what I merged.

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

end of thread, other threads:[~2013-05-13 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13  8:46 [Qemu-devel] [PATCH] blockdev: Rename BlockdevAction -> TransactionAction Kevin Wolf
2013-05-13 12:35 ` Stefan Hajnoczi
2013-05-13 12:51 ` Eric Blake
2013-05-13 14:53   ` Stefan Hajnoczi

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).