Richard W.M. Jones f76faeda4b block/curl: Improve type safety of s->timeout.
qemu_opt_get_number returns a uint64_t, and curl_easy_setopt expects a
long (not an int).  There is no warning about the latter type error
because curl_easy_setopt uses a varargs argument.

Store the timeout (which is a positive number of seconds) as a
uint64_t.  Check that the number given by the user is reasonable.
Zero is permissible (meaning no timeout is enforced by cURL).

Cast it to long before calling curl_easy_setopt to fix the type error.

Example error message after this change has been applied:

$ ./qemu-img create -f qcow2 /tmp/test.qcow2 \
    -b 'json: { "file.driver":"https",
                "file.url":"https://foo/bar",
                "file.timeout":-1 }'
qemu-img: /tmp/test.qcow2: Could not open 'json: { "file.driver":"https", "file.url":"https://foo/bar", "file.timeout":-1 }': timeout parameter is too large or negative: Invalid argument

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-11-03 11:41:47 +00:00
2014-09-18 20:02:01 +01:00
2013-04-18 13:50:53 +02:00
2014-11-03 09:48:41 +00:00
2014-09-04 17:39:07 +01:00
2014-09-25 13:34:03 +01:00
2014-11-02 13:30:00 +01:00
2012-09-07 09:02:44 +03:00
2014-06-16 13:24:35 +02:00
2013-09-05 09:40:31 -05:00
2014-08-29 10:46:58 +01:00
2014-06-23 11:12:28 -04:00
2013-10-11 09:34:56 -07:00
2014-09-16 11:04:09 +02:00
2013-07-23 02:41:31 +02:00
2014-10-24 12:19:11 +01:00
2014-09-26 13:37:06 -04:00
2014-09-26 13:37:06 -04:00
2014-10-10 14:07:08 +01:00
2013-08-12 09:15:12 -05:00
2014-09-26 09:34:39 +01:00
2013-09-03 12:25:55 +02:00
2014-10-24 12:19:11 +01:00
2014-09-22 11:39:45 +01:00
2014-09-22 11:39:45 +01:00
2014-05-24 00:07:29 +04:00
2014-10-02 09:58:14 +02:00
2013-10-11 09:34:56 -07:00
2014-09-19 17:20:11 +01:00
2014-02-17 11:57:23 -05:00
2014-06-05 16:10:33 +02:00
2014-08-01 18:30:08 +01:00
2013-10-11 09:34:56 -07:00
2014-10-27 14:09:27 +00:00
2014-07-07 10:37:40 +00:00

Read the documentation in qemu-doc.html or on http://wiki.qemu-project.org

- QEMU team
Description
QEMU With E2K User Support
Readme 459 MiB
Languages
C 83.1%
C++ 6.3%
Python 3.2%
Dylan 2.8%
Shell 1.6%
Other 2.8%