Trivial patches for 2014-12-11
[Qemu-devel] [PULL 05/20] virtio-bus: avoid breaking build when open DEBUG switch
In reply to Michael TokarevFrom: Gonglei <[email protected]>
--- hw/virtio/virtio-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio-bus.c +1 -1
@@ -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); }
Signature · 1 line
2.1.3
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(-)
[Qemu-devel] [PULL 04/20] acpi-build: Make DPRINTF working for acpi-build
From: Gonglei <[email protected]>
--- hw/i386/acpi-build.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
hw/i386/acpi-build.c +12 -6
@@ -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 ; }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 03/20] acpi-build: adjust indention 8 -> 4 spaces
In reply to Michael TokarevFrom: Gonglei <[email protected]>
--- hw/i386/acpi-build.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/acpi-build.c +2 -2
@@ -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)
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 02/20] target-s390x: fix possible out of bounds read
In reply to Michael TokarevFrom: zhanghailiang <[email protected]>
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.
--- target-s390x/helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target-s390x/helper.c +3 -3
@@ -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); }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 06/20] usb: delete redundant brackets in usb_host_handle_control()
In reply to Michael TokarevFrom: lijun <[email protected]>
When see usb codes, find there are redundant brackets !((udev->port->speedmask & USB_SPEED_MASK_SUPER)) here. So delete it.
--- hw/usb/host-libusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/usb/host-libusb.c +1 -1
@@ -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; }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 15/20] qapi-schema: fix typo about change-vnc-password
In reply to Michael TokarevFrom: Gonglei <[email protected]>
--- qapi-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qapi-schema.json +1 -1
@@ -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 #
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 07/20] Drop superfluous conditionals around qemu_opts_del()
In reply to Michael TokarevFrom: Markus Armbruster <[email protected]>
--- hw/core/qdev.c | 4 +--- qemu-char.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-)
hw/core/qdev.c +1 -3
@@ -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);
qemu-char.c +1 -3
@@ -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); }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 19/20] hpet: increase spelling precision
In reply to Michael TokarevFrom: Stefan Hajnoczi <[email protected]>
--- hw/timer/hpet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/timer/hpet.c +1 -1
@@ -1,5 +1,5 @@/* -* High Precisition Event Timer emulation +* High Precision Event Timer emulation * * Copyright (c) 2007 Alexander Graf * Copyright (c) 2008 IBM Corporation
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 01/20] qmp: fix typo in input-send-event examples
In reply to Michael TokarevFrom: Amos Kong <[email protected]>
Lack of two closed bracket in json commands.
--- qmp-commands.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qmp-commands.hx +2 -2
@@ -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):
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 14/20] fw_cfg: remove superfluous blank line
In reply to Michael TokarevFrom: Gonglei <[email protected]>
--- hw/nvram/fw_cfg.c | 1 - 1 file changed, 1 deletion(-)
hw/nvram/fw_cfg.c +0 -1
@@ -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 {
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 13/20] get_maintainer.pl: Remove the --git-chief-penguins option
In reply to Michael TokarevFrom: Thomas Huth <[email protected]>
Linus likely does not want to get e-mails about QEMU, so let's just remove this option.
--- scripts/get_maintainer.pl | 45 +-------------------------------------------- 1 file changed, 1 insertion(+), 44 deletions(-)
scripts/get_maintainer.pl +1 -44
@@ -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 = ();
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 11/20] util: Use g_new() & friends where that makes obvious sense
In reply to Michael TokarevFrom: Markus Armbruster <[email protected]>
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).
--- util/hbitmap.c | 4 ++-- util/iov.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
util/hbitmap.c +2 -2
@@ -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
util/iov.c +2 -2
@@ -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;
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 18/20] pflash_cfi02.c: associate "cfi.pflash02" to "Storage devices" category
In reply to Michael TokarevFrom: Antony Pavlov <[email protected]>
--- hw/block/pflash_cfi02.c | 1 + 1 file changed, 1 insertion(+)
hw/block/pflash_cfi02.c +1 -0
@@ -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 = {
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 16/20] virtio: remove useless declaration of virtio_net_init()
In reply to Michael TokarevFrom: Gonglei <[email protected]>
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.
--- include/hw/virtio/virtio.h | 3 --- 1 file changed, 3 deletions(-)
include/hw/virtio/virtio.h +0 -3
@@ -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 ;
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 10/20] util: Fuse g_malloc(); memset() into g_new0()
In reply to Michael TokarevFrom: Markus Armbruster <[email protected]>
--- util/uri.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
util/uri.c +1 -2
@@ -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); }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 12/20] configure: Replace which(1) with "has"
In reply to Michael TokarevFrom: Fam Zheng <[email protected]>
Using "has" is more slick because which(1) is not always there.
--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
@@ -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
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 17/20] vt82c686: fix coverity warning about out-of-bounds write
In reply to Michael TokarevFrom: zhanghailiang <[email protected]>
Refactor superio_ioport_writeb to fix the out of bounds write warning.
In addition, fix two typos: s/chage/change/
--- hw/isa/vt82c686.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-)
hw/isa/vt82c686.c +19 -22
@@ -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 ; } }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 08/20] Drop superfluous conditionals around g_strdup()
In reply to Michael TokarevFrom: Markus Armbruster <[email protected]>
--- backends/rng-random.c | 6 +----- hw/tpm/tpm_passthrough.c | 4 +--- util/uri.c | 43 +++++++++++++++++-------------------------- 3 files changed, 19 insertions(+), 34 deletions(-)
backends/rng-random.c +1 -5
@@ -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,
hw/tpm/tpm_passthrough.c +1 -3
@@ -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) {
util/uri.c +17 -26
74 lines not on this page · raw message
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 09/20] util: Drop superfluous conditionals around g_free()
In reply to Michael TokarevFrom: Markus Armbruster <[email protected]>
--- util/uri.c | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-)
util/uri.c +22 -26
@@ -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; }
Signature · 1 line
2.1.3
[Qemu-devel] [PULL 20/20] Sort include/qemu/typedefs.h
In reply to Michael TokarevFrom: "Dr. David Alan Gilbert" <[email protected]>
Mainly to make it less likely to conflict during merges.
--- include/qemu/typedefs.h | 105 +++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 55 deletions(-)
include/qemu/typedefs.h +50 -55
@@ -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 */
Signature · 1 line
2.1.3
Peter Maydell
AppliedQuoted 22 lines · 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.gittags/pull-trivial-patches-2014-12-11
Quoted 8 lines
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