[Qemu-devel] [PATCH] isa/pc87312: use device_class_set_parent_realize

2019-08-15 Thread Mao Zhongyi
Signed-off-by: Mao Zhongyi --- hw/isa/pc87312.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index 85dbc94439..e95176c148 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -336,8 +336,8 @@ static void pc87312_class_init

[Qemu-devel] [PATCH] util: remove the obsolete non-blocking connect

2017-06-14 Thread Mao Zhongyi
il.com Cc: jc...@redhat.com Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: qemu-bl...@nongnu.org Cc: sheep...@lists.wpkg.org Suggested-by: Daniel P. Berrange Signed-off-by: Cao jin Signed-off-by: Mao Zhongyi --- This patch was

Re: [Qemu-devel] [PATCH] util: remove the obsolete non-blocking connect

2017-06-15 Thread Mao Zhongyi
On 06/15/2017 03:34 PM, Juan Quintela wrote: Mao Zhongyi wrote: From: Cao jin The non-blocking connect mechanism is obsolete, and it doesn't work well in inet connection, because it will call getaddrinfo first and getaddrinfo will blocks on DNS lookups. Since commit e65c67e4 &

Re: [Qemu-devel] [PATCH] util: remove the obsolete non-blocking connect

2017-06-15 Thread Mao Zhongyi
On 06/16/2017 08:21 AM, Fam Zheng wrote: On Thu, 06/15 11:08, Mao Zhongyi wrote: From: Cao jin The non-blocking connect mechanism is obsolete, and it doesn't work well in inet connection, because it will call getaddrinfo first and getaddrinfo will blocks on DNS lookups. Since c

[Qemu-devel] [PATCH v2] util: remove the obsolete non-blocking connect

2017-06-16 Thread Mao Zhongyi
ed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrange --- v2: 1. block/ssh.c is not compiled in v1 which leads to no error reported when I run make & make check, although I make a mistake in block/ssh.c, because the package libssh2-devel

[Qemu-devel] [PATCH v3] util: remove the obsolete non-blocking connect

2017-06-16 Thread Mao Zhongyi
: Cao jin Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrange --- v3: 1. fix the mistake that adds a unmodified file '--help' [Fam Zheng] v2: 1. block/ssh.c is not compiled in v1 which leads to no error reported when I run make & make c

Re: [Qemu-devel] [PATCH v5 6/9] pci: Convert to realize

2017-06-19 Thread Mao Zhongyi
Hi, Marcel On 06/19/2017 07:42 PM, Marcel Apfelbaum wrote: On 12/06/2017 16:48, Mao Zhongyi wrote: The pci-birdge device i82801b11 It is a dmi-to-pci brigde and io3130_upstream/downstream You forgot to mention the pcie_root_port. still implements the old PCIDeviceClass .init() through

Re: [Qemu-devel] [PATCH v5 7/9] pci: Convert shpc_init() to Error

2017-06-19 Thread Mao Zhongyi
Hi, Marcel On 06/19/2017 08:05 PM, Marcel Apfelbaum wrote: On 12/06/2017 16:48, Mao Zhongyi wrote: In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com

[Qemu-devel] [PATCH v6 1/9] pci: Clean up error checking in pci_add_capability()

2017-06-20 Thread Mao Zhongyi
: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

[Qemu-devel] [PATCH v6 5/9] pci: Replace pci_add_capability2() with pci_add_capability()

2017-06-20 Thread Mao Zhongyi
Suggested-by: Eduardo Habkost Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/i386/kvm/pci-assign.c | 14 +++--- hw/ide/ich.c | 2 +- hw/pci/msi.c | 2 +- hw/pci/msix.c| 2 +- hw/pci/pci.c | 20 ++-- hw/

[Qemu-devel] [PATCH v6 7/9] pci: Convert shpc_init() to Error

2017-06-20 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/pci_bridge_dev.c | 21 - hw/pci/shpc.c

[Qemu-devel] [PATCH v6 2/9] pci: Add comment for pci_add_capability2()

2017-06-20 Thread Mao Zhongyi
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw

[Qemu-devel] [PATCH v6 3/9] pci: Fix the wrong assertion.

2017-06-20 Thread Mao Zhongyi
pci_add_capability returns a strictly positive value on success, correct asserts. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/e1000e.c | 2 +- hw/net

[Qemu-devel] [PATCH v6 0/9] Convert to realize and cleanup

2017-06-20 Thread Mao Zhongyi
.@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Mao Zhongyi (9): pci: Clean up error checking in pci_add_capability() pci: Add comment for pci_add_capability2() pci: Fix the wrong assertion. pci: Make errp t

[Qemu-devel] [PATCH v6 8/9] i386/kvm/pci-assign: Fix return type of verify_irqchip_kernel()

2017-06-20 Thread Mao Zhongyi
value is worth. So fix the return type to avoid it. Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/kvm/pci-assign.c | 18 ++ 1 file changed, 6 insertions

[Qemu-devel] [PATCH v6 9/9] i386/kvm/pci-assign: Use errp directly rather than local_err

2017-06-20 Thread Mao Zhongyi
...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/kvm/pci-assign.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm

[Qemu-devel] [PATCH v6 4/9] pci: Make errp the last parameter of pci_add_capability()

2017-06-20 Thread Mao Zhongyi
redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 30 ++ hw/net/eepro100.c

[Qemu-devel] [PATCH v6 6/9] pci: Convert to realize

2017-06-20 Thread Mao Zhongyi
Convert i82801b11, io3130_upstream, io3130_downstream and pcie_root_port devices to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge/pcie_root_port.c | 18

Re: [Qemu-devel] [PATCH v5 7/9] pci: Convert shpc_init() to Error

2017-06-21 Thread Mao Zhongyi
On 06/21/2017 03:39 PM, Marcel Apfelbaum wrote: On 20/06/2017 6:51, Mao Zhongyi wrote: Hi, Marcel On 06/19/2017 08:05 PM, Marcel Apfelbaum wrote: On 12/06/2017 16:48, Mao Zhongyi wrote: In order to propagate error message better, convert shpc_init() to Error also convert the

Re: [Qemu-devel] [PATCH v5 7/9] pci: Convert shpc_init() to Error

2017-06-21 Thread Mao Zhongyi
On 06/22/2017 02:29 PM, Marcel Apfelbaum wrote: On 22/06/2017 6:47, Mao Zhongyi wrote: On 06/21/2017 03:39 PM, Marcel Apfelbaum wrote: On 20/06/2017 6:51, Mao Zhongyi wrote: Hi, Marcel On 06/19/2017 08:05 PM, Marcel Apfelbaum wrote: On 12/06/2017 16:48, Mao Zhongyi wrote: In order to

[Qemu-devel] [PATCH v7 7/9] pci: Convert shpc_init() to Error

2017-06-22 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- v7: * drop the !local_err assert is really not appropriate, now revert it

Re: [Qemu-devel] [PATCH v7 7/9] pci: Convert shpc_init() to Error

2017-06-25 Thread Mao Zhongyi
On 06/23/2017 05:56 PM, Marcel Apfelbaum wrote: On 22/06/2017 11:14, Mao Zhongyi wrote: In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by

Re: [Qemu-devel] [PATCH v4 1/4] net/socket: Drop the odd 'default' case and comment

2017-06-25 Thread Mao Zhongyi
Hi, Markus On 06/23/2017 09:36 PM, Markus Armbruster wrote: Mao Zhongyi writes: In the net_socket_fd_init(), the 'default' case and comment is odd. If @fd really was a pty, getsockopt() would fail with ENOTSOCK. If @fd was a socket, but neither SOCK_DGRAM nor SOCK_STREAM. It sho

Re: [Qemu-devel] [PATCH v4 2/4] net/net: Convert parse_host_port() to Error

2017-06-25 Thread Mao Zhongyi
Hi, Markus On 06/23/2017 10:21 PM, Markus Armbruster wrote: Markus Armbruster writes: Mao Zhongyi writes: Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 2

[Qemu-devel] [PATCH v5 1/4] net/socket: Don't treat odd socket type as SOCK_STREAM

2017-06-26 Thread Mao Zhongyi
redhat.com Suggested-by: Markus Armbruster Suggested-by: Daniel P. Berrange Signed-off-by: Mao Zhongyi Reviewed-by: Markus Armbruster --- net/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/socket.c b/net/socket.c index dcae1ae..53765bd 100644 --- a/ne

[Qemu-devel] [PATCH v5 0/4] Improve error reporting

2017-06-26 Thread Mao Zhongyi
to Error. * PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an error when it fails. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Mao Zhongyi (4): net/socket: Don&#

[Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Error

2017-06-26 Thread Mao Zhongyi
Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 3 ++- net/net.c | 22 +- net/socket.c | 19 ++- 3 files changed

[Qemu-devel] [PATCH v5 4/4] net/socket: Improve -net socket error reporting

2017-06-26 Thread Mao Zhongyi
t the same time, add many explicit error handling message when it fails. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- net/socket.c | 95 ++-- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/net/

[Qemu-devel] [PATCH v5 2/4] net/socket: Convert error message to Error

2017-06-26 Thread Mao Zhongyi
Currently, net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() use the function such as fprintf(), perror() to report an error message. Now, convert these functions to Error. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- net/socket.c

[Qemu-devel] [PATCH v7 0/9] Convert to realize and cleanup

2017-06-26 Thread Mao Zhongyi
n value check Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Mao Zhongyi (9): pci: Clean up error checking in pci_ad

[Qemu-devel] [PATCH v7 4/9] pci: Make errp the last parameter of pci_add_capability()

2017-06-26 Thread Mao Zhongyi
redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 30 ++ hw/net/eepro100.c

[Qemu-devel] [PATCH v7 1/9] pci: Clean up error checking in pci_add_capability()

2017-06-26 Thread Mao Zhongyi
: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

[Qemu-devel] [PATCH v7 7/9] pci: Convert shpc_init() to Error

2017-06-26 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci-bridge/pci_bridge_dev.c | 14

[Qemu-devel] [PATCH v7 8/9] i386/kvm/pci-assign: Fix return type of verify_irqchip_kernel()

2017-06-26 Thread Mao Zhongyi
value is worth. So fix the return type to avoid it. Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/i386/kvm/pci-assign.c | 18

[Qemu-devel] [PATCH v7 3/9] pci: Fix the wrong assertion.

2017-06-26 Thread Mao Zhongyi
pci_add_capability returns a strictly positive value on success, correct asserts. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/net

[Qemu-devel] [PATCH v7 6/9] pci: Convert to realize

2017-06-26 Thread Mao Zhongyi
Convert i82801b11, io3130_upstream, io3130_downstream and pcie_root_port devices to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge

[Qemu-devel] [PATCH v7 5/9] pci: Replace pci_add_capability2() with pci_add_capability()

2017-06-26 Thread Mao Zhongyi
Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Suggested-by: Eduardo Habkost Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbau

[Qemu-devel] [PATCH v7 9/9] i386/kvm/pci-assign: Use errp directly rather than local_err

2017-06-26 Thread Mao Zhongyi
...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Cc: mar...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/i386/kvm/pci-assign.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/hw/i386

[Qemu-devel] [PATCH v7 2/9] pci: Add comment for pci_add_capability2()

2017-06-26 Thread Mao Zhongyi
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 ++ 1 file

Re: [Qemu-devel] [PATCH v5 2/4] net/socket: Convert error message to Error

2017-06-27 Thread Mao Zhongyi
Hi, Markus On 06/27/2017 03:43 PM, Markus Armbruster wrote: Suggest "net/socket: Convert several helper functions to Error". OK, I see. Mao Zhongyi writes: Currently, net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() use the function such

Re: [Qemu-devel] [PATCH v5 3/4] net/net: Convert parse_host_port() to Error

2017-06-27 Thread Mao Zhongyi
Hi, Markus On 06/27/2017 04:04 PM, Markus Armbruster wrote: Mao Zhongyi writes: Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 3 ++- net/net.c | 22

[Qemu-devel] [PATCH 1/2] net/socket: convert non-blocking connect to use QIOChannel

2017-04-18 Thread Mao Zhongyi
The non-blocking connect mechanism doesn't work well in net connection, it still blocks on DNS lookups. So it is obsolete. Supersede it with QIOchannel. Signed-off-by: Mao Zhongyi --- The test steps like this: $ qemu-system-x86_64 -net nic -net socket,listen=:1234 ~/img/tes

[Qemu-devel] [PATCH 2/2] net/socket: Improve -net socket error reporting

2017-04-18 Thread Mao Zhongyi
uld not be initialized Convert net_init_socket() to Error to get rid of the unwanted second error message. Signed-off-by: Mao Zhongyi --- net/socket.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/socket.c b/net/socket.c index 1886f98..85ad9cd 100644 --- a/ne

[Qemu-devel] [PATCH v2 0/6] Convert to realize and cleanup

2017-06-02 Thread Mao Zhongyi
to pass error for its callers. * patch6: convert part of pci-bridge device to realize. v1: * patch1: fix unreasonable return value check Mao Zhongyi (6): pci: Clean up error checking in pci_add_capability() pci: Add comment for pci_add_capability2() pci: Fix the wrong return value

[Qemu-devel] [PATCH v2 1/6] pci: Clean up error checking in pci_add_capability()

2017-06-02 Thread Mao Zhongyi
...@redhat.com Signed-off-by: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability

[Qemu-devel] [PATCH v2 2/6] pci: Add comment for pci_add_capability2()

2017-06-02 Thread Mao Zhongyi
Add a comment for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/pci/pci.c | 4 1 file

[Qemu-devel] [PATCH v2 6/6] pci: Convert to realize

2017-06-02 Thread Mao Zhongyi
: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge/pcie_root_port.c | 15 ++- hw/pci-bridge/xio3130_downstream.c | 20 +--- hw/pci-bridge/xio3130_upstream.c | 20 +--- hw/pci

[Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-02 Thread Mao Zhongyi
m its callers. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: alex.william...@redhat.com Cc: mar...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/vfio/pci.c | 2 +- 3 files changed, 3 insertions(

[Qemu-devel] [PATCH v2 4/6] net/eepro100: Fixed code style

2017-06-02 Thread Mao Zhongyi
It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw

[Qemu-devel] [PATCH v2 5/6] pci: Make errp the last parameter of pci_add_capability()

2017-06-02 Thread Mao Zhongyi
nix.com Cc: jasow...@redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 7 ++- hw/net/eepro100.c | 17 - hw/pci-bridge

Re: [Qemu-devel] [PATCH v2 5/6] pci: Make errp the last parameter of pci_add_capability()

2017-06-04 Thread Mao Zhongyi
Hi, Eduardo On 06/03/2017 01:45 AM, Eduardo Habkost wrote: On Fri, Jun 02, 2017 at 03:54:41PM +0800, Mao Zhongyi wrote: Add Error argument for pci_add_capability() to leverage the errp to pass info on errors. This way is helpful for its callers to make a better error handling when moving to

Re: [Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-05 Thread Mao Zhongyi
Hi, Marcel On 06/06/2017 12:20 AM, Marcel Apfelbaum wrote: On 02/06/2017 10:54, Mao Zhongyi wrote: On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of pci_add_capabi

Re: [Qemu-devel] [PATCH v2 2/6] pci: Add comment for pci_add_capability2()

2017-06-05 Thread Mao Zhongyi
Hi, Marcel On 06/05/2017 09:34 PM, Marcel Apfelbaum wrote: On 02/06/2017 10:54, Mao Zhongyi wrote: Add a comment for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm

[Qemu-devel] [PATCH v3 5/7] pci: Make errp the last parameter of pci_add_capability()

2017-06-06 Thread Mao Zhongyi
nix.com Cc: jasow...@redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 7 ++- hw/net/eepro100.c | 20 +++- hw/

[Qemu-devel] [PATCH v3 6/7] pci: Convert to realize

2017-06-06 Thread Mao Zhongyi
: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge/pcie_root_port.c | 15 ++- hw/pci-bridge/xio3130_downstream.c | 20 +--- hw/pci-bridge/xio3130_upstream.c | 20 +--- hw/pci

[Qemu-devel] [PATCH v3 1/7] pci: Clean up error checking in pci_add_capability()

2017-06-06 Thread Mao Zhongyi
: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

[Qemu-devel] [PATCH v3 2/7] pci: Add comment for pci_add_capability2()

2017-06-06 Thread Mao Zhongyi
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/pci/pci.c | 6 ++ 1 file

[Qemu-devel] [PATCH v3 3/7] pci: Fix the return value checking

2017-06-06 Thread Mao Zhongyi
pci_add_capability returns a strictly positive value on success, correct asserts. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/usb

[Qemu-devel] [PATCH v3 4/7] net/eepro100: Fix code style

2017-06-06 Thread Mao Zhongyi
It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw

[Qemu-devel] [PATCH v3 7/7] pci: Convert shpc_init() to Error

2017-06-06 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/pci_bridge_dev.c | 21 - hw/pci/shpc.c

[Qemu-devel] [PATCH v3 0/7] Convert to realize and cleanup

2017-06-06 Thread Mao Zhongyi
pass error for its callers. * patch6: convert part of pci-bridge device to realize. v1: * patch1: fix unreasonable return value check 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

Re: [Qemu-devel] [PATCH v3 4/7] net/eepro100: Fix code style

2017-06-06 Thread Mao Zhongyi
Hi, Michael On 06/06/2017 11:31 PM, Michael S. Tsirkin wrote: On Tue, Jun 06, 2017 at 07:26:29PM +0800, Mao Zhongyi wrote: It reports a code style problem(ERROR: "foo * bar" should be "foo *bar") when running checkpatch.pl. So fix it to conform to the coding standards. Cc:

Re: [Qemu-devel] [PATCH v2 0/6] Convert to realize and cleanup

2017-06-06 Thread Mao Zhongyi
! OK, I see. Thanks for your kind reminder. Mao On Fri, Jun 02, 2017 at 03:54:36PM +0800, Mao Zhongyi wrote: 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

Re: [Qemu-devel] [PATCH v3 5/7] pci: Make errp the last parameter of pci_add_capability()

2017-06-06 Thread Mao Zhongyi
Hi, Eduardo On 06/06/2017 10:52 PM, Eduardo Habkost wrote: On Tue, Jun 06, 2017 at 07:26:30PM +0800, Mao Zhongyi wrote: Add Error argument for pci_add_capability() to leverage the errp to pass info on errors. This way is helpful for its callers to make a better error handling when moving to

Re: [Qemu-devel] [PATCH v3 5/7] pci: Make errp the last parameter of pci_add_capability()

2017-06-07 Thread Mao Zhongyi
Hi, Markus On 06/07/2017 03:05 PM, Markus Armbruster wrote: Mao Zhongyi writes: Hi, Eduardo On 06/06/2017 10:52 PM, Eduardo Habkost wrote: On Tue, Jun 06, 2017 at 07:26:30PM +0800, Mao Zhongyi wrote: Add Error argument for pci_add_capability() to leverage the errp to pass info on errors

[Qemu-devel] [PATCH] util/qemu-sockets: Drop unused helper socket_address_to_string()

2017-06-07 Thread Mao Zhongyi
Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 15 --- util/qemu-sockets.c| 34 -- 2 files changed, 49 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 7abffc4..8eb0172 100644 --- a/include/qemu/sockets.h

[Qemu-devel] [PATCH v3 1/4] net/socket: Drop the odd 'default' case and comment

2017-06-09 Thread Mao Zhongyi
something like SOCK_RAW, it should be explicitly handled. So, drop the 'default' case since it is broken already. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Suggested-by: Daniel P. Berrange Signed-off-by: M

[Qemu-devel] [PATCH v3 0/4] Improve error reporting

2017-06-09 Thread Mao Zhongyi
error. Now, fix it to set an error when it fails. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Mao Zhongyi (4): net/socket: Drop the odd 'default' case and comment net/net: Convert parse_host_port() to Error net

[Qemu-devel] [PATCH v3 2/4] net/net: Convert parse_host_port() to Error

2017-06-09 Thread Mao Zhongyi
Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 2 +- net/net.c | 21 - net/socket.c | 37

[Qemu-devel] [PATCH v3 3/4] net/socket: Convert error report message to Error

2017-06-09 Thread Mao Zhongyi
Currently, net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() use the function such as fprintf(), perror() to report an error message. Now, convert these functions to Error. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Signed-off-by: Mao

[Qemu-devel] [PATCH v3 4/4] net/socket: Improve -net socket error reporting

2017-06-09 Thread Mao Zhongyi
same time, add many explicit error handling message when it fails. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- net/socket.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/net/socket.c b/net/socket.c ind

[Qemu-devel] [PATCH v4 3/7] pci: Fix the return value checking

2017-06-09 Thread Mao Zhongyi
pci_add_capability returns a strictly positive value on success, correct asserts. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/usb

[Qemu-devel] [PATCH v4 2/7] pci: Add comment for pci_add_capability2()

2017-06-09 Thread Mao Zhongyi
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/pci/pci.c | 6 ++ 1 file

[Qemu-devel] [PATCH v4 6/7] pci: Convert to realize

2017-06-09 Thread Mao Zhongyi
: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge/pcie_root_port.c | 15 ++- hw/pci-bridge/xio3130_downstream.c | 20 +--- hw/pci-bridge/xio3130_upstream.c | 20 +--- hw/pci

[Qemu-devel] [PATCH v4 5/7] pci: Replace pci_add_capability() with pci_add_capability2()

2017-06-09 Thread Mao Zhongyi
Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Suggested-by: Eduardo Habkost Signed-off-by: Mao Zhongyi --- hw/i386/amd_iommu

[Qemu-devel] [PATCH v4 0/7] Convert to realize and cleanup

2017-06-09 Thread Mao Zhongyi
om Cc: arm...@redhat.com Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Mao Zhongyi (7): pci: Clean up error checking in pci_add_capability() pci: Add comment for pci_add_c

[Qemu-devel] [PATCH v4 7/7] pci: Convert shpc_init() to Error

2017-06-09 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/pci_bridge_dev.c | 21 - hw/pci/shpc.c

[Qemu-devel] [PATCH v4 4/7] pci: Make errp the last parameter of pci_add_capability()

2017-06-09 Thread Mao Zhongyi
redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 30 ++ hw/net/eepro100.c | 18 ++ hw/

[Qemu-devel] [PATCH v4 1/7] pci: Clean up error checking in pci_add_capability()

2017-06-09 Thread Mao Zhongyi
: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

Re: [Qemu-devel] [PATCH v4 5/7] pci: Replace pci_add_capability() with pci_add_capability2()

2017-06-11 Thread Mao Zhongyi
Hi, Eduardo On 06/09/2017 09:53 PM, Eduardo Habkost wrote: On Fri, Jun 09, 2017 at 07:24:40PM +0800, Mao Zhongyi wrote: After the patch 'Make errp the last parameter of pci_add_capability()', pci_add_capability() and pci_add_capability2() now do exactly the same. So drop t

Re: [Qemu-devel] [PATCH v3 1/4] net/socket: Drop the odd 'default' case and comment

2017-06-11 Thread Mao Zhongyi
Hi, Markus On 06/09/2017 09:22 PM, Markus Armbruster wrote: Mao Zhongyi writes: In the net_socket_fd_init(), the 'default' case and comment is odd. If @fd really was a pty, getsockopt() would fail with ENOTSOCK. If @fd was a socket, but neither SOCK_DGRAM nor SOCK_STREAM. It sho

[Qemu-devel] [PATCH v5 2/9] pci: Add comment for pci_add_capability2()

2017-06-12 Thread Mao Zhongyi
Comments for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/pci/pci.c | 6 ++ 1 file

[Qemu-devel] [PATCH v5 8/9] i386/kvm/pci-assign: Fix return type of verify_irqchip_kernel()

2017-06-12 Thread Mao Zhongyi
value is worth. So fix the return type to avoid it. Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/kvm/pci-assign.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions

[Qemu-devel] [PATCH v5 1/9] pci: Clean up error checking in pci_add_capability()

2017-06-12 Thread Mao Zhongyi
: Mao Zhongyi Reviewed-by: Marcel Apfelbaum --- hw/pci/pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 98ccc27..53566b8 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2270,12 +2270,8 @@ int pci_add_capability(PCIDevice *pdev, uint8_t

[Qemu-devel] [PATCH v5 7/9] pci: Convert shpc_init() to Error

2017-06-12 Thread Mao Zhongyi
In order to propagate error message better, convert shpc_init() to Error also convert the pci_bridge_dev_initfn() to realize. Cc: m...@redhat.com Cc: mar...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/pci_bridge_dev.c | 21 - hw/pci/shpc.c

[Qemu-devel] [PATCH v5 0/9] Convert to realize and cleanup

2017-06-12 Thread Mao Zhongyi
daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Mao Zhongyi (9): pci: Clean up error checking in pci_add_capability() pci: Add comment for pci_add_capability2() pci: Fix the return value

[Qemu-devel] [PATCH v5 6/9] pci: Convert to realize

2017-06-12 Thread Mao Zhongyi
: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/pci-bridge/i82801b11.c | 11 +-- hw/pci-bridge/pcie_root_port.c | 15 ++- hw/pci-bridge/xio3130_downstream.c | 20 +--- hw/pci-bridge/xio3130_upstream.c | 20 +--- hw/pci

[Qemu-devel] [PATCH v5 4/9] pci: Make errp the last parameter of pci_add_capability()

2017-06-12 Thread Mao Zhongyi
redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/amd_iommu.c | 24 +--- hw/net/e1000e.c | 30 ++ hw/net/eepro100.c | 18 ++ hw/

[Qemu-devel] [PATCH v5 5/9] pci: Replace pci_add_capability2() with pci_add_capability()

2017-06-12 Thread Mao Zhongyi
Cc: pbonz...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: mar...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Suggested-by: Eduardo Habkost Signed-off-by: Mao Zhongyi --- hw/i386/kvm/pci-ass

[Qemu-devel] [PATCH v5 9/9] i386/kvm/pci-assign: Use errp directly rather than local_err

2017-06-12 Thread Mao Zhongyi
...@redhat.com Cc: r...@twiddle.net Cc: ehabk...@redhat.com Cc: m...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/i386/kvm/pci-assign.c | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index

[Qemu-devel] [PATCH v5 3/9] pci: Fix the return value checking

2017-06-12 Thread Mao Zhongyi
pci_add_capability returns a strictly positive value on success, correct asserts. Cc: dmi...@daynix.com Cc: jasow...@redhat.com Cc: kra...@redhat.com Cc: alex.william...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/e1000e.c | 2 +- hw/net/eepro100.c | 2 +- hw/usb

[Qemu-devel] [PATCH v4 1/4] net/socket: Drop the odd 'default' case and comment

2017-06-12 Thread Mao Zhongyi
something like SOCK_RAW, it should be explicitly handled. So, drop the 'default' case since it is broken already. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Cc: arm...@redhat.com Suggested-by: Markus Armbruster Suggested-by: Daniel P. Berrange Signed-off-by: M

[Qemu-devel] [PATCH v4 0/4] Improve error reporting

2017-06-12 Thread Mao Zhongyi
dhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Mao Zhongyi (4): net/socket: Drop the odd 'default' case and comment net/net: Convert parse_host_port() to Error net/socket: Convert error report message to Error net/socket: Improve -net socket error reporting include/qem

[Qemu-devel] [PATCH v4 4/4] net/socket: Improve -net socket error reporting

2017-06-12 Thread Mao Zhongyi
same time, add many explicit error handling message when it fails. Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- net/socket.c | 37 ++--- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/net/socket.c b/net/socket.c ind

[Qemu-devel] [PATCH v4 2/4] net/net: Convert parse_host_port() to Error

2017-06-12 Thread Mao Zhongyi
Cc: berra...@redhat.com Cc: kra...@redhat.com Cc: pbonz...@redhat.com Cc: jasow...@redhat.com Cc: arm...@redhat.com Signed-off-by: Mao Zhongyi --- include/qemu/sockets.h | 2 +- net/net.c | 21 - net/socket.c | 37

[Qemu-devel] [PATCH v4 3/4] net/socket: Convert error report message to Error

2017-06-12 Thread Mao Zhongyi
Currently, net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() use the function such as fprintf(), perror() to report an error message. Now, convert these functions to Error. Cc: jasow...@redhat.com Cc: arm...@redhat.com Cc: berra...@redhat.com Signed-off-by: Mao

Re: [Qemu-devel] [PATCH v2 0/4] Convert non-blocking connect and fix its error reporting

2017-05-08 Thread Mao Zhongyi
On 05/06/2017 12:39 AM, Daniel P. Berrange wrote: On Wed, Apr 26, 2017 at 04:04:14PM +0800, Mao Zhongyi wrote: v2: * PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report() in the function called by net_socket_*_init() to Error. Also add many error han

[Qemu-devel] [PATCH] hw/net/rocker/rocker: Convert pci device .init() to .realize()

2017-05-12 Thread Mao Zhongyi
shorten to at most 9 chars qemu-system-x86_64: -device rocker,name=qemu-rocker: Device initialization failed Convert pci_rocker_init() to Error to get rid of the unwanted second error message. Cc: j...@resnulli.us Cc: jasow...@redhat.com Signed-off-by: Mao Zhongyi --- hw/net/rocker/rocker.c

Re: [Qemu-devel] [PATCH] hw/net/rocker/rocker: Convert pci device .init() to .realize()

2017-05-14 Thread Mao Zhongyi
Hi, Philippe On 05/14/2017 05:04 AM, Philippe Mathieu-Daudé wrote: Hi Mao, You can use shorter patch subject "net/rocker" instead of "hw/net/rocker/rocker". Thanks for your suggestion :)OK, will do the fix right away. On 05/12/2017 05:35 AM, Mao Zhongyi wrote: Conv

[Qemu-devel] [PATCH v2] net/rocker: Convert pci device .init() to .realize()

2017-05-14 Thread Mao Zhongyi
shorten to at most 9 chars qemu-system-x86_64: -device rocker,name=qemu-rocker: Device initialization failed Convert pci_rocker_init() to Error to get rid of the unwanted second error message. Cc: j...@resnulli.us Cc: jasow...@redhat.com Cc: f4...@amsat.org Signed-off-by: Mao Zhongyi --- hw

  1   2   3   4   5   >