All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Improved reporting for migrate parameters
@ 2020-03-31  8:22 Mao Zhongyi
  2020-03-31  8:22 ` [PATCH v2 1/3] migration/migration: improve error " Mao Zhongyi
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Mao Zhongyi @ 2020-03-31  8:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert, Mao Zhongyi, quintela

This series mainly improve the report message of migrate parameters
to make it easier to read.

v2->v1
-p1: avoid using constants, replace it with stringify().

Cc: quintela@redhat.com
Cc: dgilbert@redhat.com

Mao Zhongyi (3):
  migration/migration: improve error reporting for migrate parameters
  monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed()
  migration: move the units of migrate parameters from milliseconds to
    ms

 migration/migration.c | 20 ++++++++++++--------
 monitor/hmp-cmds.c    | 13 ++++++++-----
 2 files changed, 20 insertions(+), 13 deletions(-)

-- 
2.17.1





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

* [PATCH v2 1/3] migration/migration: improve error reporting for migrate parameters
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
@ 2020-03-31  8:22 ` Mao Zhongyi
  2020-03-31  8:26   ` Juan Quintela
  2020-03-31  8:22 ` [PATCH v2 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed() Mao Zhongyi
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Mao Zhongyi @ 2020-03-31  8:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert, Mao Zhongyi, quintela

use QERR_INVALID_PARAMETER_VALUE instead of
"Parameter '%s' expects" for consistency.

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
---
 migration/migration.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 2b7b5bccfa..5a6436d035 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1202,16 +1202,19 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
     }
 
     if (params->has_max_bandwidth && (params->max_bandwidth > SIZE_MAX)) {
-        error_setg(errp, "Parameter 'max_bandwidth' expects an integer in the"
-                         " range of 0 to %zu bytes/second", SIZE_MAX);
+        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+                   "max_bandwidth",
+                   "an integer in the range of 0 to "stringify(SIZE_MAX)
+                   " bytes/second");
         return false;
     }
 
     if (params->has_downtime_limit &&
         (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) {
-        error_setg(errp, "Parameter 'downtime_limit' expects an integer in "
-                         "the range of 0 to %d milliseconds",
-                         MAX_MIGRATE_DOWNTIME);
+        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+                   "downtime_limit",
+                   "an integer in the range of 0 to "
+                    stringify(MAX_MIGRATE_DOWNTIME)" milliseconds");
         return false;
     }
 
@@ -2108,9 +2111,10 @@ void qmp_migrate_set_speed(int64_t value, Error **errp)
 void qmp_migrate_set_downtime(double value, Error **errp)
 {
     if (value < 0 || value > MAX_MIGRATE_DOWNTIME_SECONDS) {
-        error_setg(errp, "Parameter 'downtime_limit' expects an integer in "
-                         "the range of 0 to %d seconds",
-                         MAX_MIGRATE_DOWNTIME_SECONDS);
+        error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+                   "downtime_limit",
+                   "an integer in the range of 0 to "
+                    stringify(MAX_MIGRATE_DOWNTIME_SECONDS)" seconds");
         return;
     }
 
-- 
2.17.1





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

* [PATCH v2 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed()
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
  2020-03-31  8:22 ` [PATCH v2 1/3] migration/migration: improve error " Mao Zhongyi
@ 2020-03-31  8:22 ` Mao Zhongyi
  2020-03-31  8:22 ` [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms Mao Zhongyi
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Mao Zhongyi @ 2020-03-31  8:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert, Mao Zhongyi, quintela

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
 monitor/hmp-cmds.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 790fad3afe..63097ddcc8 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -1203,8 +1203,11 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict)
 /* Kept for backwards compatibility */
 void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict)
 {
+    Error *err = NULL;
+
     int64_t value = qdict_get_int(qdict, "value");
-    qmp_migrate_set_speed(value, NULL);
+    qmp_migrate_set_speed(value, &err);
+    hmp_handle_error(mon, err);
 }
 
 void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict)
-- 
2.17.1





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

* [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
  2020-03-31  8:22 ` [PATCH v2 1/3] migration/migration: improve error " Mao Zhongyi
  2020-03-31  8:22 ` [PATCH v2 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed() Mao Zhongyi
@ 2020-03-31  8:22 ` Mao Zhongyi
  2020-04-01  7:32   ` Stefano Garzarella
  2020-03-31 11:22 ` [PATCH v2 0/3] Improved reporting for migrate parameters no-reply
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: Mao Zhongyi @ 2020-03-31  8:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: dgilbert, Mao Zhongyi, quintela

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 2 +-
 monitor/hmp-cmds.c    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 5a6436d035..b3d36d1467 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1214,7 +1214,7 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
                    "downtime_limit",
                    "an integer in the range of 0 to "
-                    stringify(MAX_MIGRATE_DOWNTIME)" milliseconds");
+                    stringify(MAX_MIGRATE_DOWNTIME)" ms");
         return false;
     }
 
diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
index 63097ddcc8..c5de8af1ee 100644
--- a/monitor/hmp-cmds.c
+++ b/monitor/hmp-cmds.c
@@ -231,18 +231,18 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
             monitor_printf(mon, "\n");
         }
 
-        monitor_printf(mon, "total time: %" PRIu64 " milliseconds\n",
+        monitor_printf(mon, "total time: %" PRIu64 " ms\n",
                        info->total_time);
         if (info->has_expected_downtime) {
-            monitor_printf(mon, "expected downtime: %" PRIu64 " milliseconds\n",
+            monitor_printf(mon, "expected downtime: %" PRIu64 " ms\n",
                            info->expected_downtime);
         }
         if (info->has_downtime) {
-            monitor_printf(mon, "downtime: %" PRIu64 " milliseconds\n",
+            monitor_printf(mon, "downtime: %" PRIu64 " ms\n",
                            info->downtime);
         }
         if (info->has_setup_time) {
-            monitor_printf(mon, "setup: %" PRIu64 " milliseconds\n",
+            monitor_printf(mon, "setup: %" PRIu64 " ms\n",
                            info->setup_time);
         }
     }
-- 
2.17.1





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

* Re: [PATCH v2 1/3] migration/migration: improve error reporting for migrate parameters
  2020-03-31  8:22 ` [PATCH v2 1/3] migration/migration: improve error " Mao Zhongyi
@ 2020-03-31  8:26   ` Juan Quintela
  0 siblings, 0 replies; 10+ messages in thread
From: Juan Quintela @ 2020-03-31  8:26 UTC (permalink / raw)
  To: Mao Zhongyi; +Cc: qemu-devel, dgilbert

Mao Zhongyi <maozhongyi@cmss.chinamobile.com> wrote:
> use QERR_INVALID_PARAMETER_VALUE instead of
> "Parameter '%s' expects" for consistency.
>
> Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>



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

* Re: [PATCH v2 0/3] Improved reporting for migrate parameters
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
                   ` (2 preceding siblings ...)
  2020-03-31  8:22 ` [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms Mao Zhongyi
@ 2020-03-31 11:22 ` no-reply
  2020-03-31 11:26 ` no-reply
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: no-reply @ 2020-03-31 11:22 UTC (permalink / raw)
  To: maozhongyi; +Cc: quintela, qemu-devel, maozhongyi, dgilbert

Patchew URL: https://patchew.org/QEMU/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===




The full log is available at
http://patchew.org/logs/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 0/3] Improved reporting for migrate parameters
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
                   ` (3 preceding siblings ...)
  2020-03-31 11:22 ` [PATCH v2 0/3] Improved reporting for migrate parameters no-reply
@ 2020-03-31 11:26 ` no-reply
  2020-03-31 11:28 ` no-reply
  2020-05-07 14:46 ` Dr. David Alan Gilbert
  6 siblings, 0 replies; 10+ messages in thread
From: no-reply @ 2020-03-31 11:26 UTC (permalink / raw)
  To: maozhongyi; +Cc: quintela, qemu-devel, maozhongyi, dgilbert

Patchew URL: https://patchew.org/QEMU/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/



Hi,

This series failed build test on FreeBSD host. Please find the details below.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
# Testing script will be invoked under the git checkout with
# HEAD pointing to a commit that has the patches applied on top of "base"
# branch
if qemu-system-x86_64 --help >/dev/null 2>&1; then
  QEMU=qemu-system-x86_64
elif /usr/libexec/qemu-kvm --help >/dev/null 2>&1; then
  QEMU=/usr/libexec/qemu-kvm
else
  exit 1
fi
make vm-build-freebsd J=21 QEMU=$QEMU
exit 0
=== TEST SCRIPT END ===




The full log is available at
http://patchew.org/logs/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/testing.FreeBSD/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 0/3] Improved reporting for migrate parameters
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
                   ` (4 preceding siblings ...)
  2020-03-31 11:26 ` no-reply
@ 2020-03-31 11:28 ` no-reply
  2020-05-07 14:46 ` Dr. David Alan Gilbert
  6 siblings, 0 replies; 10+ messages in thread
From: no-reply @ 2020-03-31 11:28 UTC (permalink / raw)
  To: maozhongyi; +Cc: quintela, qemu-devel, maozhongyi, dgilbert

Patchew URL: https://patchew.org/QEMU/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH v2 0/3] Improved reporting for migrate parameters
Message-id: cover.1585641083.git.maozhongyi@cmss.chinamobile.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

fatal: unable to access 'https://github.com/patchew-project/qemu/': Failed connect to github.com:443; Connection timed out
Traceback (most recent call last):
  File "patchew-tester2/src/patchew-cli", line 531, in test_one
    git_clone_repo(clone, r["repo"], r["head"], logf, True)
  File "patchew-tester2/src/patchew-cli", line 57, in git_clone_repo
    cwd=cache_repo, stdout=logf, stderr=logf)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['git', 'fetch', '3c8cf5a9c21ff8782164d1def7f44bd888713384', '+refs/tags/patchew/cover.1585641083.git.maozhongyi@cmss.chinamobile.com:refs/tags/patchew/cover.1585641083.git.maozhongyi@cmss.chinamobile.com']' returned non-zero exit status 128.



The full log is available at
http://patchew.org/logs/cover.1585641083.git.maozhongyi@cmss.chinamobile.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms
  2020-03-31  8:22 ` [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms Mao Zhongyi
@ 2020-04-01  7:32   ` Stefano Garzarella
  0 siblings, 0 replies; 10+ messages in thread
From: Stefano Garzarella @ 2020-04-01  7:32 UTC (permalink / raw)
  To: Mao Zhongyi; +Cc: quintela, qemu-devel, dgilbert

On Tue, Mar 31, 2020 at 04:22:07PM +0800, Mao Zhongyi wrote:
> Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
> Reviewed-by: Juan Quintela <quintela@redhat.com>
> ---
>  migration/migration.c | 2 +-
>  monitor/hmp-cmds.c    | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)

Thank you for these changes!

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

> 
> diff --git a/migration/migration.c b/migration/migration.c
> index 5a6436d035..b3d36d1467 100644
> --- a/migration/migration.c
> +++ b/migration/migration.c
> @@ -1214,7 +1214,7 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp)
>          error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
>                     "downtime_limit",
>                     "an integer in the range of 0 to "
> -                    stringify(MAX_MIGRATE_DOWNTIME)" milliseconds");
> +                    stringify(MAX_MIGRATE_DOWNTIME)" ms");
>          return false;
>      }
>  
> diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c
> index 63097ddcc8..c5de8af1ee 100644
> --- a/monitor/hmp-cmds.c
> +++ b/monitor/hmp-cmds.c
> @@ -231,18 +231,18 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
>              monitor_printf(mon, "\n");
>          }
>  
> -        monitor_printf(mon, "total time: %" PRIu64 " milliseconds\n",
> +        monitor_printf(mon, "total time: %" PRIu64 " ms\n",
>                         info->total_time);
>          if (info->has_expected_downtime) {
> -            monitor_printf(mon, "expected downtime: %" PRIu64 " milliseconds\n",
> +            monitor_printf(mon, "expected downtime: %" PRIu64 " ms\n",
>                             info->expected_downtime);
>          }
>          if (info->has_downtime) {
> -            monitor_printf(mon, "downtime: %" PRIu64 " milliseconds\n",
> +            monitor_printf(mon, "downtime: %" PRIu64 " ms\n",
>                             info->downtime);
>          }
>          if (info->has_setup_time) {
> -            monitor_printf(mon, "setup: %" PRIu64 " milliseconds\n",
> +            monitor_printf(mon, "setup: %" PRIu64 " ms\n",
>                             info->setup_time);
>          }
>      }
> -- 
> 2.17.1
> 
> 
> 
> 



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

* Re: [PATCH v2 0/3] Improved reporting for migrate parameters
  2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
                   ` (5 preceding siblings ...)
  2020-03-31 11:28 ` no-reply
@ 2020-05-07 14:46 ` Dr. David Alan Gilbert
  6 siblings, 0 replies; 10+ messages in thread
From: Dr. David Alan Gilbert @ 2020-05-07 14:46 UTC (permalink / raw)
  To: Mao Zhongyi; +Cc: qemu-devel, quintela

* Mao Zhongyi (maozhongyi@cmss.chinamobile.com) wrote:
> This series mainly improve the report message of migrate parameters
> to make it easier to read.

Queued

> v2->v1
> -p1: avoid using constants, replace it with stringify().
> 
> Cc: quintela@redhat.com
> Cc: dgilbert@redhat.com
> 
> Mao Zhongyi (3):
>   migration/migration: improve error reporting for migrate parameters
>   monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed()
>   migration: move the units of migrate parameters from milliseconds to
>     ms
> 
>  migration/migration.c | 20 ++++++++++++--------
>  monitor/hmp-cmds.c    | 13 ++++++++-----
>  2 files changed, 20 insertions(+), 13 deletions(-)
> 
> -- 
> 2.17.1
> 
> 
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



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

end of thread, other threads:[~2020-05-07 14:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31  8:22 [PATCH v2 0/3] Improved reporting for migrate parameters Mao Zhongyi
2020-03-31  8:22 ` [PATCH v2 1/3] migration/migration: improve error " Mao Zhongyi
2020-03-31  8:26   ` Juan Quintela
2020-03-31  8:22 ` [PATCH v2 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed() Mao Zhongyi
2020-03-31  8:22 ` [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms Mao Zhongyi
2020-04-01  7:32   ` Stefano Garzarella
2020-03-31 11:22 ` [PATCH v2 0/3] Improved reporting for migrate parameters no-reply
2020-03-31 11:26 ` no-reply
2020-03-31 11:28 ` no-reply
2020-05-07 14:46 ` Dr. David Alan Gilbert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.