[libvirt] [PATCH] Check for --live flag for postcopy-after-precopy migration

Unlike postcopy migration there is no --live flag check for postcopy-after-precopy. Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com> --- tools/virsh-domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index de2a22c..798a1ff 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10317,6 +10317,12 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd) } if (vshCommandOptBool(cmd, "postcopy-after-precopy")) { + if (!live_flag) { + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", + _("post-copy migration is not supported with " + "non-live or paused migration")); + goto cleanup; + } iterEvent = virConnectDomainEventRegisterAny( priv->conn, dom, VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION,

On 26.08.2016 11:25, Kothapally Madhu Pavan wrote:
Unlike postcopy migration there is no --live flag check for postcopy-after-precopy.
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com> --- tools/virsh-domain.c | 6 ++++++ 1 file changed, 6 insertions(+)
ACKed and pushed. Michal

On Fri, Aug 26, 2016 at 21:41:31 +0200, Michal Privoznik wrote:
On 26.08.2016 11:25, Kothapally Madhu Pavan wrote:
Unlike postcopy migration there is no --live flag check for postcopy-after-precopy.
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com> --- tools/virsh-domain.c | 6 ++++++ 1 file changed, 6 insertions(+)
ACKed and pushed.
This doesn't make any sense. First, post-copy migration is enabled with --postcopy option to migrate command and --postcopy-after-precopy is just an additional flag for post-copy migration. So if virsh was to report such an error, it should check for --postcopy option. But such check doesn't belong to libvirt at all, the appropriate libvirt driver is supposed to check for the flags and report invalid combinations. Jirka

On Fri, Aug 26, 2016 at 21:41:31 +0200, Michal Privoznik wrote:
On 26.08.2016 11:25, Kothapally Madhu Pavan wrote:
Unlike postcopy migration there is no --live flag check for postcopy-after-precopy.
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com> --- tools/virsh-domain.c | 6 ++++++ 1 file changed, 6 insertions(+)
ACKed and pushed. This doesn't make any sense. First, post-copy migration is enabled with --postcopy option to migrate command and --postcopy-after-precopy is just an additional flag for post-copy migration. So if virsh was to report such an error, it should check for --postcopy option. But such check doesn't belong to libvirt at all, the appropriate libvirt driver is supposed to check for the flags and report invalid combinations. I have proposed this patch as the qemu driver doesn't have
On 08/27/2016 02:21 AM, Jiri Denemark wrote: postcopy-after-precopy flag and this bug can be fixed by minimal changes in libvirt. If we have to check for invalid combinations in appropriate libvirt drivers, we need to create a flag for postcopy-after-precopy migration. I will be happy to send another patch if this is what needed. Thanks, Madhu Pavan.

On Mon, Aug 29, 2016 at 16:42:04 +0530, Madhu Pavan wrote:
On Fri, Aug 26, 2016 at 21:41:31 +0200, Michal Privoznik wrote:
On 26.08.2016 11:25, Kothapally Madhu Pavan wrote:
Unlike postcopy migration there is no --live flag check for postcopy-after-precopy.
Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com> --- tools/virsh-domain.c | 6 ++++++ 1 file changed, 6 insertions(+)
ACKed and pushed. This doesn't make any sense. First, post-copy migration is enabled with --postcopy option to migrate command and --postcopy-after-precopy is just an additional flag for post-copy migration. So if virsh was to report such an error, it should check for --postcopy option. But such check doesn't belong to libvirt at all, the appropriate libvirt driver is supposed to check for the flags and report invalid combinations. I have proposed this patch as the qemu driver doesn't have
On 08/27/2016 02:21 AM, Jiri Denemark wrote: postcopy-after-precopy flag and this bug can be fixed by minimal changes in libvirt. If we have to check for invalid combinations in appropriate libvirt drivers, we need to create a flag for postcopy-after-precopy migration. I will be happy to send another patch if this is what needed.
Heh, you're right indeed. I think I really shouldn't try reviewing stuff during a conference. So the place is correct, but I still think it should be done in a different way. As I said --postcopy-after-precopy is just an additional flag for --postcopy and thus we should check that --postcopy is present rather than checking for --live and the error message should reflect that (e.g., "--postcopy-after-precopy can only be used with --postcopy"). Jirka
participants (4)
-
Jiri Denemark
-
Kothapally Madhu Pavan
-
Madhu Pavan
-
Michal Privoznik