[PATCH] Set default name for SPICE agent channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libvirt documentation for channels with type 'spicevmc' says that the
'target' child node has:
"an optional attribute name controls how the guest will have access
 to the channel, and defaults to name='com.redhat.spice.0'."

However, this default value is never set in libvirt code base,
there's only a check in qemu_command.c to error out if the name
attribute doesn't have the expected value (if it's set).

This commit sets a default target name for spicevmc channels during
the domain configuration parsing so that the code agrees with the
documentation.
---
 src/conf/domain_conf.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d5def1c..9012462 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5218,6 +5218,13 @@ virDomainChrDefParseXML(virCapsPtr caps,
             goto error;
         } else {
             def->source.data.spicevmc = VIR_DOMAIN_CHR_SPICEVMC_VDAGENT;
+            if (!def->target.name) {
+                def->target.name = strdup("com.redhat.spice.0");
+                if (!def->target.name) {
+                    virReportOOMError();
+                    goto error;
+                }
+            }
         }
     }
 
-- 
1.7.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]