[libvirt] [PATCH v4] virt-aa-helper: Set the supported features

Shivaprasad G Bhat posted 1 patch 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/151792244493.30508.2755993267930915956.stgit@pkvmhab008.pok.stglabs.ibm.com
src/conf/domain_conf.h        |    2 ++
src/security/virt-aa-helper.c |    8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
[libvirt] [PATCH v4] virt-aa-helper: Set the supported features
Posted by Shivaprasad G Bhat 6 years, 2 months ago
The virt-aa-helper fails to parse the xmls with the memory/cpu
hotplug features or user assigned aliases. Set the features in
xmlopt->config for the parsing to succeed.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
---
 src/conf/domain_conf.h        |    2 ++
 src/security/virt-aa-helper.c |    8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 21e004515..25d0b8187 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2532,6 +2532,8 @@ typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn,
                                           virDomainDefPtr def);
 
 
+/* NB: Any new flag to this list be considered to be set in
+ * virt-aa-helper code if the flag prevents parsing. */
 typedef enum {
     VIR_DOMAIN_DEF_FEATURE_WIDE_SCSI = (1 << 0),
     VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG = (1 << 1),
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index f7ccae0b0..29a459da2 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -654,6 +654,11 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
     return rc;
 }
 
+virDomainDefParserConfig virAAHelperDomainDefParserConfig = {
+    .features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
+                VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN |
+                VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS,
+};
 
 static int
 get_definition(vahControl * ctl, const char *xmlStr)
@@ -673,7 +678,8 @@ get_definition(vahControl * ctl, const char *xmlStr)
         goto exit;
     }
 
-    if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL, NULL))) {
+    if (!(ctl->xmlopt = virDomainXMLOptionNew(&virAAHelperDomainDefParserConfig,
+                                              NULL, NULL, NULL, NULL))) {
         vah_error(ctl, 0, _("Failed to create XML config object"));
         goto exit;
     }

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4] virt-aa-helper: Set the supported features
Posted by Peter Krempa 6 years, 2 months ago
On Tue, Feb 06, 2018 at 08:08:14 -0500, Shivaprasad G Bhat wrote:
> The virt-aa-helper fails to parse the xmls with the memory/cpu
> hotplug features or user assigned aliases. Set the features in
> xmlopt->config for the parsing to succeed.
> 
> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
> ---
>  src/conf/domain_conf.h        |    2 ++
>  src/security/virt-aa-helper.c |    8 +++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)

ACK from my side, but I'll wait for a while for the debian/ubuntu guys
chiming in.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4] virt-aa-helper: Set the supported features
Posted by Shivaprasad G Bhat 6 years, 2 months ago
Actually Christian


On 02/06/2018 07:12 PM, Peter Krempa wrote:
> On Tue, Feb 06, 2018 at 08:08:14 -0500, Shivaprasad G Bhat wrote:
>> The virt-aa-helper fails to parse the xmls with the memory/cpu
>> hotplug features or user assigned aliases. Set the features in
>> xmlopt->config for the parsing to succeed.
>>
>> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
>> ---
>>   src/conf/domain_conf.h        |    2 ++
>>   src/security/virt-aa-helper.c |    8 +++++++-
>>   2 files changed, 9 insertions(+), 1 deletion(-)
> ACK from my side, but I'll wait for a while for the debian/ubuntu guys
> chiming in.
ActuallyChristian Ehrhardt already replied on this implementation(v2 
patch) before,
and I missed to add
Tested-By: Christian Ehrhardt  <christian.ehrhardt@canonical.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4] virt-aa-helper: Set the supported features
Posted by Christian Ehrhardt 6 years, 2 months ago
On Tue, Feb 6, 2018 at 2:42 PM, Peter Krempa <pkrempa@redhat.com> wrote:
> On Tue, Feb 06, 2018 at 08:08:14 -0500, Shivaprasad G Bhat wrote:
>> The virt-aa-helper fails to parse the xmls with the memory/cpu
>> hotplug features or user assigned aliases. Set the features in
>> xmlopt->config for the parsing to succeed.
>>
>> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
>> ---
>>  src/conf/domain_conf.h        |    2 ++
>>  src/security/virt-aa-helper.c |    8 +++++++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>
> ACK from my side, but I'll wait for a while for the debian/ubuntu guys
> chiming in.

I had a review and test on v2.
This essentially differes by a comment that I also requested - so still ack.

Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>

P.S. you could say I'm an Ubuntu guy :-)

-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4] virt-aa-helper: Set the supported features
Posted by Peter Krempa 6 years, 2 months ago
On Tue, Feb 06, 2018 at 14:48:23 +0100, Christian Ehrhardt wrote:
> On Tue, Feb 6, 2018 at 2:42 PM, Peter Krempa <pkrempa@redhat.com> wrote:
> > On Tue, Feb 06, 2018 at 08:08:14 -0500, Shivaprasad G Bhat wrote:
> >> The virt-aa-helper fails to parse the xmls with the memory/cpu
> >> hotplug features or user assigned aliases. Set the features in
> >> xmlopt->config for the parsing to succeed.
> >>
> >> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
> >> ---
> >>  src/conf/domain_conf.h        |    2 ++
> >>  src/security/virt-aa-helper.c |    8 +++++++-
> >>  2 files changed, 9 insertions(+), 1 deletion(-)
> >
> > ACK from my side, but I'll wait for a while for the debian/ubuntu guys
> > chiming in.
> 
> I had a review and test on v2.
> This essentially differes by a comment that I also requested - so still ack.
> 
> Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>

I've added the tags and pushed the patch.

> 
> P.S. you could say I'm an Ubuntu guy :-)

Definitely :)

Sorry for not addressing you directly but I was too lazy to look up the
previous conversation.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list