]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove unnecessary virDomainDefClearDeviceAliases
authorJohn Ferlan <jferlan@redhat.com>
Tue, 19 Jul 2016 12:11:01 +0000 (08:11 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 27 Jul 2016 00:40:49 +0000 (20:40 -0400)
Nothing in the code path after the removed call has needs/uses the alias
anyway (as would be the case for command line building or talking to monitor).
The alias is VIR_FREE'd in virDomainDeviceInfoClear which is called for any
device that needs/uses an alias via virDomainDeviceDefFree or virDomainDefFree
as well as during virDomainDeviceInfoFree for host devices.

For persistent domains, the domain definition (including aliases) gets
freed a few screens later when it's replaced with newDef.

For transient domains, the definition is freed/unref'd along with the
virDomainObj a few moments later.

src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_process.c

index 132044f8a2d3cc83b21c03c946acaebf70045a6e..13e5dc9792febe02739114f112551fe2e8caccfb 100644 (file)
@@ -3352,15 +3352,6 @@ void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
 }
 
 
-static int virDomainDeviceInfoClearAlias(virDomainDefPtr def ATTRIBUTE_UNUSED,
-                                         virDomainDeviceDefPtr device ATTRIBUTE_UNUSED,
-                                         virDomainDeviceInfoPtr info,
-                                         void *opaque ATTRIBUTE_UNUSED)
-{
-    VIR_FREE(info->alias);
-    return 0;
-}
-
 static int
 virDomainDeviceInfoIterateInternal(virDomainDefPtr def,
                                    virDomainDeviceInfoCallback cb,
@@ -4729,12 +4720,6 @@ virDomainDefValidate(virDomainDefPtr def,
 }
 
 
-void virDomainDefClearDeviceAliases(virDomainDefPtr def)
-{
-    virDomainDeviceInfoIterate(def, virDomainDeviceInfoClearAlias, NULL);
-}
-
-
 /* Generate a string representation of a device address
  * @info address Device address to stringify
  */
index ac32468e060a4e1a4fa52ac23fea824adddefb33..3c2f18231f85fc047a7036ba5f866347eaa8902c 100644 (file)
@@ -2534,7 +2534,6 @@ virDomainDeviceInfoPtr virDomainDeviceGetInfo(virDomainDeviceDefPtr device);
 int virDomainDeviceInfoCopy(virDomainDeviceInfoPtr dst,
                             virDomainDeviceInfoPtr src);
 void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info);
-void virDomainDefClearDeviceAliases(virDomainDefPtr def);
 void virDomainTPMDefFree(virDomainTPMDefPtr def);
 
 typedef int (*virDomainDeviceInfoCallback)(virDomainDefPtr def,
index 6693eed4d258dabbe7587d30097358e1bfe89c4e..cbc408f78405f0e8ea3409fdbbd5243ab6a363d9 100644 (file)
@@ -219,7 +219,6 @@ virDomainDefAddController;
 virDomainDefAddImplicitDevices;
 virDomainDefAddUSBController;
 virDomainDefCheckABIStability;
-virDomainDefClearDeviceAliases;
 virDomainDefCompatibleDevice;
 virDomainDefCopy;
 virDomainDefFindDevice;
index c7639c1bb8dad86fcd533d6c234bb2e56212b5a6..8e1b8961b6118555877708c1af0ec6f8f7d135a6 100644 (file)
@@ -5687,8 +5687,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     virStringFreeList(priv->qemuDevices);
     priv->qemuDevices = NULL;
 
-    virDomainDefClearDeviceAliases(vm->def);
-
     qemuHostdevReAttachDomainDevices(driver, vm->def);
 
     def = vm->def;