[v2] hmp: Remove migration capabilities from "info migrate"
diff mbox series

Message ID 20190805002847.3284-1-richardw.yang@linux.intel.com
State New
Headers show
Series
  • [v2] hmp: Remove migration capabilities from "info migrate"
Related show

Commit Message

Wei Yang Aug. 5, 2019, 12:28 a.m. UTC
With the growth of migration capabilities, it is not proper to display
them in "info migrate". Users are recommended to use "info
migrate_capabiltiies" to list them.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

---
v2:
  * remove capabilities from "info migrate"
---
 monitor/hmp-cmds.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Dr. David Alan Gilbert Aug. 5, 2019, 11:12 a.m. UTC | #1
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> With the growth of migration capabilities, it is not proper to display
> them in "info migrate". Users are recommended to use "info
> migrate_capabiltiies" to list them.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
> Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> 
> ---
> v2:
>   * remove capabilities from "info migrate"
> ---
>  monitor/hmp-cmds.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 99ceb0846b..05a09987da 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -220,24 +220,13 @@ static char *SocketAddress_to_str(SocketAddress *addr)
>  void hmp_info_migrate(Monitor *mon, const QDict *qdict)
>  {
>      MigrationInfo *info;
> -    MigrationCapabilityStatusList *caps, *cap;
> +    MigrationCapabilityStatusList *caps;
>  
>      info = qmp_query_migrate(NULL);
>      caps = qmp_query_migrate_capabilities(NULL);

Why keep 'caps' and query them? Can't this go as well?

Dave

>      migration_global_dump(mon);
>  
> -    /* do not display parameters during setup */
> -    if (info->has_status && caps) {
> -        monitor_printf(mon, "capabilities: ");
> -        for (cap = caps; cap; cap = cap->next) {
> -            monitor_printf(mon, "%s: %s ",
> -                           MigrationCapability_str(cap->value->capability),
> -                           cap->value->state ? "on" : "off");
> -        }
> -        monitor_printf(mon, "\n");
> -    }
> -
>      if (info->has_status) {
>          monitor_printf(mon, "Migration status: %s",
>                         MigrationStatus_str(info->status));
> -- 
> 2.17.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Wei Yang Aug. 6, 2019, 12:35 a.m. UTC | #2
On Mon, Aug 05, 2019 at 12:12:25PM +0100, Dr. David Alan Gilbert wrote:
>* Wei Yang (richardw.yang@linux.intel.com) wrote:
>> With the growth of migration capabilities, it is not proper to display
>> them in "info migrate". Users are recommended to use "info
>> migrate_capabiltiies" to list them.
>> 
>> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>> Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
>> 
>> ---
>> v2:
>>   * remove capabilities from "info migrate"
>> ---
>>  monitor/hmp-cmds.c | 13 +------------
>>  1 file changed, 1 insertion(+), 12 deletions(-)
>> 
>> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
>> index 99ceb0846b..05a09987da 100644
>> --- a/monitor/hmp-cmds.c
>> +++ b/monitor/hmp-cmds.c
>> @@ -220,24 +220,13 @@ static char *SocketAddress_to_str(SocketAddress *addr)
>>  void hmp_info_migrate(Monitor *mon, const QDict *qdict)
>>  {
>>      MigrationInfo *info;
>> -    MigrationCapabilityStatusList *caps, *cap;
>> +    MigrationCapabilityStatusList *caps;
>>  
>>      info = qmp_query_migrate(NULL);
>>      caps = qmp_query_migrate_capabilities(NULL);
>
>Why keep 'caps' and query them? Can't this go as well?

You are right. Let me remove it.

Patch
diff mbox series

diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 99ceb0846b..05a09987da 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -220,24 +220,13 @@  static char *SocketAddress_to_str(SocketAddress *addr)
 void hmp_info_migrate(Monitor *mon, const QDict *qdict)
 {
     MigrationInfo *info;
-    MigrationCapabilityStatusList *caps, *cap;
+    MigrationCapabilityStatusList *caps;
 
     info = qmp_query_migrate(NULL);
     caps = qmp_query_migrate_capabilities(NULL);
 
     migration_global_dump(mon);
 
-    /* do not display parameters during setup */
-    if (info->has_status && caps) {
-        monitor_printf(mon, "capabilities: ");
-        for (cap = caps; cap; cap = cap->next) {
-            monitor_printf(mon, "%s: %s ",
-                           MigrationCapability_str(cap->value->capability),
-                           cap->value->state ? "on" : "off");
-        }
-        monitor_printf(mon, "\n");
-    }
-
     if (info->has_status) {
         monitor_printf(mon, "Migration status: %s",
                        MigrationStatus_str(info->status));