qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e9d635: net: Clarify early exit condition


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e9d635: net: Clarify early exit condition
Date: Thu, 28 Jan 2021 06:05:01 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: e9d635ea1809a6e114c33413c359abbb88a35737
      
https://github.com/qemu/qemu/commit/e9d635ea1809a6e114c33413c359abbb88a35737
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M net/net.c

  Log Message:
  -----------
  net: Clarify early exit condition

On first glance, the loop in qmp_query_rx_filter() has early return
paths that could leak any allocation of filter_list from a previous
iteration.  But on closer inspection, it is obvious that all of the
early exits are guarded by has_name, and that the bulk of the loop
body can be executed at most once if the user is filtering by name,
thus, any early exit coincides with an empty list.  Add asserts to
make this obvious.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210113221013.390592-2-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: 240ee8bd31f7ff7407197588ae800ff554758b4d
      
https://github.com/qemu/qemu/commit/240ee8bd31f7ff7407197588ae800ff554758b4d
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M hw/core/machine-qmp-cmds.c
    M monitor/qmp-cmds-control.c

  Log Message:
  -----------
  qapi: A couple more QAPI_LIST_PREPEND() stragglers

Commit 54aa3de72e switched multiple sites to use QAPI_LIST_PREPEND
instead of open-coding, but missed a couple of spots.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210113221013.390592-3-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: dc13f40c6ba291e31d09053815c230ed88c8921f
      
https://github.com/qemu/qemu/commit/dc13f40c6ba291e31d09053815c230ed88c8921f
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M include/qapi/util.h

  Log Message:
  -----------
  qapi: Introduce QAPI_LIST_APPEND

Similar to the existing QAPI_LIST_PREPEND, but designed for use where
we want to preserve insertion order.  Callers will be added in
upcoming patches.  Note the difference in signature: PREPEND takes
List*, APPEND takes List**.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210113221013.390592-4-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: c3033fd372fdaf5b89190136a74b3d78880b85d6
      
https://github.com/qemu/qemu/commit/c3033fd372fdaf5b89190136a74b3d78880b85d6
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M backends/hostmem.c
    M block/dirty-bitmap.c
    M block/export/export.c
    M block/qapi.c
    M block/qcow2-bitmap.c
    M block/vmdk.c
    M blockdev.c
    M crypto/block-luks.c
    M hw/acpi/cpu.c
    M hw/acpi/memory_hotplug.c
    M iothread.c
    M job-qmp.c
    M monitor/hmp-cmds.c
    M qemu-img.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M scsi/pr-manager.c
    M target/i386/cpu.c
    M tests/test-qobject-output-visitor.c
    M tests/test-string-output-visitor.c

  Log Message:
  -----------
  qapi: Use QAPI_LIST_APPEND in trivial cases

The easiest spots to use QAPI_LIST_APPEND are where we already have an
obvious pointer to the tail of a list.  While at it, consistently use
the variable name 'tail' for that purpose.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210113221013.390592-5-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: 95b3a8c8a82a34ca874ac0d4a9bbbdb38034acf3
      
https://github.com/qemu/qemu/commit/95b3a8c8a82a34ca874ac0d4a9bbbdb38034acf3
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M block/gluster.c
    M block/qapi.c
    M dump/dump.c
    M hw/core/machine-qmp-cmds.c
    M hw/mem/memory-device.c
    M hw/pci/pci.c
    M migration/migration.c
    M monitor/hmp-cmds.c
    M net/net.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M softmmu/tpm.c
    M ui/spice-core.c

  Log Message:
  -----------
  qapi: More complex uses of QAPI_LIST_APPEND

These cases require a bit more thought to review; in each case, the
code was appending to a list, but not with a FOOList **tail variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210113221013.390592-6-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Flawed change to qmp_guest_network_get_interfaces() dropped]
Signed-off-by: Markus Armbruster <armbru@redhat.com>


  Commit: d2e0ec5e79154ceb80d02ababf56516111c1592e
      
https://github.com/qemu/qemu/commit/d2e0ec5e79154ceb80d02ababf56516111c1592e
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-01-28 (Thu, 28 Jan 2021)

  Changed paths:
    M backends/hostmem.c
    M block/dirty-bitmap.c
    M block/export/export.c
    M block/gluster.c
    M block/qapi.c
    M block/qcow2-bitmap.c
    M block/vmdk.c
    M blockdev.c
    M crypto/block-luks.c
    M dump/dump.c
    M hw/acpi/cpu.c
    M hw/acpi/memory_hotplug.c
    M hw/core/machine-qmp-cmds.c
    M hw/mem/memory-device.c
    M hw/pci/pci.c
    M include/qapi/util.h
    M iothread.c
    M job-qmp.c
    M migration/migration.c
    M monitor/hmp-cmds.c
    M monitor/qmp-cmds-control.c
    M net/net.c
    M qemu-img.c
    M qga/commands-posix.c
    M qga/commands-win32.c
    M scsi/pr-manager.c
    M softmmu/tpm.c
    M target/i386/cpu.c
    M tests/test-qobject-output-visitor.c
    M tests/test-string-output-visitor.c
    M ui/spice-core.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-01-28' into 
staging

QAPI patches patches for 2021-01-28

# gpg: Signature made Thu 28 Jan 2021 07:10:21 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2021-01-28:
  qapi: More complex uses of QAPI_LIST_APPEND
  qapi: Use QAPI_LIST_APPEND in trivial cases
  qapi: Introduce QAPI_LIST_APPEND
  qapi: A couple more QAPI_LIST_PREPEND() stragglers
  net: Clarify early exit condition

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/0bcd12fb1513...d2e0ec5e7915



reply via email to

[Prev in Thread] Current Thread [Next in Thread]