* [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11
@ 2014-12-11 18:15 Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples Michael Tokarev
` (20 more replies)
0 siblings, 21 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev
This is the first pull request from trivial-patches tree for
quite some time, I was quiet during 2.2 freeze period and here's
what has been accumulated during the freeze.
As usual, there are many small things from Gonglei and some good
stuff from Marcus, plus some more from others, all pretty much
trivial.
Please pull.
Thanks,
/mjt
The following changes since commit 7fb8da2b8861795e0013e6ee97acd0363d868a35:
Open 2.3 development tree (2014-12-09 21:48:34 +0000)
are available in the git repository at:
git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2014-12-11
for you to fetch changes up to 64baadc2726ae929660dd0c61a42e8d9f3ba1828:
Sort include/qemu/typedefs.h (2014-12-11 21:00:30 +0300)
----------------------------------------------------------------
trivial patches for 2014-12-11
----------------------------------------------------------------
Amos Kong (1):
qmp: fix typo in input-send-event examples
Antony Pavlov (1):
pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category
Dr. David Alan Gilbert (1):
Sort include/qemu/typedefs.h
Fam Zheng (1):
configure: Replace which(1) with "has"
Gonglei (6):
acpi-build: adjust indention 8 -> 4 spaces
acpi-build: Make DPRINTF working for acpi-build
virtio-bus: avoid breaking build when open DEBUG switch
fw_cfg: remove superfluous blank line
qapi-schema: fix typo about change-vnc-password
virtio: remove useless declaration of virtio_net_init()
Markus Armbruster (5):
Drop superfluous conditionals around qemu_opts_del()
Drop superfluous conditionals around g_strdup()
util: Drop superfluous conditionals around g_free()
util: Fuse g_malloc(); memset() into g_new0()
util: Use g_new() & friends where that makes obvious sense
Stefan Hajnoczi (1):
hpet: increase spelling precision
Thomas Huth (1):
get_maintainer.pl: Remove the --git-chief-penguins option
lijun (1):
usb: delete redundant brackets in usb_host_handle_control()
zhanghailiang (2):
target-s390x: fix possible out of bounds read
vt82c686: fix coverity warning about out-of-bounds write
backends/rng-random.c | 6 +--
configure | 2 +-
hw/block/pflash_cfi02.c | 1 +
hw/core/qdev.c | 4 +-
hw/i386/acpi-build.c | 22 ++++++----
hw/isa/vt82c686.c | 41 ++++++++----------
hw/nvram/fw_cfg.c | 1 -
hw/timer/hpet.c | 2 +-
hw/tpm/tpm_passthrough.c | 4 +-
hw/usb/host-libusb.c | 2 +-
hw/virtio/virtio-bus.c | 2 +-
include/hw/virtio/virtio.h | 3 --
include/qemu/typedefs.h | 105 +++++++++++++++++++++------------------------
qapi-schema.json | 2 +-
qemu-char.c | 4 +-
qmp-commands.hx | 4 +-
scripts/get_maintainer.pl | 45 +------------------
target-s390x/helper.c | 6 +--
util/hbitmap.c | 4 +-
util/iov.c | 4 +-
util/uri.c | 94 +++++++++++++++++-----------------------
21 files changed, 143 insertions(+), 215 deletions(-)
^ permalink raw reply [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 02/20] target-s390x: fix possible out of bounds read Michael Tokarev
` (19 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Amos Kong, Michael Tokarev
From: Amos Kong <akong@redhat.com>
Lack of two closed bracket in json commands.
Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qmp-commands.hx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 718dd92..47bcf87 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3820,13 +3820,13 @@ Press left mouse button.
-> { "execute": "x-input-send-event",
"arguments": { "console": 0,
"events": [ { "type": "btn",
- "data" : { "down": true, "button": "Left" } } } }
+ "data" : { "down": true, "button": "Left" } } ] } }
<- { "return": {} }
-> { "execute": "x-input-send-event",
"arguments": { "console": 0,
"events": [ { "type": "btn",
- "data" : { "down": false, "button": "Left" } } } }
+ "data" : { "down": false, "button": "Left" } } ] } }
<- { "return": {} }
Example (2):
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 02/20] target-s390x: fix possible out of bounds read
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 03/20] acpi-build: adjust indention 8 -> 4 spaces Michael Tokarev
` (18 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, zhanghailiang
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
Array index starts at 0, so the valid index of ext_queue array,
io_queue array, mchk_queue array should be MAX_EXT_QUEUE - 1,
MAX_IO_QUEUE - 1, MAX_MCHK_QUEUE - 1.
The original checks missed the invalid bound value, which will lead
possible out of bounds read in the follow codes.
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
target-s390x/helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index 09aec7b..96a4f22 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -648,7 +648,7 @@ static void do_ext_interrupt(CPUS390XState *env)
cpu_abort(CPU(cpu), "Ext int w/o ext mask\n");
}
- if (env->ext_index < 0 || env->ext_index > MAX_EXT_QUEUE) {
+ if (env->ext_index < 0 || env->ext_index >= MAX_EXT_QUEUE) {
cpu_abort(CPU(cpu), "Ext queue overrun: %d\n", env->ext_index);
}
@@ -696,7 +696,7 @@ static void do_io_interrupt(CPUS390XState *env)
if (env->io_index[isc] < 0) {
continue;
}
- if (env->io_index[isc] > MAX_IO_QUEUE) {
+ if (env->io_index[isc] >= MAX_IO_QUEUE) {
cpu_abort(CPU(cpu), "I/O queue overrun for isc %d: %d\n",
isc, env->io_index[isc]);
}
@@ -754,7 +754,7 @@ static void do_mchk_interrupt(CPUS390XState *env)
cpu_abort(CPU(cpu), "Machine check w/o mchk mask\n");
}
- if (env->mchk_index < 0 || env->mchk_index > MAX_MCHK_QUEUE) {
+ if (env->mchk_index < 0 || env->mchk_index >= MAX_MCHK_QUEUE) {
cpu_abort(CPU(cpu), "Mchk queue overrun: %d\n", env->mchk_index);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 03/20] acpi-build: adjust indention 8 -> 4 spaces
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 02/20] target-s390x: fix possible out of bounds read Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 04/20] acpi-build: Make DPRINTF working for acpi-build Michael Tokarev
` (17 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/i386/acpi-build.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b37a397..76dfaea 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -273,12 +273,12 @@ build_header(GArray *linker, GArray *table_data,
static inline GArray *build_alloc_array(void)
{
- return g_array_new(false, true /* clear */, 1);
+ return g_array_new(false, true /* clear */, 1);
}
static inline void build_free_array(GArray *array)
{
- g_array_free(array, true);
+ g_array_free(array, true);
}
static inline void build_prepend_byte(GArray *array, uint8_t val)
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 04/20] acpi-build: Make DPRINTF working for acpi-build
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (2 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 03/20] acpi-build: adjust indention 8 -> 4 spaces Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 05/20] virtio-bus: avoid breaking build when open DEBUG switch Michael Tokarev
` (16 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/i386/acpi-build.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 76dfaea..a4d0c0c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -68,6 +68,14 @@
#define ACPI_BUILD_TABLE_SIZE 0x20000
+/* #define DEBUG_ACPI_BUILD */
+#ifdef DEBUG_ACPI_BUILD
+#define ACPI_BUILD_DPRINTF(fmt, ...) \
+ do {printf("ACPI_BUILD: " fmt, ## __VA_ARGS__); } while (0)
+#else
+#define ACPI_BUILD_DPRINTF(fmt, ...)
+#endif
+
typedef struct AcpiCpuInfo {
DECLARE_BITMAP(found_cpus, ACPI_CPU_HOTPLUG_ID_LIMIT);
} AcpiCpuInfo;
@@ -246,8 +254,6 @@ static void acpi_get_pci_info(PcPciInfo *info)
#define ACPI_BUILD_APPNAME6 "BOCHS "
#define ACPI_BUILD_APPNAME4 "BXPC"
-#define ACPI_BUILD_DPRINTF(level, fmt, ...) do {} while (0)
-
#define ACPI_BUILD_TABLE_FILE "etc/acpi/tables"
#define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp"
#define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log"
@@ -1569,7 +1575,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
table_offsets = g_array_new(false, true /* clear */,
sizeof(uint32_t));
- ACPI_BUILD_DPRINTF(3, "init ACPI tables\n");
+ ACPI_BUILD_DPRINTF("init ACPI tables\n");
bios_linker_loader_alloc(tables->linker, ACPI_BUILD_TABLE_FILE,
64 /* Ensure FACS is aligned */,
@@ -1750,17 +1756,17 @@ void acpi_setup(PcGuestInfo *guest_info)
AcpiBuildState *build_state;
if (!guest_info->fw_cfg) {
- ACPI_BUILD_DPRINTF(3, "No fw cfg. Bailing out.\n");
+ ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
return;
}
if (!guest_info->has_acpi_build) {
- ACPI_BUILD_DPRINTF(3, "ACPI build disabled. Bailing out.\n");
+ ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
return;
}
if (!acpi_enabled) {
- ACPI_BUILD_DPRINTF(3, "ACPI disabled. Bailing out.\n");
+ ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n");
return;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 05/20] virtio-bus: avoid breaking build when open DEBUG switch
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (3 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 04/20] acpi-build: Make DPRINTF working for acpi-build Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 06/20] usb: delete redundant brackets in usb_host_handle_control() Michael Tokarev
` (15 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/virtio/virtio-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c
index eb77019..dfd2d8c 100644
--- a/hw/virtio/virtio-bus.c
+++ b/hw/virtio/virtio-bus.c
@@ -58,7 +58,7 @@ void virtio_bus_reset(VirtioBusState *bus)
{
VirtIODevice *vdev = virtio_bus_get_device(bus);
- DPRINTF("%s: reset device.\n", qbus->name);
+ DPRINTF("%s: reset device.\n", BUS(bus)->name);
if (vdev != NULL) {
virtio_reset(vdev);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 06/20] usb: delete redundant brackets in usb_host_handle_control()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (4 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 05/20] virtio-bus: avoid breaking build when open DEBUG switch Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 07/20] Drop superfluous conditionals around qemu_opts_del() Michael Tokarev
` (14 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, lijun
From: lijun <junmuzi@gmail.com>
When see usb codes, find there are redundant brackets !((udev->port->speedmask
& USB_SPEED_MASK_SUPER)) here. So delete it.
Signed-off-by: Jun Li <junmuzi@gmail.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/usb/host-libusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index a5f9dab..cff4f7c 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1237,7 +1237,7 @@ static void usb_host_handle_control(USBDevice *udev, USBPacket *p,
/* Fix up USB-3 ep0 maxpacket size to allow superspeed connected devices
* to work redirected to a not superspeed capable hcd */
if (udev->speed == USB_SPEED_SUPER &&
- !((udev->port->speedmask & USB_SPEED_MASK_SUPER)) &&
+ !(udev->port->speedmask & USB_SPEED_MASK_SUPER) &&
request == 0x8006 && value == 0x100 && index == 0) {
r->usb3ep0quirk = true;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 07/20] Drop superfluous conditionals around qemu_opts_del()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (5 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 06/20] usb: delete redundant brackets in usb_host_handle_control() Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 08/20] Drop superfluous conditionals around g_strdup() Michael Tokarev
` (13 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/core/qdev.c | 4 +---
qemu-char.c | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 35fd00d..901f289 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -1141,9 +1141,7 @@ static void device_finalize(Object *obj)
NamedGPIOList *ngl, *next;
DeviceState *dev = DEVICE(obj);
- if (dev->opts) {
- qemu_opts_del(dev->opts);
- }
+ qemu_opts_del(dev->opts);
QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {
QLIST_REMOVE(ngl, node);
diff --git a/qemu-char.c b/qemu-char.c
index a8b01da..ef84b53 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3825,9 +3825,7 @@ void qemu_chr_delete(CharDriverState *chr)
}
g_free(chr->filename);
g_free(chr->label);
- if (chr->opts) {
- qemu_opts_del(chr->opts);
- }
+ qemu_opts_del(chr->opts);
g_free(chr);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 08/20] Drop superfluous conditionals around g_strdup()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (6 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 07/20] Drop superfluous conditionals around qemu_opts_del() Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 09/20] util: Drop superfluous conditionals around g_free() Michael Tokarev
` (12 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
backends/rng-random.c | 6 +-----
hw/tpm/tpm_passthrough.c | 4 +---
util/uri.c | 43 +++++++++++++++++--------------------------
3 files changed, 19 insertions(+), 34 deletions(-)
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 601d9dc..4f85a8e 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -88,11 +88,7 @@ static char *rng_random_get_filename(Object *obj, Error **errp)
{
RndRandom *s = RNG_RANDOM(obj);
- if (s->filename) {
- return g_strdup(s->filename);
- }
-
- return NULL;
+ return g_strdup(s->filename);
}
static void rng_random_set_filename(Object *obj, const char *filename,
diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c
index 56e9e0f..2bf3c6f 100644
--- a/hw/tpm/tpm_passthrough.c
+++ b/hw/tpm/tpm_passthrough.c
@@ -400,9 +400,7 @@ static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb)
const char *value;
value = qemu_opt_get(opts, "cancel-path");
- if (value) {
- tb->cancel_path = g_strdup(value);
- }
+ tb->cancel_path = g_strdup(value);
value = qemu_opt_get(opts, "path");
if (!value) {
diff --git a/util/uri.c b/util/uri.c
index e348c17..bbf2832 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -1736,24 +1736,21 @@ uri_resolve(const char *uri, const char *base) {
goto done;
if ((ref->scheme == NULL) && (ref->path == NULL) &&
((ref->authority == NULL) && (ref->server == NULL))) {
- if (bas->scheme != NULL)
- res->scheme = g_strdup(bas->scheme);
+ res->scheme = g_strdup(bas->scheme);
if (bas->authority != NULL)
res->authority = g_strdup(bas->authority);
else if (bas->server != NULL) {
- res->server = g_strdup(bas->server);
- if (bas->user != NULL)
- res->user = g_strdup(bas->user);
- res->port = bas->port;
+ res->server = g_strdup(bas->server);
+ res->user = g_strdup(bas->user);
+ res->port = bas->port;
}
- if (bas->path != NULL)
- res->path = g_strdup(bas->path);
- if (ref->query != NULL)
+ res->path = g_strdup(bas->path);
+ if (ref->query != NULL) {
res->query = g_strdup (ref->query);
- else if (bas->query != NULL)
- res->query = g_strdup(bas->query);
- if (ref->fragment != NULL)
- res->fragment = g_strdup(ref->fragment);
+ } else {
+ res->query = g_strdup(bas->query);
+ }
+ res->fragment = g_strdup(ref->fragment);
goto step_7;
}
@@ -1767,13 +1764,10 @@ uri_resolve(const char *uri, const char *base) {
val = uri_to_string(ref);
goto done;
}
- if (bas->scheme != NULL)
- res->scheme = g_strdup(bas->scheme);
+ res->scheme = g_strdup(bas->scheme);
- if (ref->query != NULL)
- res->query = g_strdup(ref->query);
- if (ref->fragment != NULL)
- res->fragment = g_strdup(ref->fragment);
+ res->query = g_strdup(ref->query);
+ res->fragment = g_strdup(ref->fragment);
/*
* 4) If the authority component is defined, then the reference is a
@@ -1787,20 +1781,17 @@ uri_resolve(const char *uri, const char *base) {
res->authority = g_strdup(ref->authority);
else {
res->server = g_strdup(ref->server);
- if (ref->user != NULL)
- res->user = g_strdup(ref->user);
+ res->user = g_strdup(ref->user);
res->port = ref->port;
}
- if (ref->path != NULL)
- res->path = g_strdup(ref->path);
+ res->path = g_strdup(ref->path);
goto step_7;
}
if (bas->authority != NULL)
res->authority = g_strdup(bas->authority);
else if (bas->server != NULL) {
- res->server = g_strdup(bas->server);
- if (bas->user != NULL)
- res->user = g_strdup(bas->user);
+ res->server = g_strdup(bas->server);
+ res->user = g_strdup(bas->user);
res->port = bas->port;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 09/20] util: Drop superfluous conditionals around g_free()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (7 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 08/20] Drop superfluous conditionals around g_strdup() Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 10/20] util: Fuse g_malloc(); memset() into g_new0() Michael Tokarev
` (11 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
util/uri.c | 48 ++++++++++++++++++++++--------------------------
1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/util/uri.c b/util/uri.c
index bbf2832..01dc09e 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -225,7 +225,7 @@ rfc3986_parse_scheme(URI *uri, const char **str) {
while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
(*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
if (uri != NULL) {
- if (uri->scheme != NULL) g_free(uri->scheme);
+ g_free(uri->scheme);
uri->scheme = g_strndup(*str, cur - *str);
}
*str = cur;
@@ -262,8 +262,7 @@ rfc3986_parse_fragment(URI *uri, const char **str)
((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
NEXT(cur);
if (uri != NULL) {
- if (uri->fragment != NULL)
- g_free(uri->fragment);
+ g_free(uri->fragment);
if (uri->cleanup & 2)
uri->fragment = g_strndup(*str, cur - *str);
else
@@ -298,8 +297,7 @@ rfc3986_parse_query(URI *uri, const char **str)
((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
NEXT(cur);
if (uri != NULL) {
- if (uri->query != NULL)
- g_free (uri->query);
+ g_free(uri->query);
uri->query = g_strndup (*str, cur - *str);
}
*str = cur;
@@ -360,7 +358,7 @@ rfc3986_parse_user_info(URI *uri, const char **str)
NEXT(cur);
if (*cur == '@') {
if (uri != NULL) {
- if (uri->user != NULL) g_free(uri->user);
+ g_free(uri->user);
if (uri->cleanup & 2)
uri->user = g_strndup(*str, cur - *str);
else
@@ -473,9 +471,9 @@ not_ipv4:
NEXT(cur);
found:
if (uri != NULL) {
- if (uri->authority != NULL) g_free(uri->authority);
+ g_free(uri->authority);
uri->authority = NULL;
- if (uri->server != NULL) g_free(uri->server);
+ g_free(uri->server);
if (cur != host) {
if (uri->cleanup & 2)
uri->server = g_strndup(host, cur - host);
@@ -585,7 +583,7 @@ rfc3986_parse_path_ab_empty(URI *uri, const char **str)
if (ret != 0) return(ret);
}
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
if (*str != cur) {
if (uri->cleanup & 2)
uri->path = g_strndup(*str, cur - *str);
@@ -631,7 +629,7 @@ rfc3986_parse_path_absolute(URI *uri, const char **str)
}
}
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
if (cur != *str) {
if (uri->cleanup & 2)
uri->path = g_strndup(*str, cur - *str);
@@ -673,7 +671,7 @@ rfc3986_parse_path_rootless(URI *uri, const char **str)
if (ret != 0) return(ret);
}
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
if (cur != *str) {
if (uri->cleanup & 2)
uri->path = g_strndup(*str, cur - *str);
@@ -715,7 +713,7 @@ rfc3986_parse_path_no_scheme(URI *uri, const char **str)
if (ret != 0) return(ret);
}
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
if (cur != *str) {
if (uri->cleanup & 2)
uri->path = g_strndup(*str, cur - *str);
@@ -769,7 +767,7 @@ rfc3986_parse_hier_part(URI *uri, const char **str)
} else {
/* path-empty is effectively empty */
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
uri->path = NULL;
}
}
@@ -812,7 +810,7 @@ rfc3986_parse_relative_ref(URI *uri, const char *str) {
} else {
/* path-empty is effectively empty */
if (uri != NULL) {
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
uri->path = NULL;
}
}
@@ -1285,21 +1283,21 @@ static void
uri_clean(URI *uri) {
if (uri == NULL) return;
- if (uri->scheme != NULL) g_free(uri->scheme);
+ g_free(uri->scheme);
uri->scheme = NULL;
- if (uri->server != NULL) g_free(uri->server);
+ g_free(uri->server);
uri->server = NULL;
- if (uri->user != NULL) g_free(uri->user);
+ g_free(uri->user);
uri->user = NULL;
- if (uri->path != NULL) g_free(uri->path);
+ g_free(uri->path);
uri->path = NULL;
- if (uri->fragment != NULL) g_free(uri->fragment);
+ g_free(uri->fragment);
uri->fragment = NULL;
- if (uri->opaque != NULL) g_free(uri->opaque);
+ g_free(uri->opaque);
uri->opaque = NULL;
- if (uri->authority != NULL) g_free(uri->authority);
+ g_free(uri->authority);
uri->authority = NULL;
- if (uri->query != NULL) g_free(uri->query);
+ g_free(uri->query);
uri->query = NULL;
}
@@ -1711,10 +1709,8 @@ uri_resolve(const char *uri, const char *base) {
/*
* the base fragment must be ignored
*/
- if (bas->fragment != NULL) {
- g_free(bas->fragment);
- bas->fragment = NULL;
- }
+ g_free(bas->fragment);
+ bas->fragment = NULL;
val = uri_to_string(bas);
goto done;
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 10/20] util: Fuse g_malloc(); memset() into g_new0()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (8 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 09/20] util: Drop superfluous conditionals around g_free() Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 11/20] util: Use g_new() & friends where that makes obvious sense Michael Tokarev
` (10 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
util/uri.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/util/uri.c b/util/uri.c
index 01dc09e..918d235 100644
--- a/util/uri.c
+++ b/util/uri.c
@@ -1004,8 +1004,7 @@ URI *
uri_new(void) {
URI *ret;
- ret = (URI *) g_malloc(sizeof(URI));
- memset(ret, 0, sizeof(URI));
+ ret = g_new0(URI, 1);
return(ret);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 11/20] util: Use g_new() & friends where that makes obvious sense
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (9 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 10/20] util: Fuse g_malloc(); memset() into g_new0() Michael Tokarev
@ 2014-12-11 18:15 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 12/20] configure: Replace which(1) with "has" Michael Tokarev
` (9 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:15 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Markus Armbruster
From: Markus Armbruster <armbru@redhat.com>
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer,
for two reasons. One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.
This commit only touches allocations with size arguments of the form
sizeof(T).
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
util/hbitmap.c | 4 ++--
util/iov.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/hbitmap.c b/util/hbitmap.c
index b3060e6..ab13971 100644
--- a/util/hbitmap.c
+++ b/util/hbitmap.c
@@ -373,7 +373,7 @@ void hbitmap_free(HBitmap *hb)
HBitmap *hbitmap_alloc(uint64_t size, int granularity)
{
- HBitmap *hb = g_malloc0(sizeof (struct HBitmap));
+ HBitmap *hb = g_new0(struct HBitmap, 1);
unsigned i;
assert(granularity >= 0 && granularity < 64);
@@ -384,7 +384,7 @@ HBitmap *hbitmap_alloc(uint64_t size, int granularity)
hb->granularity = granularity;
for (i = HBITMAP_LEVELS; i-- > 0; ) {
size = MAX((size + BITS_PER_LONG - 1) >> BITS_PER_LEVEL, 1);
- hb->levels[i] = g_malloc0(size * sizeof(unsigned long));
+ hb->levels[i] = g_new0(unsigned long, size);
}
/* We necessarily have free bits in level 0 due to the definition
diff --git a/util/iov.c b/util/iov.c
index 24566c8..2fb18e6 100644
--- a/util/iov.c
+++ b/util/iov.c
@@ -253,7 +253,7 @@ unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt,
void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint)
{
- qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec));
+ qiov->iov = g_new(struct iovec, alloc_hint);
qiov->niov = 0;
qiov->nalloc = alloc_hint;
qiov->size = 0;
@@ -277,7 +277,7 @@ void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len)
if (qiov->niov == qiov->nalloc) {
qiov->nalloc = 2 * qiov->nalloc + 1;
- qiov->iov = g_realloc(qiov->iov, qiov->nalloc * sizeof(struct iovec));
+ qiov->iov = g_renew(struct iovec, qiov->iov, qiov->nalloc);
}
qiov->iov[qiov->niov].iov_base = base;
qiov->iov[qiov->niov].iov_len = len;
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 12/20] configure: Replace which(1) with "has"
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (10 preceding siblings ...)
2014-12-11 18:15 ` [Qemu-devel] [PULL 11/20] util: Use g_new() & friends where that makes obvious sense Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 13/20] get_maintainer.pl: Remove the --git-chief-penguins option Michael Tokarev
` (8 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Fam Zheng
From: Fam Zheng <famz@redhat.com>
Using "has" is more slick because which(1) is not always there.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 47048f0..cae588c 100755
--- a/configure
+++ b/configure
@@ -2727,7 +2727,7 @@ fi
if test "$modules" = yes; then
shacmd_probe="sha1sum sha1 shasum"
for c in $shacmd_probe; do
- if which $c >/dev/null 2>&1; then
+ if has $c; then
shacmd="$c"
break
fi
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 13/20] get_maintainer.pl: Remove the --git-chief-penguins option
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (11 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 12/20] configure: Replace which(1) with "has" Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 14/20] fw_cfg: remove superfluous blank line Michael Tokarev
` (7 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Thomas Huth
From: Thomas Huth <thuth@linux.vnet.ibm.com>
Linus likely does not want to get e-mails about QEMU, so let's
just remove this option.
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
scripts/get_maintainer.pl | 45 +--------------------------------------------
1 file changed, 1 insertion(+), 44 deletions(-)
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index af68c6c..f39630e 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -23,7 +23,6 @@ my $email_usename = 1;
my $email_maintainer = 1;
my $email_list = 1;
my $email_subscriber_list = 0;
-my $email_git_penguin_chiefs = 0;
my $email_git = 0;
my $email_git_all_signature_types = 0;
my $email_git_blame = 0;
@@ -60,21 +59,6 @@ my $exit = 0;
my %commit_author_hash;
my %commit_signer_hash;
-my @penguin_chief = ();
-push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
-#Andrew wants in on most everything - 2009/01/14
-#push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
-
-my @penguin_chief_names = ();
-foreach my $chief (@penguin_chief) {
- if ($chief =~ m/^(.*):(.*)/) {
- my $chief_name = $1;
- my $chief_addr = $2;
- push(@penguin_chief_names, $chief_name);
- }
-}
-my $penguin_chiefs = "\(" . join("|", @penguin_chief_names) . "\)";
-
# Signature types of people who are either
# a) responsible for the code in question, or
# b) familiar enough with it to give relevant feedback
@@ -187,7 +171,6 @@ if (!GetOptions(
'git-blame!' => \$email_git_blame,
'git-blame-signatures!' => \$email_git_blame_signatures,
'git-fallback!' => \$email_git_fallback,
- 'git-chief-penguins!' => \$email_git_penguin_chiefs,
'git-min-signatures=i' => \$email_git_min_signatures,
'git-max-maintainers=i' => \$email_git_max_maintainers,
'git-min-percent=i' => \$email_git_min_percent,
@@ -256,7 +239,7 @@ if ($sections) {
if ($email &&
($email_maintainer + $email_list + $email_subscriber_list +
- $email_git + $email_git_penguin_chiefs + $email_git_blame) == 0) {
+ $email_git + $email_git_blame) == 0) {
die "$P: Please select at least 1 email option\n";
}
@@ -671,19 +654,6 @@ sub get_maintainers {
}
}
- foreach my $chief (@penguin_chief) {
- if ($chief =~ m/^(.*):(.*)/) {
- my $email_address;
-
- $email_address = format_email($1, $2, $email_usename);
- if ($email_git_penguin_chiefs) {
- push(@email_to, [$email_address, 'chief penguin']);
- } else {
- @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
- }
- }
- }
-
foreach my $email (@file_emails) {
my ($name, $address) = parse_email($email);
@@ -740,7 +710,6 @@ MAINTAINER field selection options:
--git-all-signature-types => include signers regardless of signature type
or use only ${signature_pattern} signers (default: $email_git_all_signature_types)
--git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
- --git-chief-penguins => include ${penguin_chiefs}
--git-min-signatures => number of signatures required (default: $email_git_min_signatures)
--git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
--git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
@@ -1281,10 +1250,6 @@ sub vcs_find_signers {
save_commits_by_author(@lines) if ($interactive);
save_commits_by_signer(@lines) if ($interactive);
- if (!$email_git_penguin_chiefs) {
- @signatures = grep(!/${penguin_chiefs}/i, @signatures);
- }
-
my ($types_ref, $signers_ref) = extract_formatted_signatures(@signatures);
return ($commits, @$signers_ref);
@@ -1296,10 +1261,6 @@ sub vcs_find_author {
@lines = &{$VCS_cmds{"execute_cmd"}}($cmd);
- if (!$email_git_penguin_chiefs) {
- @lines = grep(!/${penguin_chiefs}/i, @lines);
- }
-
return @lines if !@lines;
my @authors = ();
@@ -1925,10 +1886,6 @@ sub vcs_file_blame {
@lines = &{$VCS_cmds{"execute_cmd"}}($cmd);
- if (!$email_git_penguin_chiefs) {
- @lines = grep(!/${penguin_chiefs}/i, @lines);
- }
-
last if !@lines;
my @authors = ();
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 14/20] fw_cfg: remove superfluous blank line
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (12 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 13/20] get_maintainer.pl: Remove the --git-chief-penguins option Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 15/20] qapi-schema: fix typo about change-vnc-password Michael Tokarev
` (6 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/nvram/fw_cfg.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index a7122ee..c4b78ed 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -621,7 +621,6 @@ static void fw_cfg_realize(DeviceState *dev, Error **errp)
FWCfgState *s = FW_CFG(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
-
if (s->ctl_iobase + 1 == s->data_iobase) {
sysbus_add_io(sbd, s->ctl_iobase, &s->comb_iomem);
} else {
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 15/20] qapi-schema: fix typo about change-vnc-password
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (13 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 14/20] fw_cfg: remove superfluous blank line Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 16/20] virtio: remove useless declaration of virtio_net_init() Michael Tokarev
` (5 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev
From: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
qapi-schema.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 9ffdcf8..563b4ad 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -1533,7 +1533,7 @@
#
# Change the VNC server password.
#
-# @target: the new password to use with VNC authentication
+# @password: the new password to use with VNC authentication
#
# Since: 1.1
#
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 16/20] virtio: remove useless declaration of virtio_net_init()
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (14 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 15/20] qapi-schema: fix typo about change-vnc-password Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 17/20] vt82c686: fix coverity warning about out-of-bounds write Michael Tokarev
` (4 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Gonglei, Michael Tokarev, Markus Armbruster
From: Gonglei <arei.gonglei@huawei.com>
commit 1773d9ee (virtio-net: cleanup: init and exit function)
removed the definition of virtio_net_init(), but didn't remove its
declaration in the header. Clean that up.
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/hw/virtio/virtio.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 0726d76..f24997d 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -230,9 +230,6 @@ int virtio_set_features(VirtIODevice *vdev, uint32_t val);
/* Base devices. */
typedef struct VirtIOBlkConf VirtIOBlkConf;
struct virtio_net_conf;
-VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
- struct virtio_net_conf *net,
- uint32_t host_features);
typedef struct virtio_serial_conf virtio_serial_conf;
typedef struct VirtIOSCSIConf VirtIOSCSIConf;
typedef struct VirtIORNGConf VirtIORNGConf;
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 17/20] vt82c686: fix coverity warning about out-of-bounds write
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (15 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 16/20] virtio: remove useless declaration of virtio_net_init() Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 18/20] pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category Michael Tokarev
` (3 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, zhanghailiang
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
Refactor superio_ioport_writeb to fix the out of bounds write warning.
In addition, fix two typos: s/chage/change/
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/isa/vt82c686.c | 41 +++++++++++++++++++----------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index e0c235c..223b947 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -50,13 +50,13 @@ typedef struct VT82C686BState {
static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data,
unsigned size)
{
- int can_write;
SuperIOConfig *superio_conf = opaque;
DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
if (addr == 0x3f0) {
superio_conf->index = data & 0xff;
} else {
+ bool can_write = true;
/* 0x3f1 */
switch (superio_conf->index) {
case 0x00 ... 0xdf:
@@ -68,30 +68,27 @@ static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data,
case 0xf7:
case 0xf9 ... 0xfb:
case 0xfd ... 0xff:
- can_write = 0;
+ can_write = false;
break;
- default:
- can_write = 1;
-
- if (can_write) {
- switch (superio_conf->index) {
- case 0xe7:
- if ((data & 0xff) != 0xfe) {
- DPRINTF("chage uart 1 base. unsupported yet\n");
- }
- break;
- case 0xe8:
- if ((data & 0xff) != 0xbe) {
- DPRINTF("chage uart 2 base. unsupported yet\n");
- }
- break;
-
- default:
- superio_conf->config[superio_conf->index] = data & 0xff;
- }
+ case 0xe7:
+ if ((data & 0xff) != 0xfe) {
+ DPRINTF("change uart 1 base. unsupported yet\n");
+ can_write = false;
+ }
+ break;
+ case 0xe8:
+ if ((data & 0xff) != 0xbe) {
+ DPRINTF("change uart 2 base. unsupported yet\n");
+ can_write = false;
}
+ break;
+ default:
+ break;
+
+ }
+ if (can_write) {
+ superio_conf->config[superio_conf->index] = data & 0xff;
}
- superio_conf->config[superio_conf->index] = data & 0xff;
}
}
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 18/20] pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (16 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 17/20] vt82c686: fix coverity warning about out-of-bounds write Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 19/20] hpet: increase spelling precision Michael Tokarev
` (2 subsequent siblings)
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Antony Pavlov
From: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/block/pflash_cfi02.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 8513a17..389b4aa 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -744,6 +744,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data)
dc->realize = pflash_cfi02_realize;
dc->props = pflash_cfi02_properties;
+ set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
}
static const TypeInfo pflash_cfi02_info = {
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 19/20] hpet: increase spelling precision
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (17 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 18/20] pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 20/20] Sort include/qemu/typedefs.h Michael Tokarev
2014-12-11 21:46 ` [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Peter Maydell
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Stefan Hajnoczi
From: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
hw/timer/hpet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index e160e8f..d8bc231 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -1,5 +1,5 @@
/*
- * High Precisition Event Timer emulation
+ * High Precision Event Timer emulation
*
* Copyright (c) 2007 Alexander Graf
* Copyright (c) 2008 IBM Corporation
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [Qemu-devel] [PULL 20/20] Sort include/qemu/typedefs.h
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (18 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 19/20] hpet: increase spelling precision Michael Tokarev
@ 2014-12-11 18:16 ` Michael Tokarev
2014-12-11 21:46 ` [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Peter Maydell
20 siblings, 0 replies; 22+ messages in thread
From: Michael Tokarev @ 2014-12-11 18:16 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, Michael Tokarev, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Mainly to make it less likely to conflict during merges.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
include/qemu/typedefs.h | 105 +++++++++++++++++++++++-------------------------
1 file changed, 50 insertions(+), 55 deletions(-)
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 3475177..57ff47f 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -3,80 +3,75 @@
/* A load of opaque types so that device init declarations don't have to
pull in all the real definitions. */
-typedef struct QEMUTimer QEMUTimer;
-typedef struct QEMUTimerListGroup QEMUTimerListGroup;
-typedef struct QEMUFile QEMUFile;
-typedef struct QEMUBH QEMUBH;
-
-typedef struct AioContext AioContext;
-
-typedef struct Visitor Visitor;
-
struct Monitor;
-typedef struct Monitor Monitor;
-typedef struct MigrationParams MigrationParams;
-
-typedef struct Property Property;
-typedef struct PropertyInfo PropertyInfo;
-typedef struct CompatProperty CompatProperty;
-typedef struct DeviceState DeviceState;
-typedef struct BusState BusState;
-typedef struct BusClass BusClass;
+/* Please keep this list in alphabetical order */
+typedef struct AdapterInfo AdapterInfo;
typedef struct AddressSpace AddressSpace;
-typedef struct MemoryRegion MemoryRegion;
-typedef struct MemoryRegionSection MemoryRegionSection;
-typedef struct MemoryListener MemoryListener;
-
-typedef struct MemoryMappingList MemoryMappingList;
-
-typedef struct QEMUMachine QEMUMachine;
-typedef struct MachineClass MachineClass;
-typedef struct MachineState MachineState;
-typedef struct NICInfo NICInfo;
-typedef struct HCIInfo HCIInfo;
+typedef struct AioContext AioContext;
typedef struct AudioState AudioState;
typedef struct BlockBackend BlockBackend;
typedef struct BlockDriverState BlockDriverState;
-typedef struct DriveInfo DriveInfo;
-typedef struct DisplayState DisplayState;
+typedef struct BusClass BusClass;
+typedef struct BusState BusState;
+typedef struct CharDriverState CharDriverState;
+typedef struct CompatProperty CompatProperty;
+typedef struct DeviceState DeviceState;
typedef struct DisplayChangeListener DisplayChangeListener;
+typedef struct DisplayState DisplayState;
typedef struct DisplaySurface DisplaySurface;
-typedef struct PixelFormat PixelFormat;
-typedef struct QemuConsole QemuConsole;
-typedef struct CharDriverState CharDriverState;
-typedef struct MACAddr MACAddr;
-typedef struct NetClientState NetClientState;
+typedef struct DriveInfo DriveInfo;
+typedef struct EventNotifier EventNotifier;
+typedef struct FWCfgState FWCfgState;
+typedef struct HCIInfo HCIInfo;
typedef struct I2CBus I2CBus;
+typedef struct I2SCodec I2SCodec;
typedef struct ISABus ISABus;
typedef struct ISADevice ISADevice;
-typedef struct SMBusDevice SMBusDevice;
-typedef struct PCIHostState PCIHostState;
-typedef struct PCIExpressHost PCIExpressHost;
+typedef struct MACAddr MACAddr;
+typedef struct MachineClass MachineClass;
+typedef struct MachineState MachineState;
+typedef struct MemoryListener MemoryListener;
+typedef struct MemoryMappingList MemoryMappingList;
+typedef struct MemoryRegion MemoryRegion;
+typedef struct MemoryRegionSection MemoryRegionSection;
+typedef struct MigrationParams MigrationParams;
+typedef struct Monitor Monitor;
+typedef struct MouseTransformInfo MouseTransformInfo;
+typedef struct MSIMessage MSIMessage;
+typedef struct NetClientState NetClientState;
+typedef struct NICInfo NICInfo;
+typedef struct PcGuestInfo PcGuestInfo;
+typedef struct PCIBridge PCIBridge;
typedef struct PCIBus PCIBus;
typedef struct PCIDevice PCIDevice;
-typedef struct PCIExpressDevice PCIExpressDevice;
-typedef struct PCIBridge PCIBridge;
-typedef struct PCIEAERMsg PCIEAERMsg;
-typedef struct PCIEAERLog PCIEAERLog;
typedef struct PCIEAERErr PCIEAERErr;
+typedef struct PCIEAERLog PCIEAERLog;
+typedef struct PCIEAERMsg PCIEAERMsg;
typedef struct PCIEPort PCIEPort;
typedef struct PCIESlot PCIESlot;
-typedef struct MSIMessage MSIMessage;
-typedef struct SerialState SerialState;
+typedef struct PCIExpressDevice PCIExpressDevice;
+typedef struct PCIExpressHost PCIExpressHost;
+typedef struct PCIHostState PCIHostState;
typedef struct PCMCIACardState PCMCIACardState;
-typedef struct MouseTransformInfo MouseTransformInfo;
-typedef struct uWireSlave uWireSlave;
-typedef struct I2SCodec I2SCodec;
-typedef struct SSIBus SSIBus;
-typedef struct EventNotifier EventNotifier;
-typedef struct VirtIODevice VirtIODevice;
+typedef struct PixelFormat PixelFormat;
+typedef struct PropertyInfo PropertyInfo;
+typedef struct Property Property;
+typedef struct QEMUBH QEMUBH;
+typedef struct QemuConsole QemuConsole;
+typedef struct QEMUFile QEMUFile;
+typedef struct QEMUMachine QEMUMachine;
typedef struct QEMUSGList QEMUSGList;
typedef struct QEMUSizedBuffer QEMUSizedBuffer;
-typedef struct SHPCDevice SHPCDevice;
-typedef struct FWCfgState FWCfgState;
-typedef struct PcGuestInfo PcGuestInfo;
+typedef struct QEMUTimerListGroup QEMUTimerListGroup;
+typedef struct QEMUTimer QEMUTimer;
typedef struct Range Range;
-typedef struct AdapterInfo AdapterInfo;
+typedef struct SerialState SerialState;
+typedef struct SHPCDevice SHPCDevice;
+typedef struct SMBusDevice SMBusDevice;
+typedef struct SSIBus SSIBus;
+typedef struct uWireSlave uWireSlave;
+typedef struct VirtIODevice VirtIODevice;
+typedef struct Visitor Visitor;
#endif /* QEMU_TYPEDEFS_H */
--
2.1.3
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
` (19 preceding siblings ...)
2014-12-11 18:16 ` [Qemu-devel] [PULL 20/20] Sort include/qemu/typedefs.h Michael Tokarev
@ 2014-12-11 21:46 ` Peter Maydell
20 siblings, 0 replies; 22+ messages in thread
From: Peter Maydell @ 2014-12-11 21:46 UTC (permalink / raw)
To: Michael Tokarev; +Cc: QEMU Trivial, QEMU Developers
On 11 December 2014 at 18:15, Michael Tokarev <mjt@tls.msk.ru> wrote:
> This is the first pull request from trivial-patches tree for
> quite some time, I was quiet during 2.2 freeze period and here's
> what has been accumulated during the freeze.
>
> As usual, there are many small things from Gonglei and some good
> stuff from Marcus, plus some more from others, all pretty much
> trivial.
>
> Please pull.
>
> Thanks,
>
> /mjt
>
> The following changes since commit 7fb8da2b8861795e0013e6ee97acd0363d868a35:
>
> Open 2.3 development tree (2014-12-09 21:48:34 +0000)
>
> are available in the git repository at:
>
> git://git.corpit.ru/qemu.git tags/pull-trivial-patches-2014-12-11
>
> for you to fetch changes up to 64baadc2726ae929660dd0c61a42e8d9f3ba1828:
>
> Sort include/qemu/typedefs.h (2014-12-11 21:00:30 +0300)
>
> ----------------------------------------------------------------
> trivial patches for 2014-12-11
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2014-12-11 21:47 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 18:15 [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 02/20] target-s390x: fix possible out of bounds read Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 03/20] acpi-build: adjust indention 8 -> 4 spaces Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 04/20] acpi-build: Make DPRINTF working for acpi-build Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 05/20] virtio-bus: avoid breaking build when open DEBUG switch Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 06/20] usb: delete redundant brackets in usb_host_handle_control() Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 07/20] Drop superfluous conditionals around qemu_opts_del() Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 08/20] Drop superfluous conditionals around g_strdup() Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 09/20] util: Drop superfluous conditionals around g_free() Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 10/20] util: Fuse g_malloc(); memset() into g_new0() Michael Tokarev
2014-12-11 18:15 ` [Qemu-devel] [PULL 11/20] util: Use g_new() & friends where that makes obvious sense Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 12/20] configure: Replace which(1) with "has" Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 13/20] get_maintainer.pl: Remove the --git-chief-penguins option Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 14/20] fw_cfg: remove superfluous blank line Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 15/20] qapi-schema: fix typo about change-vnc-password Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 16/20] virtio: remove useless declaration of virtio_net_init() Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 17/20] vt82c686: fix coverity warning about out-of-bounds write Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 18/20] pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 19/20] hpet: increase spelling precision Michael Tokarev
2014-12-11 18:16 ` [Qemu-devel] [PULL 20/20] Sort include/qemu/typedefs.h Michael Tokarev
2014-12-11 21:46 ` [Qemu-devel] [PULL 00/20] Trivial patches for 2014-12-11 Peter Maydell
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).