OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61964c2
)
migration: Use cmpxchg correctly
author
Juan Quintela
<quintela@redhat.com>
Wed, 17 Jun 2015 00:06:20 +0000
(
02:06
+0200)
committer
Juan Quintela
<quintela@redhat.com>
Tue, 7 Jul 2015 12:54:53 +0000
(14:54 +0200)
cmpxchg returns the old value
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/migration.c
patch
|
blob
|
history
diff --git
a/migration/migration.c
b/migration/migration.c
index
edb4f3e
..
1e34aa5
100644
(file)
--- a/
migration/migration.c
+++ b/
migration/migration.c
@@
-509,7
+509,7
@@
void qmp_migrate_set_parameters(bool has_compress_level,
static void migrate_set_state(MigrationState *s, int old_state, int new_state)
{
- if (atomic_cmpxchg(&s->state, old_state, new_state) ==
new
_state) {
+ if (atomic_cmpxchg(&s->state, old_state, new_state) ==
old
_state) {
trace_migrate_set_state(new_state);
}
}