Patchwork [21/28] migration: Make state definitions local

login
register
mail settings
Submitter Juan Quintela
Date Feb. 23, 2011, 9:47 p.m.
Message ID <e139533b2ab4f13f30ebfe47de68d6bd2989bb5a.1298492768.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/84250/
State New
Headers show

Comments

Juan Quintela - Feb. 23, 2011, 9:47 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration.c |    8 ++++++++
 migration.h |    8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)
Yoshiaki Tamura - Feb. 24, 2011, 4:12 a.m.
2011/2/24 Juan Quintela <quintela@redhat.com>:
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration.c |    8 ++++++++
>  migration.h |    8 --------
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/migration.c b/migration.c
> index 493c2d7..697c74f 100644
> --- a/migration.c
> +++ b/migration.c
> @@ -31,6 +31,14 @@
>     do { } while (0)
>  #endif
>
> +enum migration_state {
> +    MIG_STATE_ERROR,

Would be better to say:

MIG_STATE_ERROR = -1,

Yoshi

> +    MIG_STATE_NONE,
> +    MIG_STATE_CANCELLED,
> +    MIG_STATE_ACTIVE,
> +    MIG_STATE_COMPLETED,
> +};
> +
>  #define MAX_THROTTLE  (32 << 20)      /* Migration speed throttling */
>
>  static MigrationState current_migration = {
> diff --git a/migration.h b/migration.h
> index 3c5bb6a..e1fc921 100644
> --- a/migration.h
> +++ b/migration.h
> @@ -18,14 +18,6 @@
>  #include "qemu-common.h"
>  #include "notify.h"
>
> -enum migration_state {
> -    MIG_STATE_ERROR,
> -    MIG_STATE_NONE,
> -    MIG_STATE_CANCELLED,
> -    MIG_STATE_ACTIVE,
> -    MIG_STATE_COMPLETED,
> -};
> -
>  typedef struct MigrationState MigrationState;
>
>  struct MigrationState
> --
> 1.7.4
>
>
>
Juan Quintela - Feb. 24, 2011, 9:01 a.m.
Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp> wrote:
> 2011/2/24 Juan Quintela <quintela@redhat.com>:
>>
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> ---
>>  migration.c |    8 ++++++++
>>  migration.h |    8 --------
>>  2 files changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/migration.c b/migration.c
>> index 493c2d7..697c74f 100644
>> --- a/migration.c
>> +++ b/migration.c
>> @@ -31,6 +31,14 @@
>>     do { } while (0)
>>  #endif
>>
>> +enum migration_state {
>> +    MIG_STATE_ERROR,
>
> Would be better to say:
>
> MIG_STATE_ERROR = -1,

I thought about it, but basically it shouldn't matter, no?

Later, Juan.
Yoshiaki Tamura - Feb. 24, 2011, 9:16 a.m.
Juan Quintela wrote:
> Yoshiaki Tamura<tamura.yoshiaki@lab.ntt.co.jp>  wrote:
>> 2011/2/24 Juan Quintela<quintela@redhat.com>:
>>>
>>> Signed-off-by: Juan Quintela<quintela@redhat.com>
>>> ---
>>>   migration.c |    8 ++++++++
>>>   migration.h |    8 --------
>>>   2 files changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/migration.c b/migration.c
>>> index 493c2d7..697c74f 100644
>>> --- a/migration.c
>>> +++ b/migration.c
>>> @@ -31,6 +31,14 @@
>>>      do { } while (0)
>>>   #endif
>>>
>>> +enum migration_state {
>>> +    MIG_STATE_ERROR,
>>
>> Would be better to say:
>>
>> MIG_STATE_ERROR = -1,
>
> I thought about it, but basically it shouldn't matter, no?

It shouldn't.  Just gives clear impression :)

Yoshi

>
> Later, Juan.
>
>

Patch

diff --git a/migration.c b/migration.c
index 493c2d7..697c74f 100644
--- a/migration.c
+++ b/migration.c
@@ -31,6 +31,14 @@ 
     do { } while (0)
 #endif

+enum migration_state {
+    MIG_STATE_ERROR,
+    MIG_STATE_NONE,
+    MIG_STATE_CANCELLED,
+    MIG_STATE_ACTIVE,
+    MIG_STATE_COMPLETED,
+};
+
 #define MAX_THROTTLE  (32 << 20)      /* Migration speed throttling */

 static MigrationState current_migration = {
diff --git a/migration.h b/migration.h
index 3c5bb6a..e1fc921 100644
--- a/migration.h
+++ b/migration.h
@@ -18,14 +18,6 @@ 
 #include "qemu-common.h"
 #include "notify.h"

-enum migration_state {
-    MIG_STATE_ERROR,
-    MIG_STATE_NONE,
-    MIG_STATE_CANCELLED,
-    MIG_STATE_ACTIVE,
-    MIG_STATE_COMPLETED,
-};
-
 typedef struct MigrationState MigrationState;

 struct MigrationState