[PATCH] lib: Prohibit parallel connections with tunneled migration

Jim Fehlig posted 1 patch 4 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200122030033.4290-1-jfehlig@suse.com
src/libvirt-domain.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
[PATCH] lib: Prohibit parallel connections with tunneled migration
Posted by Jim Fehlig 4 years, 2 months ago
As discussed on the developer list, parallel migration connections
are not compatible with tunneled migration

https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html

Prohibit the concurrent use of parallel and tunneled migration options.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
---

I added the check to all migration entry points except virDomainMigrate3,
where the p2p and tunneled options are already prohibitied.

 src/libvirt-domain.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 4074397b30..b910ba6b4d 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3546,6 +3546,10 @@ virDomainMigrate(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);
 
+    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+                             VIR_MIGRATE_PARALLEL,
+                             error);
+
     if (flags & VIR_MIGRATE_OFFLINE) {
         if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
                                       VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -3701,6 +3705,10 @@ virDomainMigrate2(virDomainPtr domain,
                              VIR_MIGRATE_NON_SHARED_INC,
                              error);
 
+    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+                             VIR_MIGRATE_PARALLEL,
+                             error);
+
     if (flags & VIR_MIGRATE_OFFLINE) {
         if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
                                       VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
@@ -4087,6 +4095,10 @@ virDomainMigrateToURI(virDomainPtr domain,
     virCheckReadOnlyGoto(domain->conn->flags, error);
     virCheckNonNullArgGoto(duri, error);
 
+    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+                             VIR_MIGRATE_PARALLEL,
+                             error);
+
     if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
         goto error;
 
@@ -4159,6 +4171,10 @@ virDomainMigrateToURI2(virDomainPtr domain,
     virCheckDomainReturn(domain, -1);
     virCheckReadOnlyGoto(domain->conn->flags, error);
 
+    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+                             VIR_MIGRATE_PARALLEL,
+                             error);
+
     if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
         goto error;
 
@@ -4232,6 +4248,10 @@ virDomainMigrateToURI3(virDomainPtr domain,
     virCheckDomainReturn(domain, -1);
     virCheckReadOnlyGoto(domain->conn->flags, error);
 
+    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
+                             VIR_MIGRATE_PARALLEL,
+                             error);
+
     if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
         goto error;
 
-- 
2.24.1


Re: [PATCH] lib: Prohibit parallel connections with tunneled migration
Posted by Ján Tomko 4 years, 2 months ago
On Wed, Jan 22, 2020 at 03:00:52AM +0000, Jim Fehlig wrote:
>As discussed on the developer list, parallel migration connections
>are not compatible with tunneled migration
>
>https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html
>
>Prohibit the concurrent use of parallel and tunneled migration options.
>
>Signed-off-by: Jim Fehlig <jfehlig@suse.com>
>---
>
>I added the check to all migration entry points except virDomainMigrate3,
>where the p2p and tunneled options are already prohibitied.
>
> src/libvirt-domain.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
Re: [PATCH] lib: Prohibit parallel connections with tunneled migration
Posted by Jim Fehlig 4 years, 2 months ago
Any comments on this patch?

Regards,
Jim

On 1/21/20 8:00 PM, Jim Fehlig wrote:
> As discussed on the developer list, parallel migration connections
> are not compatible with tunneled migration
> 
> https://www.redhat.com/archives/libvir-list/2020-January/msg00463.html
> 
> Prohibit the concurrent use of parallel and tunneled migration options.
> 
> Signed-off-by: Jim Fehlig <jfehlig@suse.com>
> ---
> 
> I added the check to all migration entry points except virDomainMigrate3,
> where the p2p and tunneled options are already prohibitied.
> 
>   src/libvirt-domain.c | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
> index 4074397b30..b910ba6b4d 100644
> --- a/src/libvirt-domain.c
> +++ b/src/libvirt-domain.c
> @@ -3546,6 +3546,10 @@ virDomainMigrate(virDomainPtr domain,
>                                VIR_MIGRATE_NON_SHARED_INC,
>                                error);
>   
> +    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
> +                             VIR_MIGRATE_PARALLEL,
> +                             error);
> +
>       if (flags & VIR_MIGRATE_OFFLINE) {
>           if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
>                                         VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
> @@ -3701,6 +3705,10 @@ virDomainMigrate2(virDomainPtr domain,
>                                VIR_MIGRATE_NON_SHARED_INC,
>                                error);
>   
> +    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
> +                             VIR_MIGRATE_PARALLEL,
> +                             error);
> +
>       if (flags & VIR_MIGRATE_OFFLINE) {
>           if (!VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
>                                         VIR_DRV_FEATURE_MIGRATION_OFFLINE)) {
> @@ -4087,6 +4095,10 @@ virDomainMigrateToURI(virDomainPtr domain,
>       virCheckReadOnlyGoto(domain->conn->flags, error);
>       virCheckNonNullArgGoto(duri, error);
>   
> +    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
> +                             VIR_MIGRATE_PARALLEL,
> +                             error);
> +
>       if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
>           goto error;
>   
> @@ -4159,6 +4171,10 @@ virDomainMigrateToURI2(virDomainPtr domain,
>       virCheckDomainReturn(domain, -1);
>       virCheckReadOnlyGoto(domain->conn->flags, error);
>   
> +    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
> +                             VIR_MIGRATE_PARALLEL,
> +                             error);
> +
>       if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
>           goto error;
>   
> @@ -4232,6 +4248,10 @@ virDomainMigrateToURI3(virDomainPtr domain,
>       virCheckDomainReturn(domain, -1);
>       virCheckReadOnlyGoto(domain->conn->flags, error);
>   
> +    VIR_EXCLUSIVE_FLAGS_GOTO(VIR_MIGRATE_TUNNELLED,
> +                             VIR_MIGRATE_PARALLEL,
> +                             error);
> +
>       if (virDomainMigrateUnmanagedCheckCompat(domain, flags) < 0)
>           goto error;
>   
>