Skip to contentSkip to conversation

new->old version migration

Qemu-devel Michael S. Tsirkin 4 participants 15 messages Feb 7, 2011 – Feb 8, 2011

lore
Share & tools
lore
#0 lore raw

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 9 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

Pls comment.

Signature · 1 line
MST
#1 lore raw
Quoted 11 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 8 lines
Quoted 2 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

I think lack of testing is the primary thing preventing this. We can catch things like this in code review, but it's hard to commit to support it if we can't reliably catch problems. This one, we did catch, and I think it's useful to put Amit's fix upstream, even if other devices end up having issues.

Quoted 9 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

This seems unnecessarily complicated. It makes sense to me that we should track both the guest visible machine and the migration data format with the same option. In fact, I can't think of a good reason for these ever being different and how we'd support it if they were. There's plenty wrong with the migration data format, but that's a longer term discussion, and I think this is appropriate given what we have today.

Alex

#2 lore raw
Quoted 21 lines · Alex Williamson
Quoted 11 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 8 lines
Quoted 2 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Quoted 5 lines

I think lack of testing is the primary thing preventing this. We can catch things like this in code review, but it's hard to commit to support it if we can't reliably catch problems. This one, we did catch, and I think it's useful to put Amit's fix upstream, even if other devices end up having issues.

It's not just testing. Look at the specific example. The requirement for new->old migration makes us keep broken code without flow control around. This will only increase with time and the mess here is not limited to vmstate, unlike the old->new format which generally makes us do conversion at load time, so it's contained.

Quoted 18 lines
Quoted 9 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

This seems unnecessarily complicated. It makes sense to me that we should track both the guest visible machine and the migration data format with the same option. In fact, I can't think of a good reason for these ever being different and how we'd support it if they were. There's plenty wrong with the migration data format, but that's a longer term discussion, and I think this is appropriate given what we have today.

Quoted 2 lines

Alex

Take the specific example. 0.13 has trouble under stress, it loses data. -M 0.13 is needed if you created the guest under 0.14, to make upgrading hypervisors seamless.

This patch would force disabling flow control which is not needed if both version being migrated between are 0.14.

Signature · 1 line
MST
#3 lore raw
Quoted 31 lines · Michael S. Tsirkin
Quoted 23 lines · Alex Williamson
Quoted 12 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 9 lines
Quoted 3 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Quoted 6 lines

I think lack of testing is the primary thing preventing this. We can catch things like this in code review, but it's hard to commit to support it if we can't reliably catch problems. This one, we did catch, and I think it's useful to put Amit's fix upstream, even if other devices end up having issues.

Quoted 6 lines

It's not just testing. Look at the specific example. The requirement for new->old migration makes us keep broken code without flow control around. This will only increase with time and the mess here is not limited to vmstate, unlike the old->new format which generally makes us do conversion at load time, so it's contained.

I haven't looked closely at the specific example but subsections allow us to migrate a state only when it's value is not what the old version defaults to. This is the only way we can have our cake and eat it too. Anything less compromises integrity.

Regards,

Anthony Liguori

Quoted 32 lines
Quoted 19 lines
Quoted 11 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

This seems unnecessarily complicated. It makes sense to me that we should track both the guest visible machine and the migration data format with the same option. In fact, I can't think of a good reason for these ever being different and how we'd support it if they were. There's plenty wrong with the migration data format, but that's a longer term discussion, and I think this is appropriate given what we have today.

Quoted 3 lines

Alex

Take the specific example. 0.13 has trouble under stress, it loses data. -M 0.13 is needed if you created the guest under 0.14, to make upgrading hypervisors seamless.

This patch would force disabling flow control which is not needed if both version being migrated between are 0.14.

#4 lore raw
In reply to Michael S. Tsirkin
Quoted 12 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 9 lines
Quoted 3 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Only within a stable release series and only when it's possible without sacrificing integrity. I know some downstreams disagree with this but I don't think this is a business we want to get into.

Regards,

Anthony Liguori

Quoted 13 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

Pls comment.

#5 lore raw
Quoted 20 lines · Anthony Liguori
Quoted 11 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 7 lines
Quoted 2 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Quoted 18 lines

Only within a stable release series and only when it's possible without sacrificing integrity. I know some downstreams disagree with this but I don't think this is a business we want to get into.

Regards,

Anthony Liguori

Quoted 11 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

Pls comment.

OK, assuming we want this, let's talk about implementation. I think that spreading custom flags all over the code like this patch does would be pretty bad.

What I'd like to see is a way to
- map stable versions (e.g. machine type if we are going to tie to that) to savevm format using
some kind of table
- for save callbacks to be able to figure out what version to use

Signature · 1 line
MST
#6 lore raw
Quoted 49 lines · Michael S. Tsirkin
Quoted 23 lines · Anthony Liguori
Quoted 12 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 9 lines
Quoted 3 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Quoted 20 lines

Only within a stable release series and only when it's possible without sacrificing integrity. I know some downstreams disagree with this but I don't think this is a business we want to get into.

Regards,

Anthony Liguori

Quoted 12 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

Pls comment.

OK, assuming we want this, let's talk about implementation. I think that spreading custom flags all over the code like this patch does would be pretty bad.

Quoted 7 lines

What I'd like to see is a way to
- map stable versions (e.g. machine type if we are going to tie to that) to savevm format using
some kind of table
- for save callbacks to be able to figure out what version to use

Why doesn't subsections already solve this problem?

Regards,

Anthony Liguori

#7 lore raw
Quoted 50 lines · Anthony Liguori
Quoted 42 lines · Michael S. Tsirkin
Quoted 19 lines · Anthony Liguori
Quoted 11 lines · Michael S. Tsirkin

New thread stated intentionally, the original patch is Message-ID:
<349e93a4cfc6e1effc1b681cae53f805fdb9624e.1296713825.git.amit.shah@redhat.com>

Quoted 7 lines · Amit Shah

Add a compat property for older machine types. When this is used (via -M pc-0.13, for example), the new flow control mechanisms will not be used. This is done to keep migration from a machine started with older type on a pc-0.14+ qemu to an older machine working.

The property is named 'flow_control' and defaults to on.

Quoted 7 lines
Quoted 2 lines

So, I think there are two things that need to be agreed on:

- Can we commit to support migration from new qemu version to an old one? We haven't in the past but downstreams do want this,
so it makes sense to have the infrastructure upstream.

Quoted 18 lines

Only within a stable release series and only when it's possible without sacrificing integrity. I know some downstreams disagree with this but I don't think this is a business we want to get into.

Regards,

Anthony Liguori

Quoted 11 lines

- The infrastructure/command line option for such support. We have the -M flags to describe the machine that
we are running, but that abstracts away guest-visible machine, which the migration format is not.
Also, same qemu could migrate to any older version. So I think we would have to add a flag (call it -V for now) to savevm/migrate commands to specify the format to be used. Naturally some machines would be incompatible with specific -V values, that's nothing new.

Pls comment.

OK, assuming we want this, let's talk about implementation. I think that spreading custom flags all over the code like this patch does would be pretty bad.

Quoted 6 lines

What I'd like to see is a way to
- map stable versions (e.g. machine type if we are going to tie to that) to savevm format using
some kind of table
- for save callbacks to be able to figure out what version to use

Quoted 5 lines

Why doesn't subsections already solve this problem?

Regards,

Anthony Liguori

How does it? We need to know we are saving in 0.13 format and skip the new subsection, otherwise 0.13 will see a subsection it does not recognize and exit.

We also need API to add subsections without vmstate, because virtio serial wasn't yet converted.

Signature · 1 line
MST
#8 lore raw
Quoted 5 lines · Michael S. Tsirkin

How does it? We need to know we are saving in 0.13 format and skip the new subsection, otherwise 0.13 will see a subsection it does not recognize and exit.

If you used subsections for flow control, presumably you would only send the new savevm data if you had data buffered.

If you add a qdev property to enable/disable flow control, then if it's disabled, you naturally would never send the subsection because you'd never buffer data. So no explicit code is needed to support migration.

The difficult case is when you truly need to change the savevm version. I don't think we have a proper fix for this because versions are linear so the proposed patch certainly wouldn't be a good way to do it. if flow_control=0 causes savevm 3 to be used instead of 4, and then the next_feature=0 causes savevm 4 to be used instead of 5, the semantics of flow_control=0,next_feature=1 becomes problematic.

But as long as the feature has isolated state, we can solve the problem robustly with subsections.

Regards,

Anthony Liguori

Quoted 4 lines

We also need API to add subsections without vmstate, because virtio serial wasn't yet converted.

#9 lore raw
Quoted 6 lines · Anthony Liguori
Quoted 4 lines · Michael S. Tsirkin

How does it? We need to know we are saving in 0.13 format and skip the new subsection, otherwise 0.13 will see a subsection it does not recognize and exit.

Quoted 7 lines

If you used subsections for flow control, presumably you would only send the new savevm data if you had data buffered.

If you add a qdev property to enable/disable flow control, then if it's disabled, you naturally would never send the subsection because you'd never buffer data. So no explicit code is needed to support migration.

But the result is we get a new property that we can never remove as any qdev property is part of interface.

Quoted 8 lines

The difficult case is when you truly need to change the savevm version. I don't think we have a proper fix for this because versions are linear so the proposed patch certainly wouldn't be a good way to do it. if flow_control=0 causes savevm 3 to be used instead of 4, and then the next_feature=0 causes savevm 4 to be used instead of 5, the semantics of flow_control=0,next_feature=1 becomes problematic.

Quoted 6 lines

But as long as the feature has isolated state, we can solve the problem robustly with subsections.

Regards,

Anthony Liguori

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration
2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu < 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

Quoted 3 lines
Quoted 3 lines

We also need API to add subsections without vmstate, because virtio serial wasn't yet converted.

#10 lore raw
Quoted 9 lines · Michael S. Tsirkin

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration
2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu < 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

If a machine is started with -M pc-0.13 then we can safely assume the user will want to migrate to another 0.13 machine.

Also, flow control is not part of qemu yet. This code ensures that when flow control lands, we'll be ready to use it.

So there's 0 difference with this code to a user that runs with -M pc-0.13. But this code will ensure a user running with 0.15 and 0.14 can migrate among the two machine types with and without flow control being available (assuming chardev flow control lands in 0.15).

Amit

#11 lore raw
Quoted 12 lines · Amit Shah
Quoted 10 lines · Michael S. Tsirkin

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration
2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu< 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

Quoted 3 lines

If a machine is started with -M pc-0.13 then we can safely assume the user will want to migrate to another 0.13 machine.

No, a user wants a guest that works. If there was a bug in 0.13 and it's fixed in 0.14, then reintroducing the bug in -M pc-0.13 is not expected.

Regards,

Anthony Liguori

#12 lore raw
Quoted 11 lines · Anthony Liguori
Quoted 10 lines · Amit Shah
Quoted 9 lines · Michael S. Tsirkin

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration
2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu< 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

Quoted 6 lines
Quoted 2 lines

If a machine is started with -M pc-0.13 then we can safely assume the user will want to migrate to another 0.13 machine.

No, a user wants a guest that works. If there was a bug in 0.13 and it's fixed in 0.14, then reintroducing the bug in -M pc-0.13 is not expected.

For this particular patch and use-case, the bug exists in 0.13 as well as 0.14. It's just the migration state that has changed, no other guest- or host- visible changes.

Amit

#13 lore raw
In reply to Michael S. Tsirkin
Quoted 32 lines · Michael S. Tsirkin
Quoted 7 lines · Anthony Liguori
Quoted 5 lines · Michael S. Tsirkin

How does it? We need to know we are saving in 0.13 format and skip the new subsection, otherwise 0.13 will see a subsection it does not recognize and exit.

Quoted 8 lines

If you used subsections for flow control, presumably you would only send the new savevm data if you had data buffered.

If you add a qdev property to enable/disable flow control, then if it's disabled, you naturally would never send the subsection because you'd never buffer data. So no explicit code is needed to support migration.

But the result is we get a new property that we can never remove as any qdev property is part of interface.

Quoted 11 lines

The difficult case is when you truly need to change the savevm version. I don't think we have a proper fix for this because versions are linear so the proposed patch certainly wouldn't be a good way to do it. if flow_control=0 causes savevm 3 to be used instead of 4, and then the next_feature=0 causes savevm 4 to be used instead of 5, the semantics of flow_control=0,next_feature=1 becomes problematic.

But as long as the feature has isolated state, we can solve the problem robustly with subsections.

Quoted 8 lines
Quoted 4 lines

Regards,

Anthony Liguori

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration

Yeah, but it's no different than say msi enablement.

Quoted 7 lines

2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu< 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

It depends on whether we consider flow control a feature or a bug. If it's a bug, then we have to bump the live migration version and then live with the compatibility breakage.

Regards,

Anthony Liguori

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

We also need API to add subsections without vmstate, because virtio serial wasn't yet converted.

#14 lore raw
Quoted 28 lines · Anthony Liguori
Quoted 27 lines · Michael S. Tsirkin
Quoted 5 lines · Anthony Liguori
Quoted 4 lines · Michael S. Tsirkin

How does it? We need to know we are saving in 0.13 format and skip the new subsection, otherwise 0.13 will see a subsection it does not recognize and exit.

Quoted 7 lines

If you used subsections for flow control, presumably you would only send the new savevm data if you had data buffered.

If you add a qdev property to enable/disable flow control, then if it's disabled, you naturally would never send the subsection because you'd never buffer data. So no explicit code is needed to support migration.

But the result is we get a new property that we can never remove as any qdev property is part of interface.

Quoted 11 lines

The difficult case is when you truly need to change the savevm version. I don't think we have a proper fix for this because versions are linear so the proposed patch certainly wouldn't be a good way to do it. if flow_control=0 causes savevm 3 to be used instead of 4, and then the next_feature=0 causes savevm 4 to be used instead of 5, the semantics of flow_control=0,next_feature=1 becomes problematic.

But as long as the feature has isolated state, we can solve the problem robustly with subsections.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Regards,

Anthony Liguori

I see. I'm unhappy with the facts that
1. if (feature) is spread all over the code instead of just in migration

Yeah, but it's no different than say msi enablement.

I think it's different, some guests might have bad support for msi, so ability to disable it in qemu is useful.

Quoted 7 lines
Quoted 6 lines

2. it is also obfuscated with if (flow_control) instead of plain if (migrate to qemu< 0.14) so removing it will be much harder
3. this forces anyone who wants
a VM compatible with qemu 0.13 to also lose data, even if migration to 0.13 is never attempted.

Quoted 7 lines

It depends on whether we consider flow control a feature or a bug. If it's a bug, then we have to bump the live migration version and then live with the compatibility breakage.

Regards,

Anthony Liguori

I'm not sure. I don't see how it's useful to drop frames but maybe I'm wrong. Amit?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

We also need API to add subsections without vmstate, because virtio serial wasn't yet converted.