Skip to contentSkip to conversation

hmp-cmd: fix a missing_break warning

PATCH In review Pan Nengyuan 5 participants 7 messages Mar 18, 2020 – Mar 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hmp-cmd: fix a missing_break warning

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
 monitor/hmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)
monitor/hmp-cmds.c +1 -0
index 58724031ea..c882c9f3cc 100644
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
         p->has_throttle_trigger_threshold = true;
         visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;
     case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
         p->has_cpu_throttle_initial = true;
         visit_type_int(v, param, &p->cpu_throttle_initial, &err);
Signature · 1 line
2.21.0.windows.1
#1 lore raw

Correcting zhang hailiang's email.

Quoted 31 lines · Pan Nengyuan

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
 monitor/hmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)
monitor/hmp-cmds.c +1 -0
index 58724031ea..c882c9f3cc 100644
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
         p->has_throttle_trigger_threshold = true;
         visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;
     case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
         p->has_cpu_throttle_initial = true;
         visit_type_int(v, param, &p->cpu_throttle_initial, &err);
Reviewed-by
#2 lore raw

Hi Nengyuan,

Quoted 21 lines · Pan Nengyuan

Correcting zhang hailiang's email.

Quoted 18 lines · Pan Nengyuan

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
 monitor/hmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 9 lines

monitor/hmp-cmds.c void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) · line 1264

Quoted 9 lines
monitor/hmp-cmds.c +1 -0
index 58724031ea..c882c9f3cc 100644
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
         p->has_throttle_trigger_threshold = true;
         visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;

Good fix :).

Quoted 7 lines

monitor/hmp-cmds.c void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) · line 1267

Quoted 4 lines
monitor/hmp-cmds.c +0 -0
     case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
         p->has_cpu_throttle_initial = true;
         visit_type_int(v, param, &p->cpu_throttle_initial, &err);

.

Thanks,
Keqian

#3 lore raw
In reply to Pan Nengyuan
Quoted 1 line · * Pan Nengyuan ([email protected]) wrote:

Correcting zhang hailiang's email.

Queued

Quoted 19 lines · Pan Nengyuan
Quoted 18 lines

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
 monitor/hmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 14 lines

monitor/hmp-cmds.c void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) · line 1267

Quoted 13 lines
monitor/hmp-cmds.c +1 -0
index 58724031ea..c882c9f3cc 100644
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
         p->has_throttle_trigger_threshold = true;
         visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;
     case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
         p->has_cpu_throttle_initial = true;
         visit_type_int(v, param, &p->cpu_throttle_initial, &err);

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#4 lore raw
In reply to Pan Nengyuan
Quoted 23 lines · * Pan Nengyuan ([email protected]) wrote:

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
 monitor/hmp-cmds.c | 1 +
 1 file changed, 1 insertion(+)
monitor/hmp-cmds.c +0 -0
index 58724031ea..c882c9f3cc 100644

monitor/hmp-cmds.c void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) · line 1264

Quoted 4 lines
monitor/hmp-cmds.c +1 -0
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
         p->has_throttle_trigger_threshold = true;
         visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;

Thanks!

Quoted 7 lines
monitor/hmp-cmds.c +0 -0
     case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
         p->has_cpu_throttle_initial = true;
         visit_type_int(v, param, &p->cpu_throttle_initial, &err);
Signature · 1 line
2.21.0.windows.1

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#5 lore raw
In reply to Pan Nengyuan
Quoted 24 lines · Pan Nengyuan

This fix coverity issues 94417686:

     1260        break;
     CID 94417686: (MISSING_BREAK)
     1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
     1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
     1262        p->has_throttle_trigger_threshold = true;
     1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
     1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

---
Cc: [email protected]

---
  monitor/hmp-cmds.c | 1 +
  1 file changed, 1 insertion(+)
monitor/hmp-cmds.c +0 -0
index 58724031ea..c882c9f3cc 100644

monitor/hmp-cmds.c void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) · line 1267

Quoted 7 lines
monitor/hmp-cmds.c +1 -0
@@ -1261,6 +1261,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
      case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
          p->has_throttle_trigger_threshold = true;
          visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
+        break;
      case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:
          p->has_cpu_throttle_initial = true;
          visit_type_int(v, param, &p->cpu_throttle_initial, &err);
#6 lore raw
In reply to Pan Nengyuan
Quoted 9 lines · Pan Nengyuan

This fix coverity issues 94417686:

    1260        break;
    CID 94417686: (MISSING_BREAK)
    1261. unterminated_case: The case for value "MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD" is not terminated by a 'break' statement.
    1261    case MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD:
    1262        p->has_throttle_trigger_threshold = true;
    1263        visit_type_int(v, param, &p->throttle_trigger_threshold, &err);
    1264    case MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL:

This is CID 1421950. (I'm not sure where your number comes from.)

Quoted 3 lines
Fixes dc14a470763c96fd9d360e1028ce38e8c3613a77

thanks
-- PMM