[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/12] migration: cleanup check on ops in savevm.hand
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 02/12] migration: cleanup check on ops in savevm.handlers iterations |
Date: |
Thu, 12 Sep 2019 14:49:56 +0100 |
From: Wei Yang <address@hidden>
During migration, there are several places to iterate on
savevm.handlers. And on each iteration, we need to check its ops and
related callbacks before invoke it.
Generally, ops is the first element to check, and it is only necessary
to check it once.
This patch clean all the related part in savevm.c to check ops only once
in those iterations.
Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/savevm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 4a86128ac4..35426d1db8 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1100,7 +1100,7 @@ void qemu_savevm_state_setup(QEMUFile *f)
if (!se->ops || !se->ops->save_setup) {
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
@@ -1131,7 +1131,7 @@ int qemu_savevm_state_resume_prepare(MigrationState *s)
if (!se->ops || !se->ops->resume_prepare) {
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
@@ -1227,7 +1227,7 @@ void qemu_savevm_state_complete_postcopy(QEMUFile *f)
if (!se->ops || !se->ops->save_live_complete_postcopy) {
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
@@ -1264,7 +1264,7 @@ int qemu_savevm_state_complete_precopy_iterable(QEMUFile
*f, bool in_postcopy)
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
@@ -1413,7 +1413,7 @@ void qemu_savevm_state_pending(QEMUFile *f, uint64_t
threshold_size,
if (!se->ops || !se->ops->save_live_pending) {
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
@@ -2334,7 +2334,7 @@ static int qemu_loadvm_state_setup(QEMUFile *f)
if (!se->ops || !se->ops->load_setup) {
continue;
}
- if (se->ops && se->ops->is_active) {
+ if (se->ops->is_active) {
if (!se->ops->is_active(se->opaque)) {
continue;
}
--
2.21.0
- [Qemu-devel] [PULL 00/12] migration queue, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 02/12] migration: cleanup check on ops in savevm.handlers iterations,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 01/12] migration: multifd_send_thread always post p->sem_sync when error happen, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 03/12] hw/net/vmxnet3: Fix leftover unregister_savevm, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 04/12] migration: register_savevm_live doesn't need dev, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 05/12] qemu-file: Rework old qemu_fflush comment, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 06/12] migration: Add validate-uuid capability, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 07/12] tests/libqtest: Allow setting expected exit status, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 09/12] migration: Fix postcopy bw for recovery, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 08/12] tests/migration: Add a test for validate-uuid capability, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 10/12] migration/qemu-file: remove check on writev_buffer in qemu_put_compression_data, Dr. David Alan Gilbert (git), 2019/09/12
- [Qemu-devel] [PULL 11/12] migration/qemu-file: fix potential buf waste for extra buf_index adjustment, Dr. David Alan Gilbert (git), 2019/09/12