mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
qemu-io: Make cvtnum() a wrapper around strtosz_suffix()
No reason to implement the same thing multiple times. A nice side effect is that fractional numbers like 0.5M can be used in qemu-io now. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
5e00984aef
commit
b6e356aa25
3 changed files with 6 additions and 38 deletions
|
@ -29,6 +29,12 @@ static BlockDriverState *bs;
|
|||
|
||||
static int misalign;
|
||||
|
||||
static int64_t cvtnum(const char *s)
|
||||
{
|
||||
char *end;
|
||||
return strtosz_suffix(s, &end, STRTOSZ_DEFSUFFIX_B);
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse the pattern argument to various sub-commands.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue