mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03:00
conf: Use correct type for device type enum in virDomainDeviceDefFree
With this change it's easy to spot a forgotten free if a new device class is added.
This commit is contained in:
parent
514b93061c
commit
8a3cf528e5
@ -1524,7 +1524,7 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def)
|
||||
if (!def)
|
||||
return;
|
||||
|
||||
switch (def->type) {
|
||||
switch ((virDomainDeviceType) def->type) {
|
||||
case VIR_DOMAIN_DEVICE_DISK:
|
||||
virDomainDiskDefFree(def->data.disk);
|
||||
break;
|
||||
@ -1561,6 +1561,13 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def)
|
||||
case VIR_DOMAIN_DEVICE_REDIRDEV:
|
||||
virDomainRedirdevDefFree(def->data.redirdev);
|
||||
break;
|
||||
case VIR_DOMAIN_DEVICE_NONE:
|
||||
case VIR_DOMAIN_DEVICE_FS:
|
||||
case VIR_DOMAIN_DEVICE_SMARTCARD:
|
||||
case VIR_DOMAIN_DEVICE_CHR:
|
||||
case VIR_DOMAIN_DEVICE_MEMBALLOON:
|
||||
case VIR_DOMAIN_DEVICE_LAST:
|
||||
break;
|
||||
}
|
||||
|
||||
VIR_FREE(def);
|
||||
|
Loading…
Reference in New Issue
Block a user