* [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options
@ 2018-01-22 7:21 Lin Ma
2018-01-22 16:45 ` Max Reitz
0 siblings, 1 reply; 3+ messages in thread
From: Lin Ma @ 2018-01-22 7:21 UTC (permalink / raw)
To: qemu-block; +Cc: qemu-devel, mreitz, kwolf
If the user specifies image format through driver-specific options, The
format probing should be prohibited and the warning message should not
be printed.
e.g.:
$ qemu-system-x86_64 ... -drive file.file.filename=disk0.raw,file.driver=raw ...
WARNING: Image format was not specified for 'disk0.raw' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, ...
Signed-off-by: Lin Ma <lma@suse.com>
---
blockdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blockdev.c b/blockdev.c
index 29d569a24e..ef4c167235 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -529,6 +529,8 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
goto early_err;
}
qdict_put_str(bs_opts, "driver", buf);
+ } else if (qdict_haskey(bs_opts, "file.driver")) {
+ qdict_put_str(bs_opts, "driver", qdict_get_str(bs_opts, "file.driver"));
}
on_write_error = BLOCKDEV_ON_ERROR_ENOSPC;
--
2.15.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options
2018-01-22 7:21 [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options Lin Ma
@ 2018-01-22 16:45 ` Max Reitz
2018-01-23 3:05 ` Lin Ma
0 siblings, 1 reply; 3+ messages in thread
From: Max Reitz @ 2018-01-22 16:45 UTC (permalink / raw)
To: Lin Ma, qemu-block; +Cc: qemu-devel, kwolf
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
On 2018-01-22 08:21, Lin Ma wrote:
> If the user specifies image format through driver-specific options, The
> format probing should be prohibited and the warning message should not
> be printed.
>
> e.g.:
> $ qemu-system-x86_64 ... -drive file.file.filename=disk0.raw,file.driver=raw ...
> WARNING: Image format was not specified for 'disk0.raw' and probing guessed raw.
> Automatically detecting the format is dangerous for raw images, ...
>
> Signed-off-by: Lin Ma <lma@suse.com>
> ---
> blockdev.c | 2 ++
> 1 file changed, 2 insertions(+)
But what has been proped is the driver for the root BDS, so the warning
is actually correct.
(That command line is creating a chain of three BDS:
raw (probed) -> raw (explicitly specified) -> file (default protocol))
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options
2018-01-22 16:45 ` Max Reitz
@ 2018-01-23 3:05 ` Lin Ma
0 siblings, 0 replies; 3+ messages in thread
From: Lin Ma @ 2018-01-23 3:05 UTC (permalink / raw)
To: Max Reitz; +Cc: qemu-block, qemu-devel, kwolf
On 01/23/2018 12:45 AM, Max Reitz wrote:
> On 2018-01-22 08:21, Lin Ma wrote:
>> If the user specifies image format through driver-specific options, The
>> format probing should be prohibited and the warning message should not
>> be printed.
>>
>> e.g.:
>> $ qemu-system-x86_64 ... -drive file.file.filename=disk0.raw,file.driver=raw ...
>> WARNING: Image format was not specified for 'disk0.raw' and probing guessed raw.
>> Automatically detecting the format is dangerous for raw images, ...
>>
>> Signed-off-by: Lin Ma <lma@suse.com>
>> ---
>> blockdev.c | 2 ++
>> 1 file changed, 2 insertions(+)
> But what has been proped is the driver for the root BDS, so the warning
> is actually correct.
>
> (That command line is creating a chain of three BDS:
> raw (probed) -> raw (explicitly specified) -> file (default protocol))
>
> Max
>
OK, Thanks
Lin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-23 3:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 7:21 [Qemu-devel] [PATCH] raw: Disable probing if image format is given by driver-specific options Lin Ma
2018-01-22 16:45 ` Max Reitz
2018-01-23 3:05 ` Lin Ma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).