conf: disk: Initialize closed device tray state to 0

Additionally avoid initializing it after being calloced.
This commit is contained in:
Peter Krempa 2016-04-20 16:39:44 +02:00
parent 21aad98cad
commit d3ab5ff49d
2 changed files with 1 additions and 5 deletions

View File

@ -7393,10 +7393,6 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
_("tray is only valid for cdrom and floppy"));
goto error;
}
} else {
if (def->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY ||
def->device == VIR_DOMAIN_DISK_DEVICE_CDROM)
def->tray_status = VIR_DOMAIN_DISK_TRAY_CLOSED;
}
if (removable) {

View File

@ -606,7 +606,7 @@ typedef enum {
typedef enum {
VIR_DOMAIN_DISK_TRAY_CLOSED,
VIR_DOMAIN_DISK_TRAY_CLOSED = 0,
VIR_DOMAIN_DISK_TRAY_OPEN,
VIR_DOMAIN_DISK_TRAY_LAST