[Qemu-devel] [PATCH 0/2] fw_cfg reboot_time and splash_time fix

2018-11-01 Thread Li Qiang
The first patch ensure the reboot_time is never negative and second change the splash-time and reboot-timeout type to qemu_opt_get_number per Markus's advice: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg06975.html Li Qiang (2): hw: fw_cfg: ensure reboot_time is nonegative hw

[Qemu-devel] [PATCH 2/2] hw: fw_cfg: use qemu_opt_get_number to get splash-time and reboot-timeout

2018-11-01 Thread Li Qiang
Currently the splash-time and reboot-timeout in boot_opts uses qemu_opt_get() to get a string, then convert it to a number ourselves. This is wrong. Change the opt's type to QEMU_OPT_NUMBER and use qemu_opt_get_number to parse it. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 29

[Qemu-devel] [PATCH 1/2] hw: fw_cfg: ensure reboot_time is nonegative

2018-11-01 Thread Li Qiang
This can avoid setting a negative value to etc/boot-fail-wait. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 3fcfa35..dff6e06 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw

[Qemu-devel] [PATCH] hw: fw_cfg: Improve error message when can't load splash file

2018-11-01 Thread Li Qiang
read_splashfile() reports "failed to read splash file" without further details. Get the details from g_file_get_contents(), and include them in the error message. Also remove unnecessary 'res' variable. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 7 +++ 1 file changed, 3

[Qemu-devel] [PATCH] vl: Improve error message when we can't load fw_cfg from file

2018-11-01 Thread Li Qiang
parse_fw_cfg() reports "can't load" without further details. Get the details from g_file_get_contents(), and include them in the error message. Signed-off-by: Li Qiang --- vl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 1fcacc5..f0bd

[Qemu-devel] [Question] About object oriented programming in qemu

2018-10-30 Thread Li Qiang
you think it make senses? If not I will not spend time to write the patch. Thanks, Li Qiang

[Qemu-devel] [PATCH] hw: qdev: fix error in comment

2018-10-30 Thread Li Qiang
Cc: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- include/hw/qdev-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index a24d0dd566..92851e55df 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h

Re: [Qemu-devel] [PATCH v2 2/2] tests: fw_cfg: add reboot_timeout test case

2018-10-30 Thread Li Qiang
Hi Paolo, Paolo Bonzini 于2018年10月30日周二 下午6:52写道: > On 30/10/2018 05:28, Li Qiang wrote: > > Signed-off-by: Li Qiang > > --- > > tests/fw_cfg-test.c | 10 ++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/tests/fw_cfg-test.c b/t

[Qemu-devel] [PATCH 4/4] nvme: use pci_dev directly in nvme_realize

2018-10-29 Thread Li Qiang
There is no need to make another reference. Signed-off-by: Li Qiang --- hw/block/nvme.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index a406c23..f63e344 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1235,7 +1235,7

[Qemu-devel] [PATCH 2/4] nvme: ensure the num_queues is not zero

2018-10-29 Thread Li Qiang
s=0x6032c170) at util/qemu-thread-posix.c:504 13 0x7fffdadbd494 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 14 0x7fffdaaffacf in clone () from /lib/x86_64-linux-gnu/libc.so.6 (gdb) q Signed-off-by: Li Qiang --- hw/block/nvme.c | 4 1 file changed, 4 insertions(+) diff --

[Qemu-devel] [PATCH 3/4] nvme: check msix_init_exclusive_bar return value

2018-10-29 Thread Li Qiang
As this function can fail. Signed-off-by: Li Qiang --- hw/block/nvme.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 72c9644..a406c23 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1250,7 +1250,10 @@ static void

[Qemu-devel] [PATCH 0/4] nvme: some small fixes

2018-10-29 Thread Li Qiang
Including sanity check and code cleanup. Li Qiang (4): nvme: use TYPE_NVME instead of constant string nvme: ensure the num_queues is not zero nvme: check msix_init_exclusive_bar return value nvme: use pci_dev directly in nvme_realize hw/block/nvme.c | 17 - 1 file

[Qemu-devel] [PATCH 1/4] nvme: use TYPE_NVME instead of constant string

2018-10-29 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index fc7dacb..676cc48 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1379,7 +1379,7 @@ static void nvme_instance_init(Object *obj

[Qemu-devel] [PATCH v2 1/2] tests: fw_cfg: add a function to get the fw_cfg file entry

2018-10-29 Thread Li Qiang
This is useful to write qtest about fw_cfg file entry. Signed-off-by: Li Qiang --- tests/libqos/fw_cfg.c | 33 + tests/libqos/fw_cfg.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c index d0889d1e22

[Qemu-devel] [PATCH v2 0/2] test: fw_cfg: add reboot-timeout test case

2018-10-29 Thread Li Qiang
This patchset is the test case for the following patch: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg05254.html v2: Change qfw_cfg_get_file per Philippe's review: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg06340.html Li Qiang (2): tests: fw_cfg: add a function to get

[Qemu-devel] [PATCH v2 2/2] tests: fw_cfg: add reboot_timeout test case

2018-10-29 Thread Li Qiang
Signed-off-by: Li Qiang --- tests/fw_cfg-test.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 1c5103fe1c..aeabd17ec0 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -99,6 +99,15 @@ static void test_fw_cfg_boot_menu

Re: [Qemu-devel] [PATCH 1/2] tests: fw_cfg: add a function to get the fw_cfg file entry

2018-10-29 Thread li qiang
Hello Philippe, Thanks for your review, I will send v2 later. Thanks. Li Qiang 在 2018/10/30 7:46, Philippe Mathieu-Daudé 写道: > Hi Li, > > On 28/10/18 13:40, Li Qiang wrote: >> This is useful to write qtest abount fw_cfg file entry. >> >> Signed-off-by: Li Qian

Re: [Qemu-devel] [PATCH] fw_cfg_reboot: ensure reboot_time is nonegative

2018-10-29 Thread Li Qiang
Philippe Mathieu-Daudé 于2018年10月30日周二 上午7:50写道: > On 25/10/18 3:45, Li Qiang wrote: > > Hello Laszlo and Philippe , > > > > Thanks for your review, > > > > > > > > Philippe Mathieu-Daudé mailto:phi...@redhat.com>> 于 > > 2018年10月25日周

Re: [Qemu-devel] [PATCH 2/2] tests: fw_cfg: add reboot_timeout test case

2018-10-29 Thread li qiang
在 2018/10/30 8:08, Philippe Mathieu-Daudé 写道: > On 28/10/18 13:40, Li Qiang wrote: >> Signed-off-by: Li Qiang >> --- >>   tests/fw_cfg-test.c | 13 - >>   1 file changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/tests/fw_cfg-test.c b/

[Qemu-devel] [PATCH 2/2] nvme: free cmbuf in nvme_exit

2018-10-29 Thread Li Qiang
This avoid a memory leak in unhotplug nvme device. Signed-off-by: Li Qiang --- hw/block/nvme.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 359a06d0ad..09d7c90259 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1332,6 +1332,9 @@ static

[Qemu-devel] [PATCH 0/2] nvme: fix two issues in nvme unhotplug

2018-10-29 Thread Li Qiang
The first corrent the refcount and second fix a memory leak. Li Qiang (2): nvme: don't unref ctrl_mem when device unrealized nvme: free cmbuf in nvme_exit hw/block/nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.11.0

[Qemu-devel] [PATCH 1/2] nvme: don't unref ctrl_mem when device unrealized

2018-10-29 Thread Li Qiang
posix.c:504 /lib/x86_64-linux-gnu/libpthread.so.0 This is caused by memory_region_unref in nvme_exit. Remove it to make the PCIdevice refcount correct. Signed-off-by: Li Qiang --- hw/block/nvme.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index fc7dac

[Qemu-devel] [PATCH 2/2] tests: fw_cfg: add reboot_timeout test case

2018-10-28 Thread Li Qiang
Signed-off-by: Li Qiang --- tests/fw_cfg-test.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/fw_cfg-test.c b/tests/fw_cfg-test.c index 1c5103fe1c..37765f15f8 100644 --- a/tests/fw_cfg-test.c +++ b/tests/fw_cfg-test.c @@ -99,6 +99,15 @@ static void

[Qemu-devel] [PATCH 0/2] test: fw_cfg: add reboot-timeout test case

2018-10-28 Thread Li Qiang
This patchset is the test case for the following patch: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg05254.html Li Qiang (2): tests: fw_cfg: add a function to get the fw_cfg file entry tests: fw_cfg: add reboot_timeout test case tests/fw_cfg-test.c | 13 - tests

[Qemu-devel] [PATCH 1/2] tests: fw_cfg: add a function to get the fw_cfg file entry

2018-10-28 Thread Li Qiang
This is useful to write qtest abount fw_cfg file entry. Signed-off-by: Li Qiang --- tests/libqos/fw_cfg.c | 30 ++ tests/libqos/fw_cfg.h | 2 ++ 2 files changed, 32 insertions(+) diff --git a/tests/libqos/fw_cfg.c b/tests/libqos/fw_cfg.c index d0889d1e22

Re: [Qemu-devel] [Qemu-trivial] [PATCH] piix: use TYPE_FOO constants than string constats

2018-10-25 Thread Li Qiang
Hello Laurent, Thanks, This patch has been in Michael's pull request. Maybe you can drop it. Thanks, Li Qiang Laurent Vivier 于2018年10月25日周四 下午9:52写道: > On 11/10/2018 13:38, Li Qiang wrote: > > Make them more QOMConventional. > > Cc:qemu-triv...@nongnu.org > > > &

Re: [Qemu-devel] [PATCH] fw_cfg_reboot: ensure reboot_time is nonegative

2018-10-24 Thread Li Qiang
Hello Laszlo and Philippe , Thanks for your review, Philippe Mathieu-Daudé 于2018年10月25日周四 上午6:56写道: > Hi, > > On 24/10/18 13:35, Laszlo Ersek wrote: > > On 10/24/18 09:11, Li Qiang wrote: > >> This can avoid setting a negative value to > >> etc/boot-fai

[Qemu-devel] [PATCH] fw_cfg_reboot: ensure reboot_time is nonegative

2018-10-24 Thread Li Qiang
This can avoid setting a negative value to etc/boot-fail-wait. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index f4a52d8..276dcb1 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw

[Qemu-devel] [PATCH] fw_cfg: print error message when reading splashfile failed

2018-10-23 Thread Li Qiang
Also remove unnecessary 'res' variable. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 946f765..f4a52d8 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -68,15 +68,14

[Qemu-devel] [PATCH] vl.c: print error message if loading fw_cfg file failed

2018-10-23 Thread Li Qiang
It makes sense to print the error message while reading file failed. Signed-off-by: Li Qiang --- vl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index b2a405f..ee6f982 100644 --- a/vl.c +++ b/vl.c @@ -2234,8 +2234,10 @@ static int parse_fw_cfg(void

[Qemu-devel] [PATCH] usb: ohci: make num_ports to an unsinged integer

2018-10-22 Thread Li Qiang
This can avoid setting OCHIState.num_ports to a negative num. Signed-off-by: Li Qiang --- hw/usb/hcd-ohci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 66656a1..c34cf5b 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd

Re: [Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path

2018-10-21 Thread Li Qiang
Hello Auger, Auger Eric 于2018年10月20日周六 上午12:41写道: > Hi Li, > > On 10/19/18 7:20 AM, Li Qiang wrote: > > Signed-off-by: Li Qiang > > --- > > hw/vfio/platform.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/hw/v

[Qemu-devel] [PATCH 0/2] hw: ccid-card-emulated: fix some resources leak

2018-10-19 Thread Li Qiang
Li Qiang (2): hw: ccid-card-emulated: introduce clean_event_notifier hw: ccid-card-emulated: cleanup resource when realize in error path hw/usb/ccid-card-emulated.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) -- 1.8.3.1

[Qemu-devel] [PATCH 1/2] hw: ccid-card-emulated: introduce clean_event_notifier

2018-10-19 Thread Li Qiang
Call it in device unrealize function. Signed-off-by: Li Qiang --- hw/usb/ccid-card-emulated.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 5c8b3c9..b356edb 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid

[Qemu-devel] [PATCH 2/2] hw: ccid-card-emulated: cleanup resource when realize in error path

2018-10-19 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/usb/ccid-card-emulated.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index b356edb..25976ed 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card

[Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba19143..e9d9e80 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -668,7 +668,7 @@ static void vfio_platform_realize

[Qemu-devel] [PATCH 6/7] vfio: platform: free timer in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 6a4fd7b..ba19143 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -518,6 +518,7 @@ static int vfio_populate_device(VFIODevice *vbasedev

[Qemu-devel] [PATCH 1/7] vfio-pci: make "vfio-pci-nohotplug" as MACRO

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8b73582..1f05b57 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -40,6 +40,8 @@ #define TYPE_VFIO_PCI "vfio-pci" #define PC

[Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba03dcd..5992fe7 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -72,7 +72,7 @@ static VFIOINTp *vfio_init_intp

[Qemu-devel] [PATCH 3/7] vfio: drop TYPE_FOO MACRO in VMStateDescription

2018-10-18 Thread Li Qiang
As the vmstate structure names aren't related with the QOM type names. Per Peter's mail: -->https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html Signed-off-by: Li Qiang --- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/ap.c| 2 +- hw/vfio/calxeda-xgmac.c | 2 +- hw/v

[Qemu-devel] [PATCH 5/7] vfio: platform: cleanup the notifier in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 5992fe7..6a4fd7b 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -80,6 +80,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev

[Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional

2018-10-18 Thread Li Qiang
As the documentation says "use TYPE_FOO constants" This also changes the parent of ap-device's MACRO. Signed-off-by: Li Qiang --- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 12 ++-- include/hw/s390x/ap-device.h | 4 ++-- 3 files changed, 9 insert

[Qemu-devel] [PATCH 0/7] vfio: some trivial fixes

2018-10-18 Thread Li Qiang
This patch set contains some trivial issue such as QOMConvetion, typo and resources leak in vfio. Li Qiang (7): vfio-pci: make "vfio-pci-nohotplug" as MACRO vfio: ap-device: make it more QOMConventional vfio: drop TYPE_FOO MACRO in VMStateDescription vfio: paltform: fix a t

[Qemu-devel] [PATCH] qga: fix an off-by-one issue

2018-10-17 Thread Li Qiang
Signed-off-by: Li Qiang --- qga/commands-win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 98d9735..e3842d1 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -465,7 +465,7 @@ static STORAGE_BUS_TYPE

[Qemu-devel] [PATCH] pc_init1: fix a typo in comment

2018-10-16 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/i386/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index dc09466b3e..0133668ce2 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -111,7 +111,7 @@ static void pc_init1(MachineState

[Qemu-devel] [PATCH] kvm: move vcpu mmap size to KVMState

2018-10-16 Thread Li Qiang
First the mmap size is a kvm ioctl, so it can go kvm initialization. Second this can avoid triggering KVM_GET_VCPU_MMAP_SIZE while initializing and destroying every VCPU. Signed-off-by: Li Qiang --- accel/kvm/kvm-all.c | 28 ++-- 1 file changed, 10 insertions(+), 18

[Qemu-devel] [PATCH v2] hw: scsi-disk: make it more QOMconventional

2018-10-13 Thread Li Qiang
Signed-off-by: Li Qiang --- Change since v1: -fix a typo in scsi_cd_info's name hw/scsi/scsi-disk.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index c43163cef4..8e9fa5ca6b 100644 --- a/hw/scsi

[Qemu-devel] [PATCH] block: change some function return type to bool

2018-10-13 Thread Li Qiang
Signed-off-by: Li Qiang --- block/block-backend.c | 8 include/sysemu/block-backend.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index dc0cd57724..2a8f3b55f8 100644 --- a/block/block-backend.c +++ b

[Qemu-devel] [PATCH] hw: scsi-disk: make it more QOMconventional

2018-10-13 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/scsi/scsi-disk.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index c43163cef4..15582fa0e2 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -55,6 +55,10

[Qemu-devel] [PATCH] hw: ne2000: make it more QOMconventional

2018-10-13 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/net/ne2000.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 07d79e317f..ab71ad49cb 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -33,6 +33,10 @@ #define MAX_ETH_FRAME_SIZE 1514

[Qemu-devel] [PATCH] hw: AC97: make it more QOMconventional

2018-10-13 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/audio/ac97.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 337402e9c6..d799533aa9 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -123,6 +123,10 @@ enum { #define MUTE_SHIFT 15

[Qemu-devel] [PATCH] hw: edu: drop DO_UPCAST

2018-10-12 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/misc/edu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 0687ffd343..cdcf550dd7 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -342,7 +342,7 @@ static void *edu_fact_thread(void *opaque) static

[Qemu-devel] [PATCH] vfio-pci: make vfio-pci device more QOM conventional

2018-10-11 Thread Li Qiang
Define a TYPE_VFIO_PCI and drop DO_UPCAST. Signed-off-by: Li Qiang --- hw/vfio/pci.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 866f0deeb7..3f232aedff 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c

[Qemu-devel] [PATCH v2] piix_pci: change the i440fx data sheet link

2018-10-11 Thread Li Qiang
Seems the intel link is unavailable, change it to qemu site. Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daud?? --- hw/pci-host/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0e608347c1..56a42055f1 100644

[Qemu-devel] [PATCH] piix_pci: change the i440fx data sheet link

2018-10-11 Thread Li Qiang
Seems the intel link is unavailable, change it to qemu site. Signed-off-by: Li Qiang --- hw/pci-host/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0e608347c1..e709abeb08 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host

[Qemu-devel] [PATCH] piix: use TYPE_FOO constants than string constats

2018-10-11 Thread Li Qiang
Make them more QOMConventional. Cc:qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/pci-host/piix.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 230d5d2ea3..5881e63364 100644 --- a/hw/pci-host/piix.c +++ b

[Qemu-devel] [PATCH] i440fx: use ARRAY_SIZE for pam_regions

2018-10-11 Thread Li Qiang
Cc: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/pci-host/piix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 0e608347c1..230d5d2ea3 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -142,7 +142,7

[Qemu-devel] [PATCH] machine: fix a typo

2018-10-10 Thread Li Qiang
Cc: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- hw/core/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 1987557833..da50ad6de7 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -636,7 +636,7 @@ static void

Re: [Qemu-devel] Strange behavior abount bootindex

2018-10-10 Thread Li Qiang
nding on which is initialized first. > > Indeed, the uuid is the same. Thank you so much Gerd. Li Qiang > cheers, > Gerd > >

[Qemu-devel] [PATCH] ide: piix: convert constant device name to MACRO

2018-10-09 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/ide/piix.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a3afe1f..5f29cce 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -35,6 +35,10 @@ #include "hw/ide/pci.h" #includ

Re: [Qemu-devel] [PATCH] memory.h: fix types in comments

2018-10-09 Thread Li Qiang
Peter Maydell 于2018年10月9日周二 下午6:26写道: > On 9 October 2018 at 11:21, Li Qiang wrote: > > Signed-off-by: Li Qiang > > --- > > include/exec/memory.h | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > Thanks. Contents of patch > Reviewed-b

[Qemu-devel] [PATCH] memory.h: fix types in comments

2018-10-09 Thread Li Qiang
Signed-off-by: Li Qiang --- include/exec/memory.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 3a427aa..1fbbdaf 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -935,7 +935,7 @@ uint64_t

[Qemu-devel] [PATCH] Rom: change Rom's 'isrom' to bool type

2018-10-09 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index aa0b3fc867..910f9a97a9 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -837,7 +837,7 @@ struct Rom { uint8_t *data

Re: [Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed

2018-10-08 Thread Li Qiang
Hello Philippe, Philippe Mathieu-Daudé 于2018年10月9日周二 下午1:52写道: > Hi Li, > > On 09/10/2018 04:39, Li Qiang wrote: > > It makes sense to print the error message while reading > > file failed. > > OK > > > > > Change since v1: > > free error > &g

[Qemu-devel] [PATCH] i386: pc_sysfw: load bios using rom API

2018-10-08 Thread Li Qiang
As the bios is a ROM, just using rom API. AFAICS no functionality changed. Signed-off-by: Li Qiang --- hw/i386/pc_sysfw.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 091e22dd60..7f469fd582 100644 --- a/hw/i386

[Qemu-devel] [PATCH v2] vl.c: print error message if load fw_cfg file failed

2018-10-08 Thread Li Qiang
It makes sense to print the error message while reading file failed. Change since v1: free error Signed-off-by: Li Qiang Reviewed-by: Philippe Mathieu-Daud?? --- vl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 4e25c78..69fc77c 100644 --- a/vl.c

[Qemu-devel] Strange behavior abount bootindex

2018-10-08 Thread Li Qiang
ck layer or guest os? Could anyone give some hints? Thanks, Li Qiang The command I used is below: qemu-devel/qemu/x86_64-softmmu/qemu-system-x86_64 -m 1024 -smp 2 -drive file=disk1.test,format=raw,if=none,id=id1,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=id1,id=virtio1,b

[Qemu-devel] [PATCH] util: aio-posix: fix a typo

2018-10-07 Thread Li Qiang
Cc: qemu-triv...@nongnu.org Signed-off-by: Li Qiang --- util/aio-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index 621b302..51c41ed 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -40,7 +40,7 @@ struct AioHandler

[Qemu-devel] [PATCH] vl.c: print error message if load fw_cfg file failed

2018-10-06 Thread Li Qiang
It makes sense to print the error message while reading file failed. Signed-off-by: Li Qiang --- vl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index cc55fe04a2..3db410e771 100644 --- a/vl.c +++ b/vl.c @@ -2207,8 +2207,9 @@ static int parse_fw_cfg(void

[Qemu-devel] [PATCH] target/i386: kvm: just return after migrate_add_blocker failed

2018-10-06 Thread Li Qiang
When migrate_add_blocker failed, the invtsc_mig_blocker is not appended so no need to remove. This can save several instructions. Signed-off-by: Li Qiang --- target/i386/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index

[Qemu-devel] [PATCH] tests: check-qjson: fix a memory leak

2018-10-02 Thread Li Qiang
0x5654ae9449af in from_json_str tests/check-qjson.c:30 #15 0x5654ae946399 in utf8_string tests/check-qjson.c:781 #16 0x7f9fb826cc39 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72c39) Signed-off-by: Li Qiang --- tests/check-qjson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests

[Qemu-devel] [PATCH] qom: fix comments for object_property_set_qobject function

2018-09-16 Thread Li Qiang
Also make the definition and declare of this function's argument name the same. Signed-off-by: Li Qiang --- include/qom/qom-qobject.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qom/qom-qobject.h b/include/qom/qom-qobject.h index 77cd717e3f..11803c6b57 100644

[Qemu-devel] [PATCH] hw: edu: replace device name with macro

2018-09-13 Thread Li Qiang
Just as other devices do. Signed-off-by: Li Qiang --- hw/misc/edu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index df26a4d046..0687ffd343 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -30,7 +30,8 @@ #include "qemu/main-l

Re: [Qemu-devel] [PATCH 5/8] hw: designware: add read memory region callback

2018-09-13 Thread Li Qiang
Paolo Bonzini 于2018年9月13日周四 下午11:12写道: > On 12/09/2018 18:01, Li Qiang wrote: > > From: Li Qiang > > > > Signed-off-by: Li Qiang > > --- > > hw/pci-host/designware.c | 7 +++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/

Re: [Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region

2018-09-12 Thread Li Qiang
Philippe Mathieu-Daudé 于2018年9月13日周四 上午1:12写道: > Hi Li, > > On 9/12/18 6:01 PM, Li Qiang wrote: > > From: Li Qiang > > > > This patch set try to add the missed read callback for memory region. > > Without this patchset, when the guest reads the IO port/

Re: [Qemu-devel] [PATCH] memory region: check the old.mmio.read status

2018-09-12 Thread Li Qiang
yRegionOps structures that don't conform. (See the end of my > > other email: > > < > 84da6f02-1f60-4bc7-92da-6a7f74deded3@redhat.com">http://mid.mail-archive.com/84da6f02-1f60-4bc7-92da-6a7f74deded3@redhat.com > >.) > > Beyond the one that Li Qiang reported directly (&q

[Qemu-devel] [PATCH 5/8] hw: designware: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/pci-host/designware.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index 29ea313798..f5641b5c8c 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -57,6 +57,12

[Qemu-devel] [PATCH 6/8] hw: pvrdma: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/rdma/vmw/pvrdma_main.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index ca5fa8d981..a6211d416d 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -455,6

[Qemu-devel] [PATCH 3/8] hw: hyperv_testdev: add read callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/misc/hyperv_testdev.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index bf6bbfa8cf..7549f470b1 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc

[Qemu-devel] [PATCH 7/8] hw: sun4c: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/sparc64/sun4u.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d16843b30e..74c55a82f4 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -212,6 +212,11 @@ typedef struct PowerDevice

[Qemu-devel] [PATCH 8/8] exec: add read callback for notdirty memory region

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- exec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/exec.c b/exec.c index 6826c8337d..3cd5ad2cae 100644 --- a/exec.c +++ b/exec.c @@ -2681,6 +2681,11 @@ void memory_notdirty_write_complete(NotDirtyInfo *ndi) } } +static uint64_t

[Qemu-devel] [PATCH 1/8] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index d79a568f54..6de7809f1a 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -434,6 +434,11 @@ static bool

[Qemu-devel] [PATCH 4/8] hw: pc-testdev: add read memory region callback

2018-09-12 Thread Li Qiang
From: Li Qiang Also change the write callback name. Signed-off-by: Li Qiang --- hw/misc/pc-testdev.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/misc/pc-testdev.c b/hw/misc/pc-testdev.c index b81d820084..697eb88c97 100644 --- a/hw/misc/pc

[Qemu-devel] [PATCH 2/8] hw: debugexit: add read callback

2018-09-12 Thread Li Qiang
From: Li Qiang Signed-off-by: Li Qiang --- hw/misc/debugexit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index 84fa1a5b9d..bed293247e 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -23,6 +23,11 @@ typedef struct

[Qemu-devel] [PATCH 0/8] Add missed read callback for some memory region

2018-09-12 Thread Li Qiang
From: Li Qiang This patch set try to add the missed read callback for memory region. Without this patchset, when the guest reads the IO port/memory, it will cause an NULL-dereference issue. For example, add "-device isa-debug-exit" to command, then read the 0x501 port, it causes

Re: [Qemu-devel] [PATCH] memory region: check the old.mmio.read status

2018-09-12 Thread Li Qiang
Peter Maydell 于2018年9月12日周三 下午8:55写道: > On 12 September 2018 at 13:32, Li Qiang wrote: > > To avoid NULL-deref for the devices without read callbacks > > > > Signed-off-by: Li Qiang > > --- > > memory.c | 4 > > 1 file changed, 4 insertions(+) &

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
Hi Laszlo, Laszlo Ersek 于2018年9月12日周三 下午6:36写道: > On 09/12/18 10:02, Li Qiang wrote: > > Hi, > > > > Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > > > >> Hi > >> > >> On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > >>> > >

[Qemu-devel] [PATCH] memory region: check the old.mmio.read status

2018-09-12 Thread Li Qiang
To avoid NULL-deref for the devices without read callbacks Signed-off-by: Li Qiang --- memory.c | 4 1 file changed, 4 insertions(+) diff --git a/memory.c b/memory.c index 9b73892768..48d025426b 100644 --- a/memory.c +++ b/memory.c @@ -406,6 +406,10 @@ static MemTxResult

Re: [Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-12 Thread Li Qiang
Hi, Marc-André Lureau 于2018年9月12日周三 下午3:16写道: > Hi > > On Wed, Sep 12, 2018 at 9:22 AM Li Qiang wrote: > > > > The write/read should be paired, this can avoid the > > NULL-deref while the guest reads the fw_cfg port. > > > > Signed-off-by:

[Qemu-devel] [PATCH] fw_cfg_mem: add read memory region callback

2018-09-11 Thread Li Qiang
The write/read should be paired, this can avoid the NULL-deref while the guest reads the fw_cfg port. Signed-off-by: Li Qiang --- hw/nvram/fw_cfg.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index d79a568f54..6de7809f1a 100644 --- a/hw/nvram

[Qemu-devel] [Question] Question about ACPI table in qemu

2018-09-11 Thread Li Qiang
EMU pass the tables to SeaBIOS for it to copy >>> into memory like it does on CSM, coreboot, and Xen" So where does this 'copy' happens? or is there something others I missed? Thanks, Li Qiang

Re: [Qemu-devel] [Question] Question about the i440FX device

2018-09-09 Thread Li Qiang
Thanks Paolo, Paolo Bonzini 于2018年9月10日周一 上午7:11写道: > On 07/09/2018 08:32, Li Qiang wrote: > > Hello all, > > > > I want to know why the i440FX in the following 'info qtree' information > is > > laid under the pci.0 bus. In the chip spec here: > > -->htt

[Qemu-devel] [Question] Question about the i440FX device

2018-09-07 Thread Li Qiang
Hello all, I want to know why the i440FX in the following 'info qtree' information is laid under the pci.0 bus. In the chip spec here: -->https://wiki.qemu.org/images/b/bb/29054901.pdf I don't see this device. Can anyone give me some hints? Thanks, Li Qiang bus: main-system-bus type Sys

[Qemu-devel] [PATCH] cpu.h: fix a typo in comment

2018-09-05 Thread Li Qiang
Found by reading the code. Signed-off-by: Li Qiang --- include/qom/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index dc130cd307..5bb94a9f86 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -852,7 +852,7 @@ extern

[Qemu-devel] [PATCH] qdev: fix a typo in comment

2018-09-05 Thread Li Qiang
Found by reading code. Signed-off-by: Li Qiang --- hw/core/qdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 529b82de18..7e4bfcb8f7 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -643,7 +643,7 @@ static void

Re: [Qemu-devel] Question about dirty page statistics for live migration

2018-08-13 Thread Li Qiang
2018-08-13 19:30 GMT+08:00 Dr. David Alan Gilbert : > * Li Qiang (liq...@gmail.com) wrote: > > 2018-08-13 17:35 GMT+08:00 Dr. David Alan Gilbert : > > > > > * Li Qiang (liq...@gmail.com) wrote: > > > > Hello Dave, Juan and all, > > > > > >

Re: [Qemu-devel] Question about dirty page statistics for live migration

2018-08-13 Thread Li Qiang
2018-08-13 17:35 GMT+08:00 Dr. David Alan Gilbert : > * Li Qiang (liq...@gmail.com) wrote: > > Hello Dave, Juan and all, > > > > It is useful to get the dirty page rates in guest to evaluate the guest > > loads > > so that we can make a decide to live migrate it

[Qemu-devel] Question about dirty page statistics for live migration

2018-08-12 Thread Li Qiang
tps://github.com/grivon/yabusame-qemu-dpt and here: https://github.com/btrplace/qemu-patch But seems not go to the upstream. I want to know your opinions about adding this qmp. Thanks, Li Qiang

[Qemu-devel] [Bug 1785670] Re: Guest(ubuntu 18.04) crashes when trying uploading file

2018-08-07 Thread Li Qiang
n is too big. In my debug, I see the m->m_len is 0x5b0, but datasize in m_inc is 0x40. Is this right? Thanks, Li Qiang ==17835==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61f41dd0 at pc 0x76e9ad7b bp 0x7fffc6b215d0 sp 0x7fffc6b20d80 WRITE of size 28 at 0x61f41dd0

Re: [Qemu-devel] [PATCH] migrate/cpu-throttle: Add max-cpu-throttle migration parameter

2018-08-07 Thread Li Qiang
Hello Dave, What's status of this patch, Do you gonna merge it? Thanks, Li Qiang 2018-08-02 18:47 GMT+08:00 Dr. David Alan Gilbert : > * Li Qiang (liq...@gmail.com) wrote: > > Currently, the default maximum CPU throttle for migration is > > 99(CPU_THROTTLE_PCT_MAX). This is

<    2   3   4   5   6   7   8   9   >