Re: [PATCHv2 02/21] fix fallout in src/conf/

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

 



On Wed, Mar 06, 2013 at 04:37:46PM +0100, Peter Krempa wrote:
> ---
>  src/conf/domain_conf.c   | 98 ++++++++++++++++++++++++++++++------------------
>  src/conf/domain_conf.h   | 20 +++++++---
>  src/conf/snapshot_conf.c |  3 +-
>  src/conf/snapshot_conf.h |  1 +
>  src/libvirt_private.syms |  2 +
>  5 files changed, 81 insertions(+), 43 deletions(-)
> 
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index db14504..4ec3e0b 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1959,7 +1959,7 @@ virDomainObjIsActive(virDomainObjPtr dom)
>      return dom->def->id != -1;
>  }
> 
> -virDomainObjPtr virDomainObjNew(virCapsPtr caps);
> +virDomainObjPtr virDomainObjNew(virDomainXMLConfPtr caps);
> 
>  virDomainObjListPtr virDomainObjListNew(void);
> 
> @@ -2034,7 +2034,7 @@ enum {
>      VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
>  };
>  virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms,
> -                                    virCapsPtr caps,
> +                                    virDomainXMLConfPtr xmlconf,
>                                      const virDomainDefPtr def,
>                                      unsigned int flags,
>                                      virDomainDefPtr *oldDef);

I'd suggest we make 'xmlconf' as ATTRIBUTE_NONNULL for all these
APIs, and thus avoid the need for parser code to contain  'if (xmlconf)'
tests everywhere

> @@ -2043,22 +2043,26 @@ void virDomainObjAssignDef(virDomainObjPtr domain,
>                             bool live,
>                             virDomainDefPtr *oldDef);
>  int virDomainObjSetDefTransient(virCapsPtr caps,
> +                                virDomainXMLConfPtr xmlconf,
>                                  virDomainObjPtr domain,
>                                  bool live);
>  virDomainDefPtr
>  virDomainObjGetPersistentDef(virCapsPtr caps,
> +                             virDomainXMLConfPtr xmlconf,
>                               virDomainObjPtr domain);
> 
>  int
>  virDomainLiveConfigHelperMethod(virCapsPtr caps,
> +                                virDomainXMLConfPtr xmlconf,
>                                  virDomainObjPtr dom,
>                                  unsigned int *flags,
>                                  virDomainDefPtr *persistentDef);
> 
> -virDomainDefPtr virDomainDefCopy(virCapsPtr caps, virDomainDefPtr src,
> -                                 bool migratable);
> +virDomainDefPtr virDomainDefCopy(virCapsPtr caps, virDomainXMLConfPtr xmlconf,
> +                                 virDomainDefPtr src, bool migratable);
>  virDomainDefPtr
> -virDomainObjCopyPersistentDef(virCapsPtr caps, virDomainObjPtr dom);
> +virDomainObjCopyPersistentDef(virCapsPtr caps, virDomainXMLConfPtr xmlconf,
> +                              virDomainObjPtr dom);
> 
>  void virDomainObjListRemove(virDomainObjListPtr doms,
>                              virDomainObjPtr dom);
> @@ -2068,14 +2072,17 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
>                                                const char *xmlStr,
>                                                unsigned int flags);
>  virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
> +                                        virDomainXMLConfPtr xmlconf,
>                                          const char *xmlStr,
>                                          unsigned int expectedVirtTypes,
>                                          unsigned int flags);
>  virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
> +                                      virDomainXMLConfPtr xmlconf,
>                                        const char *filename,
>                                        unsigned int expectedVirtTypes,
>                                        unsigned int flags);
>  virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
> +                                      virDomainXMLConfPtr xmlconf,
>                                        xmlDocPtr doc,
>                                        xmlNodePtr root,
>                                        unsigned int expectedVirtTypes,
> @@ -2192,7 +2199,7 @@ int virDomainSaveXML(const char *configDir,
> 
>  int virDomainSaveConfig(const char *configDir,
>                          virDomainDefPtr def);
> -int virDomainSaveStatus(virCapsPtr caps,
> +int virDomainSaveStatus(virDomainXMLConfPtr xmlconf,
>                          const char *statusDir,
>                          virDomainObjPtr obj) ATTRIBUTE_RETURN_CHECK;
> 
> @@ -2202,6 +2209,7 @@ typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom,
> 
>  int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
>                                     virCapsPtr caps,
> +                                   virDomainXMLConfPtr xmlconf,
>                                     const char *configDir,
>                                     const char *autostartDir,
>                                     int liveStatus,

> diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
> index f1d5995..e8bd24a 100644
> --- a/src/conf/snapshot_conf.h
> +++ b/src/conf/snapshot_conf.h
> @@ -101,6 +101,7 @@ typedef enum {
> 
>  virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
>                                                          virCapsPtr caps,
> +                                                        virDomainXMLConfPtr xmlconf,
>                                                          unsigned int expectedVirtTypes,
>                                                          unsigned int flags);

And NONNULL here too

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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