~ubuntu-branches/ubuntu/natty/libvirt/natty-proposed

« back to all changes in this revision

Viewing changes to src/conf/interface_conf.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Léonard
  • Date: 2010-07-06 12:14:33 UTC
  • mto: (3.4.17 sid) (1.2.6 upstream) (0.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 93.
  • Revision ID: james.westby@ubuntu.com-20100706121433-94utbax9zjvmkcsj
Tags: upstream-0.8.2
Import upstream version 0.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
    switch (def->type) {
86
86
        case VIR_INTERFACE_TYPE_BRIDGE:
87
87
            for (i = 0;i < def->data.bridge.nbItf;i++) {
88
 
                if (def->data.bridge.itf[i] != NULL)
89
 
                    virInterfaceDefFree(def->data.bridge.itf[i]);
90
 
                else
 
88
                if (def->data.bridge.itf[i] == NULL)
91
89
                    break; /* to cope with half parsed data on errors */
 
90
                virInterfaceDefFree(def->data.bridge.itf[i]);
92
91
            }
93
92
            VIR_FREE(def->data.bridge.itf);
94
93
            break;
95
94
        case VIR_INTERFACE_TYPE_BOND:
96
95
            VIR_FREE(def->data.bond.target);
97
96
            for (i = 0;i < def->data.bond.nbItf;i++) {
98
 
                if (def->data.bond.itf[i] != NULL)
99
 
                    virInterfaceDefFree(def->data.bond.itf[i]);
100
 
                else
 
97
                if (def->data.bond.itf[i] == NULL)
101
98
                    break; /* to cope with half parsed data on errors */
 
99
                virInterfaceDefFree(def->data.bond.itf[i]);
102
100
            }
103
101
            VIR_FREE(def->data.bond.itf);
104
102
            break;
1227
1225
    virInterfaceObjPtr iface;
1228
1226
 
1229
1227
    if ((iface = virInterfaceFindByName(interfaces, def->name))) {
1230
 
        if (iface->def)
1231
 
            virInterfaceDefFree(iface->def);
 
1228
        virInterfaceDefFree(iface->def);
1232
1229
        iface->def = def;
1233
1230
 
1234
1231
        return iface;