[Qemu-block] [PATCH 1/3] qemu-iotests: Modern shellscripting (use $() instead of ``)

2018-10-17 Thread Mao Zhongyi
d\`") sed -i 's/`basename $0`/$(basename $0)/g' $(git grep -l "basename \$0") A small amount of the rest is manually modified. Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi --- tests/qemu-iotests/001| 4 +-

[Qemu-block] [PATCH v2 1/3] qemu-iotests: Modern shellscripting (use $() instead of ``)

2018-10-17 Thread Mao Zhongyi
d\`") sed -i 's/`basename $0`/$(basename $0)/g' $(git grep -l "basename \$0") A small amount of the rest is manually modified. Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi --- tests/qemu-iotests/001| 4 +-

[Qemu-block] [PATCH] qemu-iotests: convert `pwd` and $(pwd) to $PWD

2018-10-22 Thread Mao Zhongyi
Suggested-by: Eric Blake Signed-off-by: Mao Zhongyi --- configure| 2 +- tests/check-block.sh | 6 ++-- tests/qemu-iotests/001 | 2 +- tests/qemu-iotests/002 | 2 +- tests/qemu-iotests/003 | 2 +- tests/qemu-iotests/004

[Qemu-block] [PATCH 00/22] QOM'ify SysBusDeviceClass->init

2018-11-19 Thread Mao Zhongyi
Cc: qemu-...@nongnu.org Cc: qemu-block@nongnu.org Cc: qemu-...@nongnu.org Cc: qemu-s3...@nongnu.org Cc: richard.hender...@linaro.org Cc: r...@twiddle.net Cc: sstabell...@kernel.org Cc: th...@redhat.com Cc: xen-de...@lists.xenproject.org Mao Zhongyi

[Qemu-block] [PATCH 02/22] block/noenand: Convert sysbus init function to realize function

2018-11-19 Thread Mao Zhongyi
Use DeviceClass rather than SysBusDeviceClass in onenand_class_init(). Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- hw/block/onenand.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions

[Qemu-block] [PATCH v2 02/21] block/noenand: Convert sysbus init function to realize function

2018-11-23 Thread Mao Zhongyi
Use DeviceClass rather than SysBusDeviceClass in onenand_class_init(). Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- hw/block/onenand.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions

[Qemu-block] [PATCH v2 00/21] QOM'ify SysBusDeviceClass->init

2018-11-23 Thread Mao Zhongyi
..@linaro.org Cc: qemu-...@nongnu.org Cc: qemu-block@nongnu.org Cc: qemu-...@nongnu.org Cc: qemu-s3...@nongnu.org Cc: richard.hender...@linaro.org Cc: r...@twiddle.net Cc: sstabell...@kernel.org Cc: th...@redhat.com Cc: xen-de...@lists.xenproject.org Mao Zhongyi (21): musi

[Qemu-block] [PATCH v3 02/21] block/noenand: Convert sysbus init function to realize function

2018-11-30 Thread Mao Zhongyi
Use DeviceClass rather than SysBusDeviceClass in onenand_class_init(). Cc: kw...@redhat.com Cc: mre...@redhat.com Cc: qemu-block@nongnu.org Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daudé --- hw/block/onenand.c | 16 +++- 1 file changed

[Qemu-block] [PATCH v3 00/21] QOM'ify SysBusDeviceClass->init

2018-11-30 Thread Mao Zhongyi
er...@linaro.org Cc: r...@twiddle.net Cc: sstabell...@kernel.org Cc: th...@redhat.com Cc: xen-de...@lists.xenproject.org Mao Zhongyi (21): musicpal: Convert sysbus init function to realize function block/noenand: Convert sysbus init function to realize function char/grlib_apbuart: Convert sysb

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

2017-06-15 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-block@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-block] [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-block] [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-block] [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-block] [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-block] [PATCH v3] util: remove the obsolete non-blocking connect

2017-07-24 Thread Mao Zhongyi
On 07/25/2017 06:07 AM, John Snow wrote: This was posted over a month ago with two R-Bs, did it get merged or dropped? --js Not yet, I hope that it will. Thanks, Mao On 06/16/2017 04:54 AM, Mao Zhongyi wrote: From: Cao jin The non-blocking connect mechanism is obsolete, and it

[Qemu-block] [PATCH 6/6] dev-storage: Fix the unusual function name

2017-07-26 Thread Mao Zhongyi
The function name of usb_msd_{realize,unrealize}_*, usb_msd_class_initfn_* are unusual. Rename it to usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi --- hw/usb/dev-storage.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[Qemu-block] [PATCH 1/6] hw/ide: Convert DeviceClass init to realize

2017-07-26 Thread Mao Zhongyi
Replace init with realize in IDEDeviceClass, which has errp as a parameter. So all the implementations now use error_setg instead of error_report for reporting error. Cc: John Snow Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/ide/core.c | 7 ++-- hw/ide/qdev.c

[Qemu-block] [PATCH 2/6] hw/block/fdc: Convert to realize

2017-07-26 Thread Mao Zhongyi
Convert floppy_drive_init() to realize and rename it to floppy_drive_realize(). Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/fdc.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff

[Qemu-block] [PATCH 0/6] Convert to realize and improve error handling

2017-07-26 Thread Mao Zhongyi
Busch Cc: Stefan Hajnoczi Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Markus Armbruster Mao Zhongyi (6): hw/ide: Convert DeviceClass init to realize hw/block/fdc: Convert to realize hw/block/nvme: Convert to realize hw/block: Fix the return type hw/

[Qemu-block] [PATCH 3/6] hw/block/nvme: Convert to realize

2017-07-26 Thread Mao Zhongyi
Convert nvme_init() to realize and rename it to nvme_realize(). Cc: Keith Busch Cc: Kevin Wolf Cc: Max Reitz Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/nvme.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/block/nvme.c b/hw

[Qemu-block] [PATCH 5/6] hw/block: Use errp directly rather than local_err

2017-07-26 Thread Mao Zhongyi
Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/fdc.c| 17 ++--- hw/block/nvme.c | 8 +++- hw/block/virtio-blk.c | 17 + hw/ide/qdev.c | 12 hw/scsi/scsi-disk.c | 13 - hw/usb/dev-storage.c | 9 +++-

[Qemu-block] [PATCH 4/6] hw/block: Fix the return type

2017-07-26 Thread Mao Zhongyi
value is worth. So fix the return type of blkconf_apply_backend_options(), blkconf_geometry() and virtio_blk_data_plane_create() to avoid it. Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Stefan Hajnoczi Signed-off-by: Mao Zhongyi --- hw/block/block.c| 21

Re: [Qemu-block] [Qemu-devel] [PATCH 4/6] hw/block: Fix the return type

2017-08-02 Thread Mao Zhongyi
Hi On 08/01/2017 10:29 PM, Markus Armbruster wrote: Stefan Hajnoczi writes: On Wed, Jul 26, 2017 at 08:02:53PM +0800, Mao Zhongyi wrote: When the function no success value to transmit, it usually make the function return void. It has turned out not to be a success, because it means that the

[Qemu-block] [PATCH v2 2/6] hw/block/fdc: Convert to realize

2017-08-04 Thread Mao Zhongyi
Convert floppy_drive_init() to realize and rename it to floppy_drive_realize(). Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/fdc.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff

[Qemu-block] [PATCH v2 6/6] dev-storage: Fix the unusual function name

2017-08-04 Thread Mao Zhongyi
The function name of usb_msd_{realize,unrealize}_*, usb_msd_class_initfn_* are unusual. Rename it to usb_msd_*_{realize,unrealize}, usb_msd_class_*_initfn. Cc: Gerd Hoffmann Signed-off-by: Mao Zhongyi --- hw/usb/dev-storage.c | 20 ++-- 1 file changed, 10 insertions(+), 10

[Qemu-block] [PATCH v2 4/6] hw/block: Fix the return type

2017-08-04 Thread Mao Zhongyi
value is worth. So fix the return type of blkconf_apply_backend_options(), blkconf_geometry() and virtio_blk_data_plane_create() to avoid it. Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Stefan Hajnoczi Signed-off-by: Mao Zhongyi --- hw/block/block.c| 15

[Qemu-block] [PATCH v2 0/6] Convert to realize and improve error handling

2017-08-04 Thread Mao Zhongyi
. [Markus Armbruster & Stefan Hajnoczi] Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Keith Busch Cc: Stefan Hajnoczi Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Markus Armbruster Mao Zhongyi (6): hw/ide: Convert DeviceClass init to realize hw/block/f

[Qemu-block] [PATCH v2 3/6] hw/block/nvme: Convert to realize

2017-08-04 Thread Mao Zhongyi
Convert nvme_init() to realize and rename it to nvme_realize(). Cc: John Snow Cc: Keith Busch Cc: Kevin Wolf Cc: Max Reitz Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/nvme.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/block

[Qemu-block] [PATCH v2 5/6] hw/block: Use errp directly rather than local_err

2017-08-04 Thread Mao Zhongyi
Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/block/fdc.c| 17 ++--- hw/block/nvme.c | 8 +++- hw/block/virtio-blk.c | 17 + hw/ide/qdev.c | 12 hw/scsi/scsi-disk.c | 13 - hw/usb/dev-storage.c | 9 +++-

[Qemu-block] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize

2017-08-04 Thread Mao Zhongyi
Replace init with realize in IDEDeviceClass, which has errp as a parameter. So all the implementations now use error_setg instead of error_report for reporting error. Cc: John Snow Cc: Markus Armbruster Signed-off-by: Mao Zhongyi --- hw/ide/core.c | 7 ++-- hw/ide/qdev.c

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize

2017-09-17 Thread Mao Zhongyi
On 09/16/2017 05:35 AM, John Snow wrote: On 08/04/2017 06:26 AM, Mao Zhongyi wrote: Replace init with realize in IDEDeviceClass, which has errp as a parameter. So all the implementations now use error_setg instead of error_report for reporting error. Cc: John Snow Cc: Markus Armbruster

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/6] hw/ide: Convert DeviceClass init to realize

2017-09-17 Thread Mao Zhongyi
On 09/16/2017 06:03 AM, John Snow wrote: On 09/15/2017 05:35 PM, John Snow wrote: On 08/04/2017 06:26 AM, Mao Zhongyi wrote: Replace init with realize in IDEDeviceClass, which has errp as a parameter. So all the implementations now use error_setg instead of error_report for reporting

[PATCH] block/monitor: Consolidate hmp_handle_error calls to reduce redundant code

2021-08-01 Thread Mao Zhongyi
Signed-off-by: Mao Zhongyi --- block/monitor/block-hmp-cmds.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/block/monitor/block-hmp-cmds.c b/block/monitor/block-hmp-cmds.c index 3e6670c963..2ac4aedfff 100644 --- a/block/monitor/block-hmp-cmds.c +++ b/block