Re: [PATCH 03/36] conf: virdomainobjlist: Convert header to contemporary style

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

 



On 1/5/23 10:29 AM, Peter Krempa wrote:
Use the new style which doesn't require re-aligning the argument list
once you change the return type.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
  src/conf/virdomainobjlist.h | 156 ++++++++++++++++++++----------------
  1 file changed, 86 insertions(+), 70 deletions(-)

diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h
index 4169eb4f78..cfa165d56f 100644
--- a/src/conf/virdomainobjlist.h
+++ b/src/conf/virdomainobjlist.h
@@ -26,72 +26,85 @@

  typedef struct _virDomainObjList virDomainObjList;

-virDomainObjList *virDomainObjListNew(void);
-
-virDomainObj *virDomainObjListFindByID(virDomainObjList *doms,
-                                         int id);
-virDomainObj *virDomainObjListFindByUUID(virDomainObjList *doms,
-                                           const unsigned char *uuid);
-virDomainObj *virDomainObjListFindByName(virDomainObjList *doms,
-                                           const char *name);
+virDomainObjList *
+virDomainObjListNew(void);
+
+virDomainObj *
+virDomainObjListFindByID(virDomainObjList *doms,
+                         int id);
+virDomainObj *
+virDomainObjListFindByUUID(virDomainObjList *doms,
+                           const unsigned char *uuid);
+virDomainObj *
+virDomainObjListFindByName(virDomainObjList *doms,
+                           const char *name);

  enum {
      VIR_DOMAIN_OBJ_LIST_ADD_LIVE = (1 << 0),
      VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
  };
-virDomainObj *virDomainObjListAdd(virDomainObjList *doms,
-                                  virDomainDef **def,
-                                  virDomainXMLOption *xmlopt,
-                                  unsigned int flags,
-                                  virDomainDef **oldDef);
+virDomainObj *
+virDomainObjListAdd(virDomainObjList *doms,
+                    virDomainDef **def,
+                    virDomainXMLOption *xmlopt,
+                    unsigned int flags,
+                    virDomainDef **oldDef);

  typedef int (*virDomainObjListRenameCallback)(virDomainObj *dom,
                                                const char *new_name,
                                                unsigned int flags,
                                                void *opaque);
-int virDomainObjListRename(virDomainObjList *doms,
-                           virDomainObj *dom,
-                           const char *new_name,
-                           unsigned int flags,
-                           virDomainObjListRenameCallback callback,
-                           void *opaque);
-
-void virDomainObjListRemove(virDomainObjList *doms,
-                            virDomainObj *dom);
-void virDomainObjListRemoveLocked(virDomainObjList *doms,
-                                  virDomainObj *dom);
-
-int virDomainObjListLoadAllConfigs(virDomainObjList *doms,
-                                   const char *configDir,
-                                   const char *autostartDir,
-                                   bool liveStatus,
-                                   virDomainXMLOption *xmlopt,
-                                   virDomainLoadConfigNotify notify,
-                                   void *opaque);
-
-int virDomainObjListNumOfDomains(virDomainObjList *doms,
-                                 bool active,
-                                 virDomainObjListACLFilter filter,
-                                 virConnectPtr conn);
-
-int virDomainObjListGetActiveIDs(virDomainObjList *doms,
-                                 int *ids,
-                                 int maxids,
+int
+virDomainObjListRename(virDomainObjList *doms,
+                       virDomainObj *dom,
+                       const char *new_name,
+                       unsigned int flags,
+                       virDomainObjListRenameCallback callback,
+                       void *opaque);
+
+void
+virDomainObjListRemove(virDomainObjList *doms,
+                       virDomainObj *dom);
+void
+virDomainObjListRemoveLocked(virDomainObjList *doms,
+                             virDomainObj *dom);
+
+int
+virDomainObjListLoadAllConfigs(virDomainObjList *doms,
+                               const char *configDir,
+                               const char *autostartDir,
+                               bool liveStatus,
+                               virDomainXMLOption *xmlopt,
+                               virDomainLoadConfigNotify notify,
+                               void *opaque);
+
+int
+virDomainObjListNumOfDomains(virDomainObjList *doms,
+                             bool active,
+                             virDomainObjListACLFilter filter,
+                             virConnectPtr conn);
+
+int
+virDomainObjListGetActiveIDs(virDomainObjList *doms,
+                             int *ids,
+                             int maxids,
+                             virDomainObjListACLFilter filter,
+                             virConnectPtr conn);
+int
+virDomainObjListGetInactiveNames(virDomainObjList *doms,
+                                 char **const names,
+                                 int maxnames,
                                   virDomainObjListACLFilter filter,
                                   virConnectPtr conn);
-int virDomainObjListGetInactiveNames(virDomainObjList *doms,
-                                     char **const names,
-                                     int maxnames,
-                                     virDomainObjListACLFilter filter,
-                                     virConnectPtr conn);

  typedef int (*virDomainObjListIterator)(virDomainObj *dom,
                                          void *opaque);

-int virDomainObjListForEach(virDomainObjList *doms,
-                            bool modify,
-                            virDomainObjListIterator callback,
-                            void *opaque);
+int
+virDomainObjListForEach(virDomainObjList *doms,
+                        bool modify,
+                        virDomainObjListIterator callback,
+                        void *opaque);

  #define VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE \
                  (VIR_CONNECT_LIST_DOMAINS_ACTIVE | \
@@ -132,23 +145,26 @@ int virDomainObjListForEach(virDomainObjList *doms,
                   VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT    | \
                   VIR_CONNECT_LIST_DOMAINS_FILTERS_CHECKPOINT)

-int virDomainObjListCollect(virDomainObjList *doms,
-                            virConnectPtr conn,
-                            virDomainObj ***vms,
-                            size_t *nvms,
-                            virDomainObjListACLFilter filter,
-                            unsigned int flags);
-int virDomainObjListExport(virDomainObjList *doms,
-                           virConnectPtr conn,
-                           virDomainPtr **domains,
-                           virDomainObjListACLFilter filter,
-                           unsigned int flags);
-int virDomainObjListConvert(virDomainObjList *domlist,
-                            virConnectPtr conn,
-                            virDomainPtr *doms,
-                            size_t ndoms,
-                            virDomainObj ***vms,
-                            size_t *nvms,
-                            virDomainObjListACLFilter filter,
-                            unsigned int flags,
-                            bool skip_missing);
+int
+virDomainObjListCollect(virDomainObjList *doms,
+                        virConnectPtr conn,
+                        virDomainObj ***vms,
+                        size_t *nvms,
+                        virDomainObjListACLFilter filter,
+                        unsigned int flags);
+int
+virDomainObjListExport(virDomainObjList *doms,
+                       virConnectPtr conn,
+                       virDomainPtr **domains,
+                       virDomainObjListACLFilter filter,
+                       unsigned int flags);
+int
+virDomainObjListConvert(virDomainObjList *domlist,
+                        virConnectPtr conn,
+                        virDomainPtr *doms,
+                        size_t ndoms,
+                        virDomainObj ***vms,
+                        size_t *nvms,
+                        virDomainObjListACLFilter filter,
+                        unsigned int flags,
+                        bool skip_missing);


Fine with me as long as others don't object to mass reformatting

Reviewed-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>




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

  Powered by Linux