[libvirt] [libvirt-designer PATCHv3 5/9] Automatically add SPICE channel with SPICE graphics
Christophe Fergeau
cfergeau at redhat.com
Wed Jun 5 11:05:27 UTC 2013
On Tue, Jun 04, 2013 at 07:11:23PM +0200, Michal Privoznik wrote:
> > +static gboolean
> > +gvir_designer_domain_has_spice_channel(GVirDesignerDomain *design)
> > +{
> > + GList *devices;
> > + GList *it;
> > + gboolean has_spice = FALSE;
> > +
> > + devices = gvir_designer_domain_get_device_by_type(design,
> > + GVIR_CONFIG_TYPE_DOMAIN_CHANNEL);
> > + for (it = devices; it != NULL; it = it->next) {
> > + GVirConfigDomainChannel *channel;
> > + const char *target_name;
> > + channel = GVIR_CONFIG_DOMAIN_CHANNEL(it->data);
> > + target_name = gvir_config_domain_channel_get_target_name(channel);
> > + if (g_strcmp0(target_name, GVIR_DESIGNER_SPICE_CHANNEL_NAME) == 0) {
> > + /* FIXME could do more sanity checks (check if the channel
> > + * source has the 'spicevmc' type)
> > + */
> > + GVirConfigDomainChannelTargetType target_type;
> > + target_type = gvir_config_domain_channel_get_target_type(channel);
> > + if (target_type == GVIR_CONFIG_DOMAIN_CHANNEL_TARGET_VIRTIO) {
> > + has_spice = TRUE;
> > + } else {
> > + g_critical("Inconsistent SPICE channel, target type is wrong (%d)",
> > + target_type);
>
> Is this really a critical issue? What about g_warning instead?
This means the domain XML has a very unexpected content, so I'd tend to tag
that as g_critical (which is not much different from g_warning anyway). I
don't mind changing it to g_warning.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130605/4a516139/attachment-0001.sig>
More information about the libvir-list
mailing list