handling qemuMonitorAddDevice failure: missing drive_del function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In src/qemu/qemu_driver.c, coverity gripes (rightly) about this:

 6912    qemuDomainObjEnterMonitorWithDriver(driver, vm);
 6913    if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) {
 6914        ret = qemuMonitorAddDrive(priv->mon, drivestr);
 6915        if (ret == 0)
No check of the return value of "qemuMonitorAddDevice(priv->mon, devstr)".
Calling function "qemuMonitorAddDevice" without checking return value.
 6916            qemuMonitorAddDevice(priv->mon, devstr);
 6917            /* XXX remove the drive upon fail */
 6918    } else {

Does anyone have a preference on how to deal with it
while we wait for a drive-removal function?
I think it deserves at least a diagnostic.

I suppose this comment is still relevant:

        if (ret == 0)
            ret = qemuMonitorAddDevice(priv->mon,
                                       devstr);
            /* XXX should call 'drive_del' on error but this does not exist yet */

This XXX marks the same problem -- though note that coverity could
not possibly see this one.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]