Re: [PATCH 2/3] lxc conf2xml: convert lxc.network.name for veth networks

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

 



On 02.07.2014 15:57, Cédric Bosdonnat wrote:
---
  src/lxc/lxc_native.c                               | 22 ++++++++++++++++------
  .../lxcconf2xmldata/lxcconf2xml-physnetwork.config |  1 +
  tests/lxcconf2xmldata/lxcconf2xml-simple.xml       |  1 +
  3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
index f4c4556..e14face 100644
--- a/src/lxc/lxc_native.c
+++ b/src/lxc/lxc_native.c
@@ -338,7 +338,8 @@ lxcCreateNetDef(const char *type,
                  const char *linkdev,
                  const char *mac,
                  const char *flag,
-                const char *macvlanmode)
+                const char *macvlanmode,
+                const char *name)
  {
      virDomainNetDefPtr net = NULL;
      virMacAddr macAddr;
@@ -353,6 +354,8 @@ lxcCreateNetDef(const char *type,
              net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
      }

+    if (name && VIR_STRDUP(net->ifname_guest, name) < 0)
+        goto error;

One of the requirements when I introduced VIR_STRDUP was, that it's NULL safe so we don't have to do this. s/name && //

ACK

Michal

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