Re: [libvirt] [RFC 4/6] conf: Expose GIC capabilities

2016-04-14 Thread Cole Robinson
On 04/06/2016 10:39 AM, Andrea Bolognani wrote:
> On Wed, 2016-03-30 at 16:10 -0400, John Ferlan wrote:
>>> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml 
>>> b/tests/domaincapsschemadata/domaincaps-
>>> qemu_1.6.50-1.xml
>>> index 37d2102..990661b 100644
>>> --- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
>>> +++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
>>> @@ -56,4 +56,7 @@
>>> 
>>>   
>>> 
>>> +  
>>> +
>>> +  
>>>   
>>  
>> I first wondered why the XML file was modified, but later understood -
>> sort of...
> 
> We will need more tests for the new feature, of course.
> 
> I wanted to gather feedback on the interface with the RFC
> before I spent too much time testing or documenting it.
> 
>> Still not fully clear on how what this schema output should
>> look like... For prior to 2.6 should it even be printed?  For 2.6 and
>> beyond what would it look like?
> 
> There might be a case for not printing it, but we don't
> perform such optimization for the rest of the information
> that's part of domain capabilities, so I'm not sure
> whether we should bother in this case.
> 
> Versions prior to 2.6, and 2.6 itself on non-ARM
> architectures would yield
> 
>   
> 
>   
> 
> whereas 2.6 onward on ARM would yield something like
> 
>   
> 
>   
> 2
>   
> 
>   
> 
> which mirrors exactly the type of  element the
> user can expect to be able to use inside the 
> element in the domain XML, eg.
> 
>   
> 
>   
> 

Unfortunately there's not a ton of prior art WRT domcapabilities to go off of,
but FWIW with my virt-manager/libvirt consumer hat on that all seems sensible
for the domcaps schema. It mirrors the domain XML, and reports the actual
values we will want to pass to the domain XML, so we don't need to translate
between magic strings or anything.

- Cole

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


Re: [libvirt] [RFC 4/6] conf: Expose GIC capabilities

2016-04-06 Thread Andrea Bolognani
On Wed, 2016-03-30 at 16:10 -0400, John Ferlan wrote:
> > diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml 
> > b/tests/domaincapsschemadata/domaincaps-
> > qemu_1.6.50-1.xml
> > index 37d2102..990661b 100644
> > --- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
> > +++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
> > @@ -56,4 +56,7 @@
> >
> >  
> >
> > +  
> > +
> > +  
> >  
> 
> I first wondered why the XML file was modified, but later understood -
> sort of...

We will need more tests for the new feature, of course.

I wanted to gather feedback on the interface with the RFC
before I spent too much time testing or documenting it.

> Still not fully clear on how what this schema output should
> look like... For prior to 2.6 should it even be printed?  For 2.6 and
> beyond what would it look like?

There might be a case for not printing it, but we don't
perform such optimization for the rest of the information
that's part of domain capabilities, so I'm not sure
whether we should bother in this case.

Versions prior to 2.6, and 2.6 itself on non-ARM
architectures would yield

  

  

whereas 2.6 onward on ARM would yield something like

  

  
2
  

  

which mirrors exactly the type of  element the
user can expect to be able to use inside the 
element in the domain XML, eg.

  

  

or none at all.

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

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

Re: [libvirt] [RFC 4/6] conf: Expose GIC capabilities

2016-03-30 Thread John Ferlan


On 03/21/2016 01:28 PM, Andrea Bolognani wrote:
> Add information about GIC capabilities to virDomainCaps and update
> the formatter to include them in the XML output.
> ---
>  src/conf/domain_capabilities.c   | 20 
> 
>  src/conf/domain_capabilities.h   | 10 ++
>  tests/domaincapsschemadata/domaincaps-basic.xml  |  3 +++
>  tests/domaincapsschemadata/domaincaps-full.xml   |  3 +++
>  .../domaincaps-qemu_1.6.50-1.xml |  3 +++
>  5 files changed, 39 insertions(+)
> 
> diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
> index 466c0c6..d29ed81 100644
> --- a/src/conf/domain_capabilities.c
> +++ b/src/conf/domain_capabilities.c
> @@ -262,6 +262,18 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
>  }
>  
>  
> +static void
> +virDomainCapsFeatureGICFormat(virBufferPtr buf,
> +  virDomainCapsFeatureGICPtr const gic)
> +{
> +FORMAT_PROLOGUE(gic);
> +
> +ENUM_PROCESS(gic, version, virGICVersionTypeToString);
> +
> +FORMAT_EPILOGUE(gic);
> +}
> +
> +
>  static int
>  virDomainCapsFormatInternal(virBufferPtr buf,
>  virDomainCapsPtr const caps)
> @@ -291,6 +303,14 @@ virDomainCapsFormatInternal(virBufferPtr buf,
>  virBufferAdjustIndent(buf, -2);
>  virBufferAddLit(buf, "\n");
>  
> +virBufferAddLit(buf, "\n");
> +virBufferAdjustIndent(buf, 2);
> +
> +virDomainCapsFeatureGICFormat(buf, >gic);
> +
> +virBufferAdjustIndent(buf, -2);
> +virBufferAddLit(buf, "\n");
> +
>  virBufferAdjustIndent(buf, -2);
>  virBufferAddLit(buf, "\n");
>  return 0;
> diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
> index 3eacb35..95afe5e 100644
> --- a/src/conf/domain_capabilities.h
> +++ b/src/conf/domain_capabilities.h
> @@ -81,6 +81,13 @@ struct _virDomainCapsDeviceHostdev {
>  /* add new fields here */
>  };
>  
> +typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC;
> +typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr;
> +struct _virDomainCapsFeatureGIC {
> +bool supported;

Hmmm.. I see - I guess depends on how patch 1/6 is handled...

> +virDomainCapsEnum version; /* Info about virGICVersion */
> +};
> +
>  struct _virDomainCaps {
>  virObjectLockable parent;
>  
> @@ -96,6 +103,9 @@ struct _virDomainCaps {
>  virDomainCapsDeviceDisk disk;
>  virDomainCapsDeviceHostdev hostdev;
>  /* add new domain devices here */
> +
> +virDomainCapsFeatureGIC gic;
> +/* add new domain features here */
>  };
>  
>  virDomainCapsPtr virDomainCapsNew(const char *path,
> diff --git a/tests/domaincapsschemadata/domaincaps-basic.xml 
> b/tests/domaincapsschemadata/domaincaps-basic.xml
> index 6171393..6587d56 100644
> --- a/tests/domaincapsschemadata/domaincaps-basic.xml
> +++ b/tests/domaincapsschemadata/domaincaps-basic.xml
> @@ -8,4 +8,7 @@
>  
>  
>
> +  
> +
> +  
>  
> diff --git a/tests/domaincapsschemadata/domaincaps-full.xml 
> b/tests/domaincapsschemadata/domaincaps-full.xml
> index 96202bc..d4f91fa 100644
> --- a/tests/domaincapsschemadata/domaincaps-full.xml
> +++ b/tests/domaincapsschemadata/domaincaps-full.xml
> @@ -68,4 +68,7 @@
>
>  
>
> +  
> +
> +  
>  
> diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml 
> b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
> index 37d2102..990661b 100644
> --- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
> +++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
> @@ -56,4 +56,7 @@
>
>  
>
> +  
> +
> +  
>  
> 


I first wondered why the XML file was modified, but later understood -
sort of... Still not fully clear on how what this schema output should
look like... For prior to 2.6 should it even be printed?  For 2.6 and
beyond what would it look like?

John

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