Lines Matching full:if
63 if (nb_sns < 0) { in bdrv_snapshot_find()
68 if (!strcmp(sn->name, name)) { in bdrv_snapshot_find()
88 * If both @id and @name are specified, find the first one with id @id and
90 * If only @id is specified, find the first one with id @id.
91 * If only @name is specified, find the first one with name @name.
92 * if none is specified, abort().
95 * when error or not found. If all operation succeed but no matching one is
112 if (nb_sns < 0) { in bdrv_snapshot_find_by_id_and_name()
115 } else if (nb_sns == 0) { in bdrv_snapshot_find_by_id_and_name()
119 if (id && name) { in bdrv_snapshot_find_by_id_and_name()
122 if (!strcmp(sn->id_str, id) && !strcmp(sn->name, name)) { in bdrv_snapshot_find_by_id_and_name()
128 } else if (id) { in bdrv_snapshot_find_by_id_and_name()
131 if (!strcmp(sn->id_str, id)) { in bdrv_snapshot_find_by_id_and_name()
137 } else if (name) { in bdrv_snapshot_find_by_id_and_name()
140 if (!strcmp(sn->name, name)) { in bdrv_snapshot_find_by_id_and_name()
154 * back if the given BDS does not support snapshots.
155 * Return NULL if there is no BDS to (safely) fall back to.
167 if (!fallback) { in bdrv_snapshot_fallback_child()
173 * snapshotted. If there are, it is not safe to fall back to in bdrv_snapshot_fallback_child()
177 if (child->role & (BDRV_CHILD_DATA | BDRV_CHILD_METADATA | in bdrv_snapshot_fallback_child()
201 if (!drv || !bdrv_is_inserted(bs) || !bdrv_is_writable(bs)) { in bdrv_can_snapshot()
205 if (!drv->bdrv_snapshot_create) { in bdrv_can_snapshot()
207 if (fallback_bs) { in bdrv_can_snapshot()
224 if (!drv) { in bdrv_snapshot_create()
227 if (drv->bdrv_snapshot_create) { in bdrv_snapshot_create()
230 if (fallback_bs) { in bdrv_snapshot_create()
246 if (!drv) { in bdrv_snapshot_goto()
251 if (!QLIST_EMPTY(&bs->dirty_bitmaps)) { in bdrv_snapshot_goto()
256 if (drv->bdrv_snapshot_goto) { in bdrv_snapshot_goto()
258 if (ret < 0) { in bdrv_snapshot_goto()
268 if (fallback) { in bdrv_snapshot_goto()
289 if (drv->bdrv_close) { in bdrv_snapshot_goto()
304 if (open_ret < 0) { in bdrv_snapshot_goto()
337 * If both @snapshot_id and @name are specified, delete the first one with
339 * If only @snapshot_id is specified, delete the first one with id
341 * If only @name is specified, delete the first one with name @name.
342 * if none is specified, return -EINVAL.
344 * Returns: 0 on success, -errno on failure. If @bs is not inserted, return
345 * -ENOMEDIUM. If @snapshot_id and @name are both NULL, return -EINVAL. If @bs
346 * does not support internal snapshot deletion, return -ENOTSUP. If @bs does
348 * specified, return -EINVAL. If @bs can't find one matching @id and @name,
349 * return -ENOENT. If @errp != NULL, it will always be filled with error
365 if (!drv) { in bdrv_snapshot_delete()
370 if (!snapshot_id && !name) { in bdrv_snapshot_delete()
375 if (drv->bdrv_snapshot_delete) { in bdrv_snapshot_delete()
377 } else if (fallback_bs) { in bdrv_snapshot_delete()
398 if (!drv) { in bdrv_snapshot_list()
401 if (drv->bdrv_snapshot_list) { in bdrv_snapshot_list()
404 if (fallback_bs) { in bdrv_snapshot_list()
417 * If both @snapshot_id and @name are specified, load the first one with
419 * If only @snapshot_id is specified, load the first one with id
421 * If only @name is specified, load the first one with name @name.
422 * if none is specified, return -EINVAL.
424 * Returns: 0 on success, -errno on fail. If @bs is not inserted, return
425 * -ENOMEDIUM. If @bs is not readonly, return -EINVAL. If @bs did not support
426 * internal snapshot, return -ENOTSUP. If qemu can't find a matching @id and
427 * @name, return -ENOENT. If @errp != NULL, it will always be filled on
440 if (!drv) { in bdrv_snapshot_load_tmp()
445 if (!snapshot_id && !name) { in bdrv_snapshot_load_tmp()
449 if (!bdrv_is_read_only(bs)) { in bdrv_snapshot_load_tmp()
453 if (drv->bdrv_snapshot_load_tmp) { in bdrv_snapshot_load_tmp()
472 if (ret == -ENOENT || ret == -EINVAL) { in bdrv_snapshot_load_tmp_by_id_or_name()
490 if (has_devices) { in bdrv_all_get_snapshot_devices()
491 if (!devices) { in bdrv_all_get_snapshot_devices()
498 if (!bs) { in bdrv_all_get_snapshot_devices()
523 if (!bdrv_is_inserted(bs) || bdrv_is_read_only(bs)) { in bdrv_all_snapshots_includes_bs()
543 if (bdrv_all_get_snapshot_devices(has_devices, devices, &bdrvs, errp) < 0) { in bdrv_all_can_snapshot()
552 if (devices || bdrv_all_snapshots_includes_bs(bs)) { in bdrv_all_can_snapshot()
555 if (!ok) { in bdrv_all_can_snapshot()
582 if (ret < 0) { in bdrv_all_delete_snapshot()
591 if ((devices || bdrv_all_snapshots_includes_bs(bs)) && in bdrv_all_delete_snapshot()
597 if (ret < 0) { in bdrv_all_delete_snapshot()
628 if (ret < 0) { in bdrv_all_goto_snapshot()
643 if (ret < 0) { in bdrv_all_goto_snapshot()
667 if (bdrv_all_get_snapshot_devices(has_devices, devices, &bdrvs, errp) < 0) { in bdrv_all_has_snapshot()
677 if (devices || bdrv_all_snapshots_includes_bs(bs)) { in bdrv_all_has_snapshot()
680 if (ret < 0) { in bdrv_all_has_snapshot()
681 if (ret == -ENOENT) { in bdrv_all_has_snapshot()
709 if (bdrv_all_get_snapshot_devices(has_devices, devices, &bdrvs, errp) < 0) { in bdrv_all_create_snapshot()
718 if (bs == vm_state_bs) { in bdrv_all_create_snapshot()
721 } else if (devices || bdrv_all_snapshots_includes_bs(bs)) { in bdrv_all_create_snapshot()
725 if (ret < 0) { in bdrv_all_create_snapshot()
748 if (bdrv_all_get_snapshot_devices(has_devices, devices, &bdrvs, errp) < 0) { in bdrv_all_find_vmstate_bs()
760 if (vmstate_bs) { in bdrv_all_find_vmstate_bs()
761 if (g_str_equal(vmstate_bs, in bdrv_all_find_vmstate_bs()
763 if (found) { in bdrv_all_find_vmstate_bs()
772 } else if (found) { in bdrv_all_find_vmstate_bs()
779 if (vmstate_bs) { in bdrv_all_find_vmstate_bs()