Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-13 Thread Vladimir Sementsov-Ogievskiy
12.05.2020 21:48, Kevin Wolf wrote: Am 12.05.2020 um 19:15 hat Vladimir Sementsov-Ogievskiy geschrieben: 11.05.2020 16:58, Kevin Wolf wrote: If the target is shorter than the source, mirror would copy data until it reaches the end of the target and then fail with an I/O error when trying to wri

Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-12 Thread Kevin Wolf
Am 12.05.2020 um 19:15 hat Vladimir Sementsov-Ogievskiy geschrieben: > 11.05.2020 16:58, Kevin Wolf wrote: > > If the target is shorter than the source, mirror would copy data until > > it reaches the end of the target and then fail with an I/O error when > > trying to write past the end. > > > >

Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-12 Thread Vladimir Sementsov-Ogievskiy
12.05.2020 20:15, Vladimir Sementsov-Ogievskiy wrote: +    } else if (s->bdev_length != target_length) { +    error_setg(errp, "Source and target image have different sizes"); +    ret = -EINVAL; Seems, the only case, when mirror_run() sets errp. And, therefore, the only correct one..

Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-12 Thread Vladimir Sementsov-Ogievskiy
11.05.2020 16:58, Kevin Wolf wrote: If the target is shorter than the source, mirror would copy data until it reaches the end of the target and then fail with an I/O error when trying to write past the end. If the target is longer than the source, the mirror job would complete successfully, but

Re: [PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-11 Thread Max Reitz
On 11.05.20 15:58, Kevin Wolf wrote: > If the target is shorter than the source, mirror would copy data until > it reaches the end of the target and then fail with an I/O error when > trying to write past the end. > > If the target is longer than the source, the mirror job would complete > success

[PATCH v2 3/4] mirror: Make sure that source and target size match

2020-05-11 Thread Kevin Wolf
If the target is shorter than the source, mirror would copy data until it reaches the end of the target and then fail with an I/O error when trying to write past the end. If the target is longer than the source, the mirror job would complete successfully, but the target wouldn't actually be an acc