Re: [PATCH] xml: Use virXMLParse* helpers everywhere

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

 



On 05/12/2011 08:53 PM, Eric Blake wrote:
> On 05/12/2011 03:47 PM, Cole Robinson wrote:
>> virt-aa-helper isn't even compile tested since I don't have the setup for
>> it.
> 
> I tested the patch out on Ubuntu, and the virt-aa-helper stuff did
> indeed have problems.
> 
>>
>> Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
>> ---
>>  src/conf/domain_conf.c        |   33 ++++--------------
>>  src/conf/nwfilter_conf.c      |   76 ++++-------------------------------------
>>  src/conf/storage_conf.c       |    8 +----
>>  src/esx/esx_vi.c              |   14 +------
>>  src/security/virt-aa-helper.c |   43 +----------------------
>>  src/test/test_driver.c        |   17 +--------
>>  6 files changed, 21 insertions(+), 170 deletions(-)
> 
> Nice reduction in size!
> 
>> +++ b/src/security/virt-aa-helper.c
>> @@ -592,29 +592,6 @@ valid_path(const char *path, const bool readonly)
>>      return 0;
>>  }
>>  
> 
>> @@ -658,31 +635,15 @@ static int
>>  caps_mockup(vahControl * ctl, const char *xmlStr)
>>  {
>>      int rc = -1;
>> -    xmlParserCtxtPtr pctxt = NULL;
> 
> Missed a use of this.
> 
>> -
>> -    if ((root = xmlDocGetRootElement(xml)) == NULL) {
>> -        vah_error(NULL, 0, _("missing root element"));
>> +    if (!(xml = virXMLParseString(xmlStr, "domain.xml"))) {
> 
> Needs VIR_FROM_THIS.
> 
> ACK with this squashed in:
> 
> diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
> index a14fb77..41ba4a3 100644
> --- a/src/security/virt-aa-helper.c
> +++ b/src/security/virt-aa-helper.c
> @@ -42,6 +42,8 @@
>  #include "files.h"
>  #include "configmake.h"
> 
> +#define VIR_FROM_THIS VIR_FROM_SECURITY
> +
>  static char *progname;
> 
>  typedef struct {
> @@ -686,7 +688,6 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
>      rc = 0;
> 
>    cleanup:
> -    xmlFreeParserCtxt (pctxt);
>      xmlFreeDoc (xml);
>      xmlXPathFreeContext(ctxt);
> 

Thanks, squashed in that fix and pushed.

- Cole

--
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]