]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Fix ABI stability check for spicevmc channel
authorJiri Denemark <jdenemar@redhat.com>
Fri, 17 Aug 2012 12:06:13 +0000 (14:06 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 17 Aug 2012 19:26:53 +0000 (21:26 +0200)
Change device type of a virtio channel from/to spicevmc is not a user
visible change. However, spicevmc channels use different default target
name than other virtio channels. To maintain ABI stability during this
change target name must be explicitly specified (and equal) in both
configurations.

src/conf/domain_conf.c

index a2e73c69a8e333c1838bdd8c023540ffa296cb4f..a330b0e3a37a5e8e31b15b049f3f814c782635b0 100644 (file)
@@ -10075,6 +10075,15 @@ static bool virDomainChannelDefCheckABIStability(virDomainChrDefPtr src,
                            NULLSTR(dst->target.name), NULLSTR(src->target.name));
             goto cleanup;
         }
+        if (src->source.type != dst->source.type &&
+            (src->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC ||
+             dst->source.type == VIR_DOMAIN_CHR_TYPE_SPICEVMC) &&
+            !src->target.name) {
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                           _("Changing device type to/from spicevmc would"
+                             " change default target channel name"));
+            goto cleanup;
+        }
         break;
     case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
         if (memcmp(src->target.addr, dst->target.addr,