Re: [libvirt] [PATCH 11/33] Rename virVirtualPortProfileParams APIs

2011-11-14 Thread Daniel P. Berrange
On Wed, Nov 09, 2011 at 02:12:02AM -0500, Laine Stump wrote:
 On 11/03/2011 01:30 PM, Daniel P. Berrange wrote:
 From: Daniel P. Berrangeberra...@redhat.com
 
 Rename the virVirtualPortProfileParams struct to be
 virNetDevVPortProfile, and rename the APIs to match
 this prefix.
 
 * src/util/network.c, src/util/network.h: Rename port profile
APIs
 * src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
src/util/macvtap.c, src/util/macvtap.h: Update for
renamed APIs/structs
 ---
   src/conf/domain_conf.c  |   16 +++---
   src/conf/domain_conf.h  |8 +++---
   src/conf/network_conf.c |   12 +-
   src/conf/network_conf.h |4 +-
   src/libvirt_private.syms|6 ++--
   src/network/bridge_driver.c |6 ++--
   src/qemu/qemu_hotplug.c |4 +-
   src/util/macvtap.c  |   36 
   src/util/macvtap.h  |8 +++---
   src/util/network.c  |   48 
  +-
   src/util/network.h  |   33 +++--
   11 files changed, 91 insertions(+), 90 deletions(-)
 
 diff --git a/src/util/macvtap.c b/src/util/macvtap.c
 index cb13d2b..71243b8 100644
 --- a/src/util/macvtap.c
 +++ b/src/util/macvtap.c
 @@ -89,7 +89,7 @@ VIR_ENUM_IMPL(virMacvtapMode, VIR_MACVTAP_MODE_LAST,
   # define LLDPAD_PID_FILE  /var/run/lldpad.pid
 
 
 -enum virVirtualPortOp {
 +enum virNetDevVPortOp {
   ASSOCIATE = 0x1,
   DISASSOCIATE = 0x2,
   PREASSOCIATE = 0x3,
 
 
 Do you think having such generic names for these enums might lead to
 a namespace conflict somewhere down the road? Maybe the enum value
 names could be changed as a part of this patch...

The enum itself later gets renamed again to

  virNetDevVPortProfileLinkOp

I'm moving the rename to this patch, and also renaming the constants
to match by having a prefix VIR_NETDEV_VPORT_PROFILE_LINK_OP. Yes it
is a little verbose, but these are only used in a handful of places.

 -#endif /* WITH_MACVTAP || WITH_VIRTUALPORT */
 +#endif /* WITH_MACVTAP || WITH_NETDEV_VPORT_PROFILE */
 
 WITH_VIRTUALPORT has been changed to WITH_NETDEV_VPORT_PROFILE in
 this comment, but not in the #ifdef, and the line was completely
 removed in PATCH 19/33. Since the latter name doesn't appear
 anywhere in the final result of the series, I think this must be a
 vestige of something you later decided against, or maybe a
 search-replace run amok.

Yes, bogus search  replace I have reverted.

 ACK aside from that.


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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 11/33] Rename virVirtualPortProfileParams APIs

2011-11-08 Thread Laine Stump

On 11/03/2011 01:30 PM, Daniel P. Berrange wrote:

From: Daniel P. Berrangeberra...@redhat.com

Rename the virVirtualPortProfileParams struct to be
virNetDevVPortProfile, and rename the APIs to match
this prefix.

* src/util/network.c, src/util/network.h: Rename port profile
   APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
   src/conf/network_conf.c, src/conf/network_conf.h,
   src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
   src/util/macvtap.c, src/util/macvtap.h: Update for
   renamed APIs/structs
---
  src/conf/domain_conf.c  |   16 +++---
  src/conf/domain_conf.h  |8 +++---
  src/conf/network_conf.c |   12 +-
  src/conf/network_conf.h |4 +-
  src/libvirt_private.syms|6 ++--
  src/network/bridge_driver.c |6 ++--
  src/qemu/qemu_hotplug.c |4 +-
  src/util/macvtap.c  |   36 
  src/util/macvtap.h  |8 +++---
  src/util/network.c  |   48 +-
  src/util/network.h  |   33 +++--
  11 files changed, 91 insertions(+), 90 deletions(-)



diff --git a/src/util/macvtap.c b/src/util/macvtap.c
index cb13d2b..71243b8 100644
--- a/src/util/macvtap.c
+++ b/src/util/macvtap.c
@@ -89,7 +89,7 @@ VIR_ENUM_IMPL(virMacvtapMode, VIR_MACVTAP_MODE_LAST,
  # define LLDPAD_PID_FILE  /var/run/lldpad.pid


-enum virVirtualPortOp {
+enum virNetDevVPortOp {
  ASSOCIATE = 0x1,
  DISASSOCIATE = 0x2,
  PREASSOCIATE = 0x3,



Do you think having such generic names for these enums might lead to a 
namespace conflict somewhere down the road? Maybe the enum value names 
could be changed as a part of this patch...




-#endif /* WITH_MACVTAP || WITH_VIRTUALPORT */
+#endif /* WITH_MACVTAP || WITH_NETDEV_VPORT_PROFILE */


WITH_VIRTUALPORT has been changed to WITH_NETDEV_VPORT_PROFILE in this 
comment, but not in the #ifdef, and the line was completely removed in 
PATCH 19/33. Since the latter name doesn't appear anywhere in the final 
result of the series, I think this must be a vestige of something you 
later decided against, or maybe a search-replace run amok.


ACK aside from that.

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


[libvirt] [PATCH 11/33] Rename virVirtualPortProfileParams APIs

2011-11-03 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com

Rename the virVirtualPortProfileParams struct to be
virNetDevVPortProfile, and rename the APIs to match
this prefix.

* src/util/network.c, src/util/network.h: Rename port profile
  APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
  src/conf/network_conf.c, src/conf/network_conf.h,
  src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
  src/util/macvtap.c, src/util/macvtap.h: Update for
  renamed APIs/structs
---
 src/conf/domain_conf.c  |   16 +++---
 src/conf/domain_conf.h  |8 +++---
 src/conf/network_conf.c |   12 +-
 src/conf/network_conf.h |4 +-
 src/libvirt_private.syms|6 ++--
 src/network/bridge_driver.c |6 ++--
 src/qemu/qemu_hotplug.c |4 +-
 src/util/macvtap.c  |   36 
 src/util/macvtap.h  |8 +++---
 src/util/network.c  |   48 +-
 src/util/network.h  |   33 +++--
 11 files changed, 91 insertions(+), 90 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ab7853d..c1f8950 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3112,8 +3112,8 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
 
 virtPortNode = virXPathNode(./virtualport, ctxt);
 if (virtPortNode 
-virVirtualPortProfileParseXML(virtPortNode,
-
actual-data.direct.virtPortProfile)  0) {
+virNetDevVPortProfileParse(virtPortNode,
+   actual-data.direct.virtPortProfile)  
0) {
 goto error;
 }
 }
@@ -3169,7 +3169,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
 char *mode = NULL;
 char *linkstate = NULL;
 virNWFilterHashTablePtr filterparams = NULL;
-virVirtualPortProfileParamsPtr virtPort = NULL;
+virNetDevVPortProfilePtr virtPort = NULL;
 virDomainActualNetDefPtr actual = NULL;
 xmlNodePtr oldnode = ctxt-node;
 int ret;
@@ -3221,7 +3221,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
((def-type == VIR_DOMAIN_NET_TYPE_DIRECT) ||
 (def-type == VIR_DOMAIN_NET_TYPE_NETWORK)) 
xmlStrEqual(cur-name, BAD_CAST virtualport)) {
-if (virVirtualPortProfileParseXML(cur, virtPort)  0)
+if (virNetDevVPortProfileParse(cur, virtPort)  0)
 goto error;
 } else if ((network == NULL) 
((def-type == VIR_DOMAIN_NET_TYPE_SERVER) ||
@@ -9721,7 +9721,7 @@ virDomainActualNetDefFormat(virBufferPtr buf,
 }
 virBufferAsprintf(buf,  mode='%s'/\n, mode);
 virBufferAdjustIndent(buf, 8);
-virVirtualPortProfileFormat(buf, def-data.direct.virtPortProfile);
+virNetDevVPortProfileFormat(def-data.direct.virtPortProfile, buf);
 virBufferAdjustIndent(buf, -8);
 break;
 default:
@@ -9768,7 +9768,7 @@ virDomainNetDefFormat(virBufferPtr buf,
   def-data.network.portgroup);
 virBufferAddLit(buf, /\n);
 virBufferAdjustIndent(buf, 6);
-virVirtualPortProfileFormat(buf, def-data.network.virtPortProfile);
+virNetDevVPortProfileFormat(def-data.network.virtPortProfile, buf);
 virBufferAdjustIndent(buf, -6);
 if ((flags  VIR_DOMAIN_XML_INTERNAL_ACTUAL_NET) 
 (virDomainActualNetDefFormat(buf, def-data.network.actual)  0))
@@ -9818,7 +9818,7 @@ virDomainNetDefFormat(virBufferPtr buf,
   virMacvtapModeTypeToString(def-data.direct.mode));
 virBufferAddLit(buf, /\n);
 virBufferAdjustIndent(buf, 6);
-virVirtualPortProfileFormat(buf, def-data.direct.virtPortProfile);
+virNetDevVPortProfileFormat(def-data.direct.virtPortProfile, buf);
 virBufferAdjustIndent(buf, -6);
 break;
 
@@ -13078,7 +13078,7 @@ virDomainNetGetActualDirectMode(virDomainNetDefPtr 
iface)
 return iface-data.network.actual-data.direct.mode;
 }
 
-virVirtualPortProfileParamsPtr
+virNetDevVPortProfilePtr
 virDomainNetGetActualDirectVirtPortProfile(virDomainNetDefPtr iface)
 {
 if (iface-type == VIR_DOMAIN_NET_TYPE_DIRECT)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a3cb834..255d8fd 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -508,7 +508,7 @@ struct _virDomainActualNetDef {
 struct {
 char *linkdev;
 int mode; /* enum virMacvtapMode from util/macvtap.h */
-virVirtualPortProfileParamsPtr virtPortProfile;
+virNetDevVPortProfilePtr virtPortProfile;
 } direct;
 } data;
 virNetDevBandwidthPtr bandwidth;
@@ -542,7 +542,7 @@ struct _virDomainNetDef {
 struct {
 char *name;
 char *portgroup;
-virVirtualPortProfileParamsPtr virtPortProfile;
+