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

Re: [libvirt] [libvirt-designer PATCHv3 5/9] Automatically add SPICE channel with SPICE graphics



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

Attachment: pgp906DvzyujG.pgp
Description: PGP signature


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