mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
vmx: Use the allocator virDomainChrDefNew
Rather than VIR_ALLOC of the virDomainChrDefPtr
This commit is contained in:
parent
6aa324fbeb
commit
931864a3ea
@ -3874,7 +3874,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
|
|||||||
|
|
||||||
if (!def->consoles[0]) {
|
if (!def->consoles[0]) {
|
||||||
/* allocate a new console type for the stolen one */
|
/* allocate a new console type for the stolen one */
|
||||||
if (VIR_ALLOC(def->consoles[0]) < 0)
|
if (!(def->consoles[0] = virDomainChrDefNew(NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Create an console alias for the serial port */
|
/* Create an console alias for the serial port */
|
||||||
@ -3889,7 +3889,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
|
|||||||
* or has a different type than SERIAL or NONE.
|
* or has a different type than SERIAL or NONE.
|
||||||
*/
|
*/
|
||||||
virDomainChrDefPtr chr;
|
virDomainChrDefPtr chr;
|
||||||
if (VIR_ALLOC(chr) < 0)
|
if (!(chr = virDomainChrDefNew(NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (VIR_INSERT_ELEMENT(def->consoles,
|
if (VIR_INSERT_ELEMENT(def->consoles,
|
||||||
|
@ -2758,7 +2758,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(*def) < 0)
|
if (!(*def = virDomainChrDefNew(NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
|
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
|
||||||
@ -2946,7 +2946,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC(*def) < 0)
|
if (!(*def = virDomainChrDefNew(NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL;
|
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user