Trivial patches for 2014-07-18
Since we're close to release, I included only really-really-trivial and safe changes in this pull request, -- only those which wont break anything. One good patch is a documentation change mentioning icmp sockets, plus a series from Stefan Weil which adds some missing `static' attributes here and there and fixes some typos in comments. Plus a single patch from Chen Gang which was in the queue for quite some time, also really trivial. And an addition of error message for slirp code which was pinged several times already.
I haven't considered other "a bit less" than trivial patches for 2.1.
Please consider either pulling whole series or at least applying the icmp doc change.
Thanks,
/mjt
The following changes since commit 4d121a549869b93475ccf8b9a0d3e693011d1abb:
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2014-07-18 09:35:51 +0100)
are available in the git repository at:
git://git.corpit.ru/qemu.git tags/trivial-patches-2014-07-18
for you to fetch changes up to 748bfb4eee8e699f3d2dd6a95820d1a9e57e4aa6:
tests: Add missing 'static' attributes (fix warnings from smatch) (2014-07-18 17:45:37 +0400)
----------------------------------------------------------------
trivial patches for 2014-07-18
----------------------------------------------------------------
Chen Gang (1):
qemu-img: Remove redundancy "ret = -1"
Gernot Hillier (1):
doc: slirp supports ICMP echo if enabled in Linux
Peter Maydell (1):
slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack
Stefan Weil (5):
Fix new typos in comments (found by codespell)
hw/usb: Add missing 'static' attribute
qga: Add missing 'static' attribute
migration: Add missing 'static' attribute
tests: Add missing 'static' attributes (fix warnings from smatch)
block-migration.c | 2 +- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- hw/usb/hcd-ohci.c | 2 +- include/libdecnumber/decNumberLocal.h | 2 +- net/slirp.c | 1 + qemu-doc.texi | 13 ++++++++++--- qemu-img.c | 1 - qga/commands-posix.c | 2 +- tests/fdc-test.c | 2 +- tests/test-aio.c | 2 +- tests/test-qemu-opts.c | 2 +- tests/test-throttle.c | 8 ++++---- tests/test-visitor-serialization.c | 6 +++--- tests/test-vmstate.c | 4 ++-- xen-hvm.c | 2 +- 16 files changed, 30 insertions(+), 23 deletions(-)
[Qemu-devel] [PULL 7/8] migration: Add missing 'static' attribute
From: Stefan Weil <[email protected]>
--- block-migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block-migration.c +1 -1
@@ -861,7 +861,7 @@ static bool block_is_active(void *opaque)return block_mig_state.blk_enable ==1 ; } -SaveVMHandlers savevm_block_handlers = { +static SaveVMHandlers savevm_block_handlers = { .set_params = block_set_params, .save_live_setup = block_save_setup, .save_live_iterate = block_save_iterate,
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 2/8] Fix new typos in comments (found by codespell)
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
arbitary -> arbitrary
basicly -> basically
--- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- include/libdecnumber/decNumberLocal.h | 2 +- xen-hvm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/i386/pc_piix.c +1 -1
@@ -114,7 +114,7 @@ static void pc_init1(MachineState *machine, lowmem =0xe0000000 ; } -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ if (lowmem > pc_machine->max_ram_below_4g) {
hw/i386/pc_q35.c +1 -1
@@ -103,7 +103,7 @@ static void pc_q35_init(MachineState *machine) lowmem =0xb0000000 ; } -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ if (lowmem > pc_machine->max_ram_below_4g) {
include/libdecnumber/decNumberLocal.h +1 -1
@@ -153,7 +153,7 @@/* ---------------------------------------------------------------- */ -/* Definitions for arbitary-precision modules (only valid after */ +/* Definitions for arbitrary-precision modules (only valid after */ /* decNumber.h has been included) */ /* ---------------------------------------------------------------- */
xen-hvm.c +1 -1
@@ -165,7 +165,7 @@ static void xen_ram_init(ram_addr_t *below_4g_mem_size,PC_MACHINE_MAX_RAM_BELOW_4G , &error_abort); -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(xen limit, user limit). */ if (HVM_BELOW_4G_RAM_END <= user_lowmem) {
Signature · 1 line
1.7.10.4
Re: [Qemu-devel] [PULL 2/8] Fix new typos in comments (found by codespell)
Quoted 67 lines · Michael Tokarev
From: Stefan Weil <[email protected]>
arbitary -> arbitrary
basicly -> basicallySigned-off-by Stefan Weil <[email protected]>Signed-off-by Michael Tokarev <[email protected]>--- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- include/libdecnumber/decNumberLocal.h | 2 +- xen-hvm.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)hw/i386/pc_piix.c +1
-1@@ -114,7 +114,7 @@ static void pc_init1(MachineState *machine, lowmem =0xe0000000 ; } -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ if (lowmem > pc_machine->max_ram_below_4g) {hw/i386/pc_q35.c +1
-1@@ -103,7 +103,7 @@ static void pc_q35_init(MachineState *machine) lowmem =0xb0000000 ; } -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(qemu limit, user limit). */ if (lowmem > pc_machine->max_ram_below_4g) {include/libdecnumber/decNumberLocal.h +1
-1@@ -153,7 +153,7 @@/* ---------------------------------------------------------------- */ -/* Definitions for arbitary-precision modules (only valid after */ +/* Definitions for arbitrary-precision modules (only valid after */ /* decNumber.h has been included) */ /* ---------------------------------------------------------------- */ xen-hvm.c +1
-2@@ -165,7 +165,7 @@ static void xen_ram_init(ram_addr_t *below_4g_mem_size,PC_MACHINE_MAX_RAM_BELOW_4G , &error_abort); -/* Handle the machine opt max-ram-below-4g. It is basicly doing +/* Handle the machine opt max-ram-below-4g. It is basically doing * min(xen limit, user limit). */ if (HVM_BELOW_4G_RAM_END <= user_lowmem) { --
Quoted 3 lines
1.7.10.4
Please consider including typo bits from
http://patchwork.ozlabs.org/patch/251038/ as well.
[Qemu-devel] [PULL 4/8] doc: slirp supports ICMP echo if enabled in Linux
In reply to Michael TokarevFrom: Gernot Hillier <[email protected]>
Since QEMU 0.15, slirp (user mode networking) supports ping to the Internet, see e6d43cfb1f9
--- qemu-doc.texi | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
qemu-doc.texi +10 -3
@@ -1205,9 +1205,16 @@ In order to check that the user mode network is working, you can ping the address 10.0.2.2 and verify that you got an address in the range 10.0.2.x from the QEMU virtual DHCP server. -Note that @code{ping} is not supported reliably to the internet as it -would require root privileges. It means you can only ping the local -router (10.0.2.2). +Note that ICMP traffic in general does not work with user mode networking. +@code{ping}, aka. ICMP echo, to the local router (10.0.2.2) shall work, +however. If you're using QEMU on Linux >= 3.0, it can use unprivileged ICMP +ping sockets to allow @code{ping} to the Internet. The host admin has to set +the ping_group_range in order to grant access to those sockets. To allow ping +for GID 100 (usually users group): + +@example +echo 100 100 > /proc/sys/net/ipv4/ping_group_range +@end example When using the built-in TFTP server, the router is also the TFTP server.
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 5/8] hw/usb: Add missing 'static' attribute
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
--- hw/usb/hcd-ohci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-ohci.c +1 -1
@@ -2021,7 +2021,7 @@ static const VMStateDescription vmstate_ohci_eof_timer = { }, }; -const VMStateDescription vmstate_ohci_state = { +static const VMStateDescription vmstate_ohci_state = { .name ="ohci-core" , .version_id =1 , .minimum_version_id =1 ,
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 6/8] qga: Add missing 'static' attribute
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
This fixes a warning from the static code analysis (smatch).
--- qga/commands-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qga/commands-posix.c +1 -1
@@ -643,7 +643,7 @@ typedef enum {FSFREEZE_HOOK_FREEZE , } FsfreezeHookArg; -const char *fsfreeze_hook_arg_string[] = { +static const char *fsfreeze_hook_arg_string[] = {"thaw" ,"freeze" , };
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 3/8] qemu-img: Remove redundancy "ret = -1"
In reply to Michael TokarevFrom: Chen Gang <[email protected]>
In this case, 'ret' is already '-1', so need not do it again.
--- qemu-img.c | 1 - 1 file changed, 1 deletion(-)
qemu-img.c +0 -1
@@ -246,7 +246,6 @@ static int read_password(char *buf, int buf_size)if (errno ==EAGAIN || errno ==EINTR ) {continue ; }else { - ret =-1 ;break ; } }else if (ret ==0 ) {
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 1/8] slirp: Give error message if hostfwd_add/remove for unrecognized vlan/stack
In reply to Michael TokarevFrom: Peter Maydell <[email protected]>
If the user specified a (vlan ID, slirp stack name) tuple in a monitor hostfwd_add/remove command and we can't find it, give the user an error message rather than silently doing nothing.
This brings this error case in slirp_lookup() into line with the other two.
--- net/slirp.c | 1 + 1 file changed, 1 insertion(+)
net/slirp.c +1 -0
@@ -282,6 +282,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *vlan,NetClientState *nc; nc =net_hub_find_client_by_name (strtol (vlan,NULL ,0 ), stack);if (!nc) { +monitor_printf (mon,"unrecognized (vlan-id, stackname) pair\n" );return NULL ; }if (strcmp (nc->model,"user" )) {
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 8/8] tests: Add missing 'static' attributes (fix warnings from smatch)
In reply to Michael TokarevFrom: Stefan Weil <[email protected]>
Smatch also complains about 0 used for pointers, so replace those by NULL in test-visitor-serialization.c, too.
--- tests/fdc-test.c | 2 +- tests/test-aio.c | 2 +- tests/test-qemu-opts.c | 2 +- tests/test-throttle.c | 8 ++++---- tests/test-visitor-serialization.c | 6 +++--- tests/test-vmstate.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-)
tests/fdc-test.c +1 -1
@@ -65,7 +65,7 @@ enum { DSKCHG = 0x80, }; -char test_image[] ="/tmp/qtest.XXXXXX" ; +static char test_image[] ="/tmp/qtest.XXXXXX" ;#define assert_bit_set (data, mask) g_assert_cmphex((data) & (mask), ==, (mask))#define assert_bit_clear (data, mask) g_assert_cmphex((data) & (mask), ==, 0)
tests/test-aio.c +1 -1
@@ -15,7 +15,7 @@#include "qemu/timer.h" #include "qemu/sockets.h" -AioContext *ctx; +static AioContext *ctx; typedef struct { EventNotifier e;
tests/test-qemu-opts.c +1 -1
@@ -56,7 +56,7 @@ static QemuOptsList opts_list_02 = { }, }; -QemuOptsList opts_list_03 = { +static QemuOptsList opts_list_03 = { .name ="opts_list_03" , .head =QTAILQ_HEAD_INITIALIZER (opts_list_03.head), .desc = {
tests/test-throttle.c +4 -4
@@ -15,10 +15,10 @@#include "block/aio.h" #include "qemu/throttle.h" -AioContext *ctx; -LeakyBucket bkt; -ThrottleConfig cfg; -ThrottleState ts; +static AioContext *ctx; +static LeakyBucket bkt; +static ThrottleConfig cfg; +static ThrottleState ts;/* useful function */ static bool double_cmp (double x,double y)
tests/test-visitor-serialization.c +3 -3
@@ -372,8 +372,8 @@ static void test_primitive_lists(gconstpointer opaque)TestArgs *args = (TestArgs *) opaque;const SerializeOps *ops = args->ops;PrimitiveType *pt = args->test_data; -PrimitiveList pl = { .value = {0 } }; -PrimitiveList pl_copy = { .value = {0 } }; +PrimitiveList pl = { .value = {NULL } }; +PrimitiveList pl_copy = { .value = {NULL } };PrimitiveList *pl_copy_ptr = &pl_copy;Error *err =NULL ;void *serialize_data;
@@ -771,7 +771,7 @@ static void test_nested_struct_list(gconstpointer opaque)g_free (args); } -PrimitiveType pt_values[] = { +static PrimitiveType pt_values[] = {/* string tests */ { .description ="string_empty" ,
tests/test-vmstate.c +2 -2
@@ -29,8 +29,8 @@#include "migration/vmstate.h" #include "block/coroutine.h" -char temp_file[] ="/tmp/vmst.test.XXXXXX" ; -int temp_fd; +static char temp_file[] ="/tmp/vmst.test.XXXXXX" ; +static int temp_fd;/* Fake yield_until_fd_readable() implementation so we don't have to pull the * coroutine code as dependency.
Signature · 1 line
1.7.10.4
Peter Maydell
AppliedQuoted 24 lines · Michael Tokarev
Since we're close to release, I included only really-really-trivial and safe changes in this pull request, -- only those which wont break anything. One good patch is a documentation change mentioning icmp sockets, plus a series from Stefan Weil which adds some missing `static' attributes here and there and fixes some typos in comments. Plus a single patch from Chen Gang which was in the queue for quite some time, also really trivial. And an addition of error message for slirp code which was pinged several times already.
I haven't considered other "a bit less" than trivial patches for 2.1.
Please consider either pulling whole series or at least applying the icmp doc change.
Thanks,
/mjt
The following changes since commit
4d121a549869b93475ccf8b9a0d3e693011d1abb:Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2014-07-18 09:35:51 +0100)
are available in the git repository at:
Quoted 8 lines
git://git.corpit.ru/qemu.gittags/trivial-patches-2014-07-18for you to fetch changes up to
748bfb4eee8e699f3d2dd6a95820d1a9e57e4aa6:tests: Add missing 'static' attributes (fix warnings from smatch) (2014-07-18 17:45:37 +0400)
----------------------------------------------------------------
trivial patches for 2014-07-18
Applied, thanks.
-- PMM