mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
conf: Ensure that new devices are added to conf copy function
Use the correct type and get rid of "default" label in switch to make the compiler complain if a new device type is added.
This commit is contained in:
parent
db07957646
commit
1550d3165b
@ -16030,7 +16030,7 @@ virDomainDeviceDefCopy(virCapsPtr caps,
|
|||||||
char *xmlStr = NULL;
|
char *xmlStr = NULL;
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
|
|
||||||
switch (src->type) {
|
switch ((virDomainDeviceType) src->type) {
|
||||||
case VIR_DOMAIN_DEVICE_DISK:
|
case VIR_DOMAIN_DEVICE_DISK:
|
||||||
rc = virDomainDiskDefFormat(&buf, src->data.disk, flags);
|
rc = virDomainDiskDefFormat(&buf, src->data.disk, flags);
|
||||||
break;
|
break;
|
||||||
@ -16070,7 +16070,11 @@ virDomainDeviceDefCopy(virCapsPtr caps,
|
|||||||
case VIR_DOMAIN_DEVICE_REDIRDEV:
|
case VIR_DOMAIN_DEVICE_REDIRDEV:
|
||||||
rc = virDomainRedirdevDefFormat(&buf, src->data.redirdev, flags);
|
rc = virDomainRedirdevDefFormat(&buf, src->data.redirdev, flags);
|
||||||
break;
|
break;
|
||||||
default:
|
case VIR_DOMAIN_DEVICE_NONE:
|
||||||
|
case VIR_DOMAIN_DEVICE_SMARTCARD:
|
||||||
|
case VIR_DOMAIN_DEVICE_CHR:
|
||||||
|
case VIR_DOMAIN_DEVICE_MEMBALLOON:
|
||||||
|
case VIR_DOMAIN_DEVICE_LAST:
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Copying definition of '%d' type "
|
_("Copying definition of '%d' type "
|
||||||
"is not implemented yet."),
|
"is not implemented yet."),
|
||||||
|
Loading…
Reference in New Issue
Block a user