qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-block] [PATCH v3] qemu-img: add skip option to dd


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3] qemu-img: add skip option to dd
Date: Wed, 3 Aug 2016 10:00:47 +0100

On Thu, Jul 28, 2016 at 4:51 PM, Reda Sallahi <address@hidden> wrote:
> On 7/28/16, Stefan Hajnoczi <address@hidden> wrote:
>> On Wed, Jul 27, 2016 at 3:51 PM, Reda Sallahi <address@hidden> wrote:
>>> -    qemu_opt_set_number(opts, BLOCK_OPT_SIZE, size, &error_abort);
>>> +    if (dd.flags & C_SKIP && size < in.bsz * in.offset) {
>>> +        error_report("%s: cannot skip to specified offset",
>>> in.filename);
>>> +        qemu_opt_set_number(opts, BLOCK_OPT_SIZE, 0, &error_abort);
>>
>> This looks odd.  What is supposed to happen in this case?  Do you have
>> a test case for it?
>>
>
> We print a warning if we have specified a too big of a value for skip (bigger
> than the input size) and set the size to 0 for the output disk image. It's the
> same behavior on dd(1).
>
> In the last iteration of the test case it covers such a case. Though without
> checking the output on stderr.

Good that you have a test case.

Please also add a comment here explaining that this behavior is
compatible with dd and this is a warning rather than an error.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]