mirror of https://gitee.com/openkylin/libvirt.git
conf: disk: Initialize closed device tray state to 0
Additionally avoid initializing it after being calloced.
This commit is contained in:
parent
21aad98cad
commit
d3ab5ff49d
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue