diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5a678c9..d5ee16a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4871,8 +4871,7 @@ qemuDomainManagedSavePath(struct qemud_driver *driver, virDomainObjPtr vm) { } static int -qemuDomainManagedSave(virDomainPtr dom, - unsigned int flags ATTRIBUTE_UNUSED) +qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm = NULL; @@ -4880,6 +4879,13 @@ qemuDomainManagedSave(virDomainPtr dom, int ret = -1; int compressed; + if (flags != 0) { + qemuReportError(VIR_ERR_INVALID_ARG, + _("unsupported flags (0x%x) passed to '%s'"), + flags, __FUNCTION__); + return -1; + } + qemuDriverLock(driver); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { @@ -4932,14 +4938,20 @@ error: } static int -qemuDomainHasManagedSaveImage(virDomainPtr dom, - unsigned int flags ATTRIBUTE_UNUSED) +qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm = NULL; int ret = -1; char *name = NULL; + if (flags != 0) { + qemuReportError(VIR_ERR_INVALID_ARG, + _("unsupported flags (0x%x) passed to '%s'"), + flags, __FUNCTION__); + return -1; + } + qemuDriverLock(driver); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { @@ -4965,14 +4977,20 @@ cleanup: } static int -qemuDomainManagedSaveRemove(virDomainPtr dom, - unsigned int flags ATTRIBUTE_UNUSED) +qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) { struct qemud_driver *driver = dom->conn->privateData; virDomainObjPtr vm = NULL; int ret = -1; char *name = NULL; + if (flags != 0) { + qemuReportError(VIR_ERR_INVALID_ARG, + _("unsupported flags (0x%x) passed to '%s'"), + flags, __FUNCTION__); + return -1; + } + qemuDriverLock(driver); vm = virDomainFindByUUID(&driver->domains, dom->uuid); if (!vm) { @@ -6174,7 +6192,10 @@ static int qemudDomainStart(virDomainPtr dom) { */ managed_save = qemuDomainManagedSavePath(driver, vm); if ((managed_save) && (virFileExists(managed_save))) { - /* We should still have a reference left to vm but */ + /* + * We should still have a reference left to vm but + * but one should check for 0 anyway + */ if (qemuDomainObjEndJob(vm) == 0) vm = NULL; virDomainObjUnlock(vm);