<div dir="ltr"><div>Hello Jiri,<br><br></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 8, 2016 at 8:31 PM, Jiri Denemark <span dir="ltr"><<a href="mailto:jdenemar@redhat.com" target="_blank">jdenemar@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Thu, Mar 03, 2016 at 06:08:20 -0500, Nitesh Konkar wrote:<br>
> ---<br>
> src/libvirt-domain.c | 27 +++++++++++++++++++++++++++<br>
> 1 file changed, 27 insertions(+)<br>
><br>
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c<br>
> index 9491845..dc11945 100644<br>
> --- a/src/libvirt-domain.c<br>
> +++ b/src/libvirt-domain.c<br>
> @@ -3617,6 +3617,15 @@ virDomainMigrate(virDomainPtr domain,<br>
> error);<br>
><br>
> + if (flags & VIR_MIGRATE_OFFLINE) {<br>
<br>
</span>I asked you to move the following if () {...} block...<br>
<span class=""><br></span></blockquote><div> </div><div>Sorry, I missed this out. Will rectify it in the next patch.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
> + if (flags & VIR_MIGRATE_LIVE) {<br>
> + virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",<br>
> + _("Live and offline migration flags are "<br>
> + "mutually exclusive"));<br>
> + goto error;<br>
> + }<br>
> + }<br>
> +<br>
> if (flags & VIR_MIGRATE_OFFLINE) {<br>
<br>
</span>... here.<br>
<span class=""><br>
> if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,<br>
> VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {<br>
> virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",<br>
<br>
</span>I wanted to do that and push the patch, but I realized the patch is<br>
incomplete (it doesn't cover MigrateToURI* APIs) and there is even a<br>
better place to add these checks...<br>
<br>
Something like the following (untested):<br>
<br></blockquote><div><br></div><div>But, changes in qemuMigrationBeginPhase and qemuMigrationPrepareAny would necessitate changes to all drivers domainMigrate* specific implementations right ? <br></div><div>I feel what we have is better. What is your opinion on it ? :-)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
diff --git i/src/qemu/qemu_migration.c w/src/qemu/qemu_migration.c<br>
index 64cbffa..36a939d 100644<br>
--- i/src/qemu/qemu_migration.c<br>
+++ w/src/qemu/qemu_migration.c<br>
@@ -3081,6 +3081,12 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,<br>
goto cleanup;<br>
<span class=""><br>
if (flags & VIR_MIGRATE_OFFLINE) {<br>
+ if (flags & VIR_MIGRATE_LIVE) {<br>
</span>+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",<br>
+ _("live and offline migration flags are "<br>
+ "mutually exclusive"));<br>
+ goto cleanup;<br>
+ }<br>
if (flags & (VIR_MIGRATE_NON_SHARED_DISK |<br>
VIR_MIGRATE_NON_SHARED_INC)) {<br>
virReportError(VIR_ERR_OPERATION_INVALID, "%s",<br>
@@ -3335,6 +3341,12 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,<br>
virNWFilterReadLockFilterUpdates();<br>
<span class=""><br>
if (flags & VIR_MIGRATE_OFFLINE) {<br>
+ if (flags & VIR_MIGRATE_LIVE) {<br>
</span>+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",<br>
+ _("live and offline migration flags are "<br>
+ "mutually exclusive"));<br>
+ goto cleanup;<br>
+ }<br>
if (flags & (VIR_MIGRATE_NON_SHARED_DISK |<br>
VIR_MIGRATE_NON_SHARED_INC)) {<br>
virReportError(VIR_ERR_OPERATION_INVALID, "%s",<br>
</blockquote></div>Looking forward to your reply.<br><br></div><div class="gmail_extra">Warm Regards,<br></div><div class="gmail_extra">Nitesh Konkar.<br></div></div>