snapshot.c (2436651b26584c8ebe91db5df67ee054509a0949) snapshot.c (307261b243df2edde538f3ed5c9d80e168529355)
1/*
2 * Block layer snapshot related functions
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 401 unchanged lines hidden (view full) ---

410 if (!drv) {
411 error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
412 return -ENOMEDIUM;
413 }
414 if (!snapshot_id && !name) {
415 error_setg(errp, "snapshot_id and name are both NULL");
416 return -EINVAL;
417 }
1/*
2 * Block layer snapshot related functions
3 *
4 * Copyright (c) 2003-2008 Fabrice Bellard
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 401 unchanged lines hidden (view full) ---

410 if (!drv) {
411 error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, bdrv_get_device_name(bs));
412 return -ENOMEDIUM;
413 }
414 if (!snapshot_id && !name) {
415 error_setg(errp, "snapshot_id and name are both NULL");
416 return -EINVAL;
417 }
418 if (!bs->read_only) {
418 if (!bdrv_is_read_only(bs)) {
419 error_setg(errp, "Device is not readonly");
420 return -EINVAL;
421 }
422 if (drv->bdrv_snapshot_load_tmp) {
423 return drv->bdrv_snapshot_load_tmp(bs, snapshot_id, name, errp);
424 }
425 error_setg(errp, "Block format '%s' used by device '%s' "
426 "does not support temporarily loading internal snapshots",

--- 310 unchanged lines hidden ---
419 error_setg(errp, "Device is not readonly");
420 return -EINVAL;
421 }
422 if (drv->bdrv_snapshot_load_tmp) {
423 return drv->bdrv_snapshot_load_tmp(bs, snapshot_id, name, errp);
424 }
425 error_setg(errp, "Block format '%s' used by device '%s' "
426 "does not support temporarily loading internal snapshots",

--- 310 unchanged lines hidden ---