qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 0/7] Convert to realize and cleanup
@ 2017-06-09 11:24 Mao Zhongyi
  2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 1/7] pci: Clean up error checking in pci_add_capability() Mao Zhongyi
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Mao Zhongyi @ 2017-06-09 11:24 UTC (permalink / raw)
  To: qemu-devel
  Cc: mst, marcel, armbru, dmitry, jasowang, kraxel, alex.williamson,
	pbonzini, rth, ehabkost

This series mainly implements the conversions of pci-bridge devices
i82801b11, io3130_upstream/downstream and so on to realize(). Naturally
part of error messages need to be converted to Error, then propagate
to its callers via the argument errp, bonus clean related minor flaw
up. In short, the former patches are prerequisites for latter ones.

v4:
* patch4: changed from patch 5 in v3. use a elegant way to check
          the error, like 

			 function(...);
          if (function succeeded) {
             /* non-error code path here */
             foo = bar;
          }
          
          or

			 function(...);
          if (function succeeded) {
              /* non-error code path here */
              foo = bar;
          } else {
              /* error path here */
              return ret;
          }

          for readability, instead of this:

          function(...)
          if (function failed) {
              return ...;  /* or: "goto out" */
          }

          /* non-error code path here */
          foo = bar;             [Eduardo Habkost]

          meanwhile, split previous patch4 out. [Michael S. Tsirkin]
* patch5: a new patch that replace pci_add_capability() with
          pci_add_capability2(). [Eduardo Habkost]

v3:
* patch2: explain the specified means of the return value, also
          improve the commit message. [Marcel Apfelbaum]
* patch3: simplify the subject and commit message, fix another 
          wrong assert. [Marcel Apfelbaum]
* patch4: adjust the subject.
* patch5: fix a wrong optimization for errp. [Eduardo Habkost]
* patch7: a new patch that converts shpc_init() to Error in order 
          to propagate the error better.                                                                                                                                                              
v2:
* patch1: subject and commit message was rewrited by markus.
* patch2: comment was added to pci_add_capability2().
* patch3: a new patch that fix the wrong return value judgment condition.
* patch4: a new patch that fix code style problems.
* patch5: add an errp argument for pci_add_capability to pass
          error for its callers.
* patch6: convert part of pci-bridge device to realize.

v1:
* patch1: fix unreasonable return value check

Cc: mst@redhat.com
Cc: marcel@redhat.com
Cc: armbru@redhat.com
Cc: dmitry@daynix.com
Cc: jasowang@redhat.com
Cc: kraxel@redhat.com
Cc: alex.williamson@redhat.com
Cc: pbonzini@redhat.com
Cc: rth@twiddle.net
Cc: ehabkost@redhat.com

Mao Zhongyi (7):
  pci: Clean up error checking in pci_add_capability()
  pci: Add comment for pci_add_capability2()
  pci: Fix the return value checking
  pci: Make errp the last parameter of pci_add_capability()
  pci: Replace pci_add_capability() with pci_add_capability2()
  pci: Convert to realize
  pci: Convert shpc_init() to Error

 hw/i386/amd_iommu.c                | 24 +++++++++++++++++-------
 hw/net/e1000e.c                    | 30 ++++++++++++++++++------------
 hw/net/eepro100.c                  | 20 +++++++++++++++-----
 hw/pci-bridge/i82801b11.c          | 12 ++++++------
 hw/pci-bridge/pci_bridge_dev.c     | 21 ++++++++-------------
 hw/pci-bridge/pcie_root_port.c     | 15 ++++++---------
 hw/pci-bridge/xio3130_downstream.c | 20 +++++++++-----------
 hw/pci-bridge/xio3130_upstream.c   | 20 +++++++++-----------
 hw/pci/pci.c                       | 24 ++++--------------------
 hw/pci/pci_bridge.c                |  8 ++++++--
 hw/pci/pcie.c                      | 15 +++++++++++----
 hw/pci/shpc.c                      | 12 +++++++-----
 hw/pci/slotid_cap.c                | 12 ++++++++----
 hw/usb/hcd-xhci.c                  |  2 +-
 hw/vfio/pci.c                      |  9 ++++++---
 hw/virtio/virtio-pci.c             | 12 ++++++++----
 include/hw/pci/pci.h               |  2 --
 include/hw/pci/pci_bridge.h        |  3 ++-
 include/hw/pci/pcie.h              |  3 ++-
 include/hw/pci/shpc.h              |  3 ++-
 include/hw/pci/slotid_cap.h        |  3 ++-
 21 files changed, 147 insertions(+), 123 deletions(-)

-- 
2.9.3

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-06-12  1:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 11:24 [Qemu-devel] [PATCH v4 0/7] Convert to realize and cleanup Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 1/7] pci: Clean up error checking in pci_add_capability() Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 2/7] pci: Add comment for pci_add_capability2() Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 3/7] pci: Fix the return value checking Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 4/7] pci: Make errp the last parameter of pci_add_capability() Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 5/7] pci: Replace pci_add_capability() with pci_add_capability2() Mao Zhongyi
2017-06-09 13:53   ` Eduardo Habkost
2017-06-12  1:34     ` Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 6/7] pci: Convert to realize Mao Zhongyi
2017-06-09 11:24 ` [Qemu-devel] [PATCH v4 7/7] pci: Convert shpc_init() to Error Mao Zhongyi

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).