mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: Fix crash in virDomainDefCompatibleDevice
Commit id 'edae027c' blindly assumed that the passed @oldDev parameter would not be NULL when calling virDomainDeviceGetInfo; however, commit id 'b6a264e8' passed NULL for AttachDevice callers under the premise that there wouldn't be a device to check/update against. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
7a32bedffc
commit
5535856f0e
@ -27417,9 +27417,12 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
|
|||||||
{
|
{
|
||||||
virDomainCompatibleDeviceData data = {
|
virDomainCompatibleDeviceData data = {
|
||||||
.newInfo = virDomainDeviceGetInfo(dev),
|
.newInfo = virDomainDeviceGetInfo(dev),
|
||||||
.oldInfo = virDomainDeviceGetInfo(oldDev),
|
.oldInfo = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (oldDev)
|
||||||
|
data.oldInfo = virDomainDeviceGetInfo(oldDev);
|
||||||
|
|
||||||
if (!virDomainDefHasUSB(def) &&
|
if (!virDomainDefHasUSB(def) &&
|
||||||
def->os.type != VIR_DOMAIN_OSTYPE_EXE &&
|
def->os.type != VIR_DOMAIN_OSTYPE_EXE &&
|
||||||
virDomainDeviceIsUSB(dev)) {
|
virDomainDeviceIsUSB(dev)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user