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>
---
src/conf/domain_conf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d96b012b9..fcafc8b2f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -27417,9 +27417,12 @@ virDomainDefCompatibleDevice(virDomainDefPtr def,
{
virDomainCompatibleDeviceData data = {
.newInfo = virDomainDeviceGetInfo(dev),
- .oldInfo = virDomainDeviceGetInfo(oldDev),
+ .oldInfo = NULL,
};
+ if (oldDev)
+ data.oldInfo = virDomainDeviceGetInfo(oldDev);
+
if (!virDomainDefHasUSB(def) &&
def->os.type != VIR_DOMAIN_OSTYPE_EXE &&
virDomainDeviceIsUSB(dev)) {
--
2.13.6
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On Thu, Mar 01, 2018 at 08:03:38 -0500, John Ferlan wrote: > 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> > --- > src/conf/domain_conf.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index d96b012b9..fcafc8b2f 100644 > --- a/src/conf/domain_conf.c > +++ b/src/conf/domain_conf.c > @@ -27417,9 +27417,12 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, > { > virDomainCompatibleDeviceData data = { > .newInfo = virDomainDeviceGetInfo(dev), > - .oldInfo = virDomainDeviceGetInfo(oldDev), > + .oldInfo = NULL, > }; > > + if (oldDev) > + data.oldInfo = virDomainDeviceGetInfo(oldDev); > + > if (!virDomainDefHasUSB(def) && > def->os.type != VIR_DOMAIN_OSTYPE_EXE && > virDomainDeviceIsUSB(dev)) { Oops, it was supposed to be like this as oldDev is explicitly optional. Not sure where I lost this... ACK, thanks. Jirka -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2025 Red Hat, Inc.