mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
Remove unnecessary virDomainDefClearDeviceAliases
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.
This commit is contained in:
parent
d95f5beb79
commit
fc0378a973
@ -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
|
||||
*/
|
||||
|
@ -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,
|
||||
|
@ -219,7 +219,6 @@ virDomainDefAddController;
|
||||
virDomainDefAddImplicitDevices;
|
||||
virDomainDefAddUSBController;
|
||||
virDomainDefCheckABIStability;
|
||||
virDomainDefClearDeviceAliases;
|
||||
virDomainDefCompatibleDevice;
|
||||
virDomainDefCopy;
|
||||
virDomainDefFindDevice;
|
||||
|
@ -5687,8 +5687,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
|
||||
virStringFreeList(priv->qemuDevices);
|
||||
priv->qemuDevices = NULL;
|
||||
|
||||
virDomainDefClearDeviceAliases(vm->def);
|
||||
|
||||
qemuHostdevReAttachDomainDevices(driver, vm->def);
|
||||
|
||||
def = vm->def;
|
||||
|
Loading…
x
Reference in New Issue
Block a user