[Qemu-devel] [for-2.10 PATCH 2/3] spapr_drc: add Error ** argument to spapr_dr_connector_new()

2017-08-07 Thread Greg Kurz
This just allow spapr_dr_connector_new() to propagate errors to its callers. It doesn't change any functionality. Signed-off-by: Greg Kurz --- hw/ppc/spapr.c |4 ++-- hw/ppc/spapr_drc.c |4 ++-- hw/ppc/spapr_pci.c |2 +- include/hw/ppc/spapr_drc.h |2 +

[Qemu-devel] [for-2.10 PATCH 1/3] spapr_drc: abort if object_property_add_child() fails

2017-08-07 Thread Greg Kurz
object_property_add_child() can only fail in two cases: - the child already has a parent, which shouldn't happen since the DRC was allocated a few lines above - the parent already has a child with the same name, which would mean the caller tries to create a DRC that already exists In both case

[Qemu-devel] [for-2.10 PATCH 0/3] spapr: fix PCI hotplug issue when PHBs don't have index

2017-08-07 Thread Greg Kurz
While working on PHB hotplug for 2.11, a bug was discovered in the PCI DR logic in the PHB code: it relies on the PHB index property to be set but it doesn't enforce it. It is hence possible to create two PHBs with the same index (ie, the default value -1), even though this isn't expected by the re

[Qemu-devel] [PATCH v3 3/3] Add new functions for whitelisting and their calls

2017-08-07 Thread dverma
The 'check_updated_properties' function keeps track of properties that were added/removed from fields across qemu versions. The 'check_updated_sizes' function reduces false positives generated especially while testing backward migration by keeping a list of common size/version changes. The 'check_n

[Qemu-devel] [PATCH v3 0/3] Vmstate-static-checker.py fix upstream

2017-08-07 Thread dverma
This is an update to the script vmstate-static-checker.py. The whitelist has been updated and newer functions have been added to reduce the false positives generated by the script while testing migration. The code has been cleaned and updated to follow PEP8 guidelines. dverma (3): Fix format an

[Qemu-devel] [PATCH v3 2/3] Update the existing whitelist

2017-08-07 Thread dverma
Appended newer fields and introduced new names in the whitelist --- scripts/vmstate-static-checker.py | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py index b416b66..ae41e44 100755 ---

[Qemu-devel] [PATCH v3 1/3] Fix format and styles; make code more pythonic

2017-08-07 Thread dverma
- Format fixes, cleaned up the print statement - Style fixes, e.g. changed "if not x in y" to "if x not in y" - Improved variable names --- scripts/vmstate-static-checker.py | 111 +- 1 file changed, 62 insertions(+), 49 deletions(-) diff --git a/scripts/vmstat

Re: [Qemu-devel] [PATCH v4 2/5] hw/pci: introduce pcie-pci-bridge device

2017-08-07 Thread Marcel Apfelbaum
On 07/08/2017 19:42, Alexander Bezzubikov wrote: 2017-08-07 19:39 GMT+03:00 Marcel Apfelbaum : On 05/08/2017 23:27, Aleksandr Bezzubikov wrote: Introduce a new PCIExpress-to-PCI Bridge device, which is a hot-pluggable PCI Express device and supports devices hot-plug with SHPC. Hi Aleksandr

[Qemu-devel] [PATCH v5] vmgenid: replace x-write-pointer-available hack

2017-08-07 Thread Marc-André Lureau
This compat property sole function is to prevent the device from being instantiated. Instead of requiring an extra compat property, check if fw_cfg has DMA enabled. fw_cfg is a built-in device that is initialized very early by the machine init code. We have at least one other device that also ass

Re: [Qemu-devel] AVMF & OVMF blobs in QEMU tree???

2017-08-07 Thread Laszlo Ersek
On 08/07/17 16:40, Peter Maydell wrote: > On 7 August 2017 at 15:31, Igor Mammedov wrote: >> As I recall there were issues with FAT driver licensing in edk2, >> but I've heard there were some changes in that regard. >> >> Is there any other reasons why we are not putting subj. >> in QEMU tree like

Re: [Qemu-devel] [RFC PATCH 17/56] migration: Make MigrationStats sizes unsigned in QAPI/QMP

2017-08-07 Thread Juan Quintela
Markus Armbruster wrote: > Sizes should use QAPI type 'size' (uint64_t). MigrationStats members > @transferred, @remaining, @total, @normal-bytes, @page-size are 'int' > (int64_t). populate_ram_info(), populate_disk_info() and and many > places that update them in global variable @ram_counters i

Re: [Qemu-devel] [RFC PATCH 18/56] migration: Make parameter max-bandwidth unsigned in QAPI/QMP

2017-08-07 Thread Juan Quintela
Markus Armbruster wrote: > Byte rates should use QAPI type 'size' (uint64_t). > migrate_set_speed's parameter @value and member @max-bandwidth of > MigrationParameters and MigrateSetParameters are 'int' (int64_t). > > Change them all to 'size'. > > migrate_set_speed and migrate-set-parameters now

[Qemu-devel] colo-compare: segfault and assert on colo_compare_finalize

2017-08-07 Thread Eduardo Otubo
(please ignore my last email, looks like mutt wants play games lately) Hi all, I have found a problem on colo-compare that leads to segmentation fault when calling qemu like this: $ qemu-system-x86_64 -S -machine pc -object colo-compare,id=test-object First I got an assert failed: (qemu-sys

Re: [Qemu-devel] [PATCH v4 4/5] hw/pci: add QEMU-specific PCI capability to the Generic PCI Express Root Port

2017-08-07 Thread Marcel Apfelbaum
On 05/08/2017 23:27, Aleksandr Bezzubikov wrote: To enable hotplugging of a newly created pcie-pci-bridge, we need to tell firmware (SeaBIOS in this case) to reserve additional buses or IO/MEM/PREF space for pcie-root-port. Additional bus reservation allows us to hotplug pcie-pci-bridge into this

Re: [Qemu-devel] [RFC PATCH 16/56] migration: Make XBZRLE transferred size unsigned in QAPI/QMP

2017-08-07 Thread Juan Quintela
Markus Armbruster wrote: > Sizes should use QAPI type 'size' (uint64_t). XBZRLECacheStats member > @bytes is 'int' (int64_t). save_xbzrle_page() computes the byte count > increment in size_t, implicitly converts it to int, then adds that to > @bytes. > > Change the XBZRLECacheStats member to 'si

Re: [Qemu-devel] [PATCH v4 3/5] hw/pci: introduce bridge-only vendor-specific capability to provide some hints to firmware

2017-08-07 Thread Marcel Apfelbaum
On 05/08/2017 23:27, Aleksandr Bezzubikov wrote: On PCI init PCI bridges may need some extra info about bus number, IO, memory and prefetchable memory to reserve. QEMU can provide this with a special vendor-specific PCI capability. Hi Aleksandr, Signed-off-by: Aleksandr Bezzubikov --- hw/

Re: [Qemu-devel] [PATCH v4 2/5] hw/pci: introduce pcie-pci-bridge device

2017-08-07 Thread Alexander Bezzubikov
2017-08-07 19:39 GMT+03:00 Marcel Apfelbaum : > On 05/08/2017 23:27, Aleksandr Bezzubikov wrote: >> >> Introduce a new PCIExpress-to-PCI Bridge device, >> which is a hot-pluggable PCI Express device and >> supports devices hot-plug with SHPC. >> > > > Hi Aleksandr, > >> This device is intended to r

[Qemu-devel] [Bug 1708551] Re: macOS Guest Reading USB 3.0 Bus as USB 2.0

2017-08-07 Thread Thomas Huth
Ok, could you maybe try something like this instead: qemu-system-x86_64 ... -usb \ -device qemu-xhci,id=xhci \ -device usb-tablet,bus=usb-bus.0 \ -device usb-kbd,bus=usb-bus.0 \ -device usb-host,bus=xhci.0,vendorid=0x05ac,productid=0x12a8 i.e. use "bus=xhci.0" for the usb-host de

Re: [Qemu-devel] [PATCH v4 2/5] hw/pci: introduce pcie-pci-bridge device

2017-08-07 Thread Marcel Apfelbaum
On 05/08/2017 23:27, Aleksandr Bezzubikov wrote: Introduce a new PCIExpress-to-PCI Bridge device, which is a hot-pluggable PCI Express device and supports devices hot-plug with SHPC. Hi Aleksandr, This device is intended to replace the DMI-to-PCI Bridge in an overwhelming majority of use-ca

[Qemu-devel] (no subject)

2017-08-07 Thread Eduardo Otubo
zhangchen.f...@cn.fujitsu.com, wang.guan...@zte.com.cn, wang.yong...@zte.com.cn Bcc: Subject: colo-compare: segfault and assert on colo_compare_finalize Reply-To: Hi all, I have found a problem on colo-compare that leads to segmentation fault when calling qemu like this: $ qemu-system-x86_64

Re: [Qemu-devel] [PATCH v4 2/3] pci: add QEMU-specific PCI capability structure

2017-08-07 Thread Marcel Apfelbaum
On 07/08/2017 19:02, Alexander Bezzubikov wrote: 2017-08-07 18:52 GMT+03:00 Marcel Apfelbaum : On 05/08/2017 23:29, Aleksandr Bezzubikov wrote: On PCI init PCI bridge devices may need some extra info about bus number to reserve, IO, memory and prefetchable memory limits. QEMU can provide this

Re: [Qemu-devel] [PATCH v4 3/3] pci: enable RedHat PCI bridges to reserve additional buses on PCI init

2017-08-07 Thread Marcel Apfelbaum
On 05/08/2017 23:29, Aleksandr Bezzubikov wrote: In case of Red Hat Generic PCIE Root Port reserve additional buses, which number is provided in a vendor-specific capability. Hi Aleksandr, It seems the subject/commit description does not cover all that the patch does, not it also deals with o

Re: [Qemu-devel] [PATCH for-2.10] iotests: fix 185

2017-08-07 Thread Vladimir Sementsov-Ogievskiy
07.08.2017 18:57, Vladimir Sementsov-Ogievskiy wrote: 07.08.2017 18:46, Vladimir Sementsov-Ogievskiy wrote: 07.08.2017 17:29, Eric Blake wrote: On 08/07/2017 09:16 AM, Vladimir Sementsov-Ogievskiy wrote: 185 iotest is broken. How to test: i=0; while ./check -qcow2 -nocache 185; do ((i+=1));

Re: [Qemu-devel] [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-07 Thread Eric Blake
On 08/07/2017 11:09 AM, Vladimir Sementsov-Ogievskiy wrote: > On 08/04/2017 10:14 AM, Vladimir Sementsov-Ogievskiy wrote: >> Set reply.handle to 0 on error path to prevent normal path of >> nbd_co_receive_reply. >> >> The client still tried to send a flush request to the server, when

Re: [Qemu-devel] [RFC PATCH 15/56] migration: Make XBZRLE cache size unsigned in QAPI/QMP

2017-08-07 Thread Juan Quintela
Markus Armbruster wrote: > Sizes should use QAPI type 'size' (uint64_t). migrate-set-cache-size > parameter @value is 'int' (int64_t). qmp_migrate_set_cache_size() > ensures it fits into size_t. page_cache.c implicitly converts the > signed size to unsigned types (it can't quite decide whether

[Qemu-devel] [PATCH for-2.10] throttle: Make LeakyBucket.avg and LeakyBucket.max integer types

2017-08-07 Thread Alberto Garcia
Both the throttling limits set with the throttling.iops-* and throttling.bps-* options and their QMP equivalents defined in the BlockIOThrottle struct are integer values. Those limits are also reported in the BlockDeviceInfo struct and they are integers there as well. Therefore there's no reason

Re: [Qemu-devel] [RFC PATCH 14/56] migration: Fix migrate-set-cache-size error reporting

2017-08-07 Thread Juan Quintela
Markus Armbruster wrote: > qmp_migrate_set_cache_size() calls xbzrle_cache_resize() to do the > actual work, which in turn calls cache_init() to resize the cache. If > cache_init() fails, xbzrle_cache_resize() reports that error with > error_report() and fails. qmp_migrate_set_cache_size() detec

Re: [Qemu-devel] [PATCH 0/3] respect bdrv_getlength() error code

2017-08-07 Thread Kevin Wolf
Am 04.08.2017 um 17:10 hat Denis V. Lunev geschrieben: > These cases were reported by Markus Armbruster > Patches add error checking of the bdrv_getlength() call or remove > the call of that function. Thanks, applied to the block branch. Kevin

Re: [Qemu-devel] [PATCH] tests/pxe: Check virtio-net-ccw on s390x

2017-08-07 Thread Cornelia Huck
On Thu, 3 Aug 2017 15:30:19 +0200 Thomas Huth wrote: > Now that we've got a firmware that can do TFTP booting on s390x (i.e. > the pc-bios/s390-netboot.img), we can enable the PXE tester for this > architecture, too. I'll take this through the s390x tree, unless someone objects. > > Signed-of

Re: [Qemu-devel] [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-07 Thread Vladimir Sementsov-Ogievskiy
07.08.2017 18:33, Eric Blake wrote: On 08/07/2017 10:13 AM, Eric Blake wrote: On 08/07/2017 07:56 AM, Vladimir Sementsov-Ogievskiy wrote: 07.08.2017 14:52, Eric Blake wrote: On 08/04/2017 10:14 AM, Vladimir Sementsov-Ogievskiy wrote: Set reply.handle to 0 on error path to prevent normal path

Re: [Qemu-devel] [PATCH v4 2/3] pci: add QEMU-specific PCI capability structure

2017-08-07 Thread Alexander Bezzubikov
2017-08-07 18:52 GMT+03:00 Marcel Apfelbaum : > On 05/08/2017 23:29, Aleksandr Bezzubikov wrote: >> >> On PCI init PCI bridge devices may need some >> extra info about bus number to reserve, IO, memory and >> prefetchable memory limits. QEMU can provide this >> with special vendor-specific PCI capa

Re: [Qemu-devel] About virtio device hotplug in Q35! 【外域邮件.谨慎查阅】

2017-08-07 Thread Alex Williamson
On Mon, 7 Aug 2017 21:04:16 +0800 Bob Chen wrote: > Besides, I checked the lspci -vvv output, no capabilities of Access Control > are seen. Are these switches onboard an NVIDIA card or are they separate components? The examples I have on NVIDIA cards do include ACS: +-02.0-[42-47]00.0-[43-

Re: [Qemu-devel] About virtio device hotplug in Q35! 【外域邮件.谨慎查阅】

2017-08-07 Thread Alex Williamson
On Mon, 7 Aug 2017 21:00:04 +0800 Bob Chen wrote: > Bad news... The performance had dropped dramatically when using emulated > switches. > > I was referring to the PCIe doc at > https://github.com/qemu/qemu/blob/master/docs/pcie.txt > > # qemu-system-x86_64_2.6.2 -enable-kvm -cpu host,kvm=off -

Re: [Qemu-devel] [PATCH for-2.10] iotests: fix 185

2017-08-07 Thread Vladimir Sementsov-Ogievskiy
07.08.2017 18:46, Vladimir Sementsov-Ogievskiy wrote: 07.08.2017 17:29, Eric Blake wrote: On 08/07/2017 09:16 AM, Vladimir Sementsov-Ogievskiy wrote: 185 iotest is broken. How to test: i=0; while ./check -qcow2 -nocache 185; do ((i+=1)); echo N = $i; \ done; echo N = $i finished for me l

[Qemu-devel] [PATCH for-2.11 3/4] booke206: allow to specify an mmucfg value at the init

2017-08-07 Thread KONRAD Frederic
This allows to init the MMUCFG SPR with a non NULL value. Signed-off-by: KONRAD Frederic --- target/ppc/translate_init.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 01723bd..2627cbe 100644 --- a/targ

Re: [Qemu-devel] [PATCH] iotests: fix 185

2017-08-07 Thread Kevin Wolf
Am 07.08.2017 um 16:16 hat Vladimir Sementsov-Ogievskiy geschrieben: > 185 iotest is broken. > > How to test: > > i=0; while ./check -qcow2 -nocache 185; do ((i+=1)); echo N = $i; \ > done; echo N = $i > > finished for me like this: > > 185 2s ... - output mismatch (see 185.out.bad) > --- /wor

[Qemu-devel] [PATCH for-2.11 2/4] booke206: fix tlbnps for fixed size TLB

2017-08-07 Thread KONRAD Frederic
Some OS don't populate the TSIZE field when using a fixed size TLB which result in a 1KB TLB. When the TLB is a fixed size TLB the TSIZE field should be ignored. Fix this wrong behavior with MAV 2.0. Signed-off-by: KONRAD Frederic --- target/ppc/cpu.h| 22 ++ target/

[Qemu-devel] [PATCH for-2.11 0/4] ppc64: add e6500

2017-08-07 Thread KONRAD Frederic
Hi, Those are some patches to add basic e6500 support for the moment e5500 with a correct MMU configuration and supported instructions. Some (maybe a lot of) things are missing (ie: the thread support) but it is enough to boot a propietary OS on my side. The first two patches are fixes when using

[Qemu-devel] [PATCH for-2.11 4/4] ppc64: introduce e6500

2017-08-07 Thread KONRAD Frederic
This introduces e6500 core. Signed-off-by: KONRAD Frederic --- target/ppc/cpu-models.c | 2 + target/ppc/cpu-models.h | 1 + target/ppc/translate_init.c | 91 - 3 files changed, 93 insertions(+), 1 deletion(-) diff --git a/target/ppc/cpu-mod

Re: [Qemu-devel] [PATCH v4 2/3] pci: add QEMU-specific PCI capability structure

2017-08-07 Thread Marcel Apfelbaum
On 05/08/2017 23:29, Aleksandr Bezzubikov wrote: On PCI init PCI bridge devices may need some extra info about bus number to reserve, IO, memory and prefetchable memory limits. QEMU can provide this with special vendor-specific PCI capability. This capability is intended to be used only for Red

[Qemu-devel] [PATCH for-2.11 1/4] booke206: fix booke206_tlbnps for mav 2.0

2017-08-07 Thread KONRAD Frederic
This fixes booke206_tlbnps for MAV 2.0 by checking the MMUCFG register and return directly the right tlbnps instead of computing it from non existing field. Signed-off-by: KONRAD Frederic --- target/ppc/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/cpu.

Re: [Qemu-devel] [PATCH v4 2/8] acpi: add vmcoreinfo device

2017-08-07 Thread Dave Anderson
- Original Message - > Hi Dave > > On Wed, Jul 26, 2017 at 10:21 AM, Michael S. Tsirkin wrote: > > On Sat, Jul 15, 2017 at 01:47:50AM +0200, Marc-André Lureau wrote: > >> > > >> > There's more info scattered in other places. > >> > > >> > Why do you get to document it? Because you are t

Re: [Qemu-devel] [PATCH for-2.10] iotests: fix 185

2017-08-07 Thread Vladimir Sementsov-Ogievskiy
07.08.2017 17:29, Eric Blake wrote: On 08/07/2017 09:16 AM, Vladimir Sementsov-Ogievskiy wrote: 185 iotest is broken. How to test: i=0; while ./check -qcow2 -nocache 185; do ((i+=1)); echo N = $i; \ done; echo N = $i finished for me like this: 185 2s ... - output mismatch (see 185.out.ba

Re: [Qemu-devel] [PATCH RFC v2 0/9] s390x: zPCI detangling

2017-08-07 Thread Cornelia Huck
On Mon, 24 Jul 2017 12:44:43 +0200 Christian Borntraeger wrote: > On 07/19/2017 03:31 PM, Thomas Huth wrote: > > On 19.07.2017 15:03, Cornelia Huck wrote: > >> On Tue, 18 Jul 2017 16:24:46 +0200 > >> Cornelia Huck wrote: > >> > >>> Next try of the zPCI detangling, taking cpu models into acco

[Qemu-devel] [PATCH for 2.10 v3 3/6] docker: ignore submodules when checking diff

2017-08-07 Thread Alex Bennée
The QEMU tree often has dirty submodules in it but this will confuse things as git stash is not going to save their state directly. They are likely just dirty from build files anyway. Ignore them in the diff-index command. Signed-off-by: Alex Bennée Reviewed-by: Eric Blake --- tests/docker/Make

Re: [Qemu-devel] [Qemu-trivial] [PATCH] unicore32: abort when entering "x 0" on the monitor

2017-08-07 Thread Eduardo Otubo
On Mon, Jul 31, 2017 at 01:17:03PM +0300, Michael Tokarev wrote: > 28.07.2017 14:51, Eduardo Otubo wrote: > > Starting Qemu with "qemu-system-unicore32 -M puv3,accel=qtest -S -nographic" > > and entering "x 0 " at the monitor prompt leads to abort(): > > Applied to -trivial, thanks! > Hi Michael

[Qemu-devel] [PATCH for 2.10 v3 5/6] docker: don't install device-tree-compiler build-deps in travis.docker

2017-08-07 Thread Alex Bennée
Installing the device-tree-compiler build-deps is a little extreme. We only actually need the binary so include it with the other packages. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- tests/docker/dockerfiles/travis.docker | 3 +-- 1 file changed, 1 insertion(+), 2 delet

[Qemu-devel] [PATCH for 2.10 v3 1/6] docker: ensure NOUSER for travis images

2017-08-07 Thread Alex Bennée
While adding the current user is a useful default behaviour for creating new images it is not appropriate for Travis which already has a default user. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/docker/Makefile.include | 1 + 1 fil

[Qemu-devel] [PATCH for 2.10 v3 4/6] docker: docker.py make --no-cache skip checksum test

2017-08-07 Thread Alex Bennée
If you invoke with NOCACHE=1 we pass --no-cache in the argv to docker.py but may still not force a rebuild if the dockerfile checksum hasn't changed. By testing for its presence we can force builds without having to manually remove the docker image. Signed-off-by: Alex Bennée --- tests/docker/do

[Qemu-devel] [PATCH for 2.10 v3 2/6] docker: fix dirty/stash detection on some systems

2017-08-07 Thread Alex Bennée
I reported this a while ago but evidently forgot to push the patch upstream. Without this I wasn't seeing the dirty tree state submitted to the docker build which is very confusing. Reference: Subject: [PATCH 1/6] tests/docker/Makefile.include: fix diff-index call Date: Fri, 28 Oct 2016 17:33:

[Qemu-devel] (no subject)

2017-08-07 Thread vaibhav shukla
Hello, I am Vaibhav Shukla, sophomore student of Indian Institute of Information Technology, Kalyani, India. I would like to contribute in some projects in your company, please guide me that how can I do so. I shall be highly grateful to you. Yours Sincerely

[Qemu-devel] [PATCH for 2.10 v3 0/6] Various docker fixes

2017-08-07 Thread Alex Bennée
Hi, I didn't get around to posting the pull-req before I went on holiday as there were some comments to address on "docker: reduce noise when building travis.docker". If there are no other comments I shall roll the pull request with this. Alex Bennée (6): docker: ensure NOUSER for travis images

[Qemu-devel] [PATCH for 2.10 v3 6/6] docker: reduce noise when building travis.docker

2017-08-07 Thread Alex Bennée
Set the DEBIAN_FRONTEND and locale env vars to stop apt complaining so much as we build the image. See the Travis build logs where it is done by their scripts. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé

Re: [Qemu-devel] [PATCH for-2.10] vmdk: Fix error handling/reporting of vmdk_check

2017-08-07 Thread Kevin Wolf
Am 04.08.2017 um 16:09 hat Fam Zheng geschrieben: > Errors from the callees must be captured and propagated to our caller, > ensure this for both find_extent() and bdrv_getlength(). > > Reported-by: Markus Armbruster > Signed-off-by: Fam Zheng Thanks, applied to the block branch. Kevin

Re: [Qemu-devel] [PATCH v7 2/6] qmp: Create IOThrottle structure

2017-08-07 Thread Markus Armbruster
Pradeep Jagadeesh writes: > On 7/6/2017 7:55 PM, Markus Armbruster wrote: >> Pradeep Jagadeesh writes: >> >>> This patch enables qmp interfaces for the fsdev >>> devices. This provides two interfaces one >>> for querying info of all the fsdev devices. The second one >>> to set the IO limits for

Re: [Qemu-devel] [RFC PATCH 56/56] crypto: Make QCryptoBlockInfoLUKS offsets unsigned in QAPI/QMP

2017-08-07 Thread Daniel P. Berrange
On Mon, Aug 07, 2017 at 04:46:00PM +0200, Markus Armbruster wrote: > Byte offsets should use QAPI type 'size' (uint64_t). > QCryptoBlockInfoLUKS member @payload-offset and > QCryptoBlockInfoLUKSSlot member @key-offset are 'int' (int64_t). > qcrypto_block_luks_get_info() gets the former QCryptoBlock

Re: [Qemu-devel] [Qemu-block] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-07 Thread Eric Blake
On 08/07/2017 10:13 AM, Eric Blake wrote: > On 08/07/2017 07:56 AM, Vladimir Sementsov-Ogievskiy wrote: >> 07.08.2017 14:52, Eric Blake wrote: >>> On 08/04/2017 10:14 AM, Vladimir Sementsov-Ogievskiy wrote: Set reply.handle to 0 on error path to prevent normal path of nbd_co_receive_reply

[Qemu-devel] [RFC PATCH 55/56] block: Make MapEntry offsets and size unsigned in QAPI

2017-08-07 Thread Markus Armbruster
File offsets and sizes use QAPI type 'size' (uint64_t). MapEntry members @start, @length and @offset are 'int' (int64_t). get_block_status() sets @start and @length to unsigned long long values, and @offset to a non-negative int64_t value. Change these MapEntry members to 'size'. "qemu-img map"

[Qemu-devel] [RFC PATCH 41/56] blockjob: Lift speed sign conversion out of mirror_start_job()

2017-08-07 Thread Markus Armbruster
mirror_start_job() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. mirror_start_job() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of mirror_start_job() into its callers. I'm going to lift it further until it falls off

Re: [Qemu-devel] [PATCH 06/17] block/nbd-client: fix nbd_read_reply_entry

2017-08-07 Thread Eric Blake
On 08/07/2017 07:56 AM, Vladimir Sementsov-Ogievskiy wrote: > 07.08.2017 14:52, Eric Blake wrote: >> On 08/04/2017 10:14 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Set reply.handle to 0 on error path to prevent normal path of >>> nbd_co_receive_reply. Side note: in general, our server must allow

[Qemu-devel] [RFC PATCH 14/56] migration: Fix migrate-set-cache-size error reporting

2017-08-07 Thread Markus Armbruster
qmp_migrate_set_cache_size() calls xbzrle_cache_resize() to do the actual work, which in turn calls cache_init() to resize the cache. If cache_init() fails, xbzrle_cache_resize() reports that error with error_report() and fails. qmp_migrate_set_cache_size() detects the failure and reports "Parame

[Qemu-devel] [RFC PATCH 38/56] blockjob: Lift speed sign conversion out of block_job_set_speed()

2017-08-07 Thread Markus Armbruster
The BlockJob abstraction takes int64_t speed. The underlying RateLimit abstraction takes uint64_t. We convert from int64_t to uint64_t in block_job_set_speed(). It rejects negative speed. Lift this check and conversion up into its callers qmp_block_job_set_speed() and block_job_create(). I'm g

[Qemu-devel] [RFC PATCH 28/56] block: Widen dirty bitmap granularity to uint64_t for safety

2017-08-07 Thread Markus Armbruster
Block dirty bitmaps represent granularity in bytes as uint32_t. It must be a power of two and a multiple of BDRV_SECTOR_SIZE. The trouble with uint32_t is computations like this one in mirror_do_read(): uint64_t max_bytes; max_bytes = s->granularity * s->max_iov; The operands of * are

[Qemu-devel] [Bug 1626972] Re: QEMU memfd_create fallback mechanism change for security drivers

2017-08-07 Thread James Page
** Changed in: cloud-archive/mitaka Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1626972 Title: QEMU memfd_create fallback mechanism change for securit

[Qemu-devel] [RFC PATCH 51/56] block/nfs: Fix for readahead-size, page-cache-size > INT64_MAX

2017-08-07 Thread Markus Armbruster
nfs_client_open() implicitly converts the uint64_t value of qemu_opt_get_number() to int64_t, then clamps it to range. The clamping is broken for negative values. Fix by making NFSClient members @readahead and @pagecache uint64_t. Signed-off-by: Markus Armbruster --- block/nfs.c | 7 --- 1

[Qemu-devel] [RFC PATCH 42/56] blockjob: Lift speed sign conversion out of stream_start()

2017-08-07 Thread Markus Armbruster
stream_start() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. stream_start() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of stream_start() into its caller. I'm going to lift it further until it falls off the top. Sign

Re: [Qemu-devel] [PATCH v7 0/6] fsdev: qmp interface for io throttling

2017-08-07 Thread Markus Armbruster
Pradeep Jagadeesh writes: > On 7/7/2017 8:14 AM, Markus Armbruster wrote: >> Pradeep Jagadeesh writes: >> >>> These patches provide the qmp interface, to query the io throttle >>> status of the all fsdev devices that are present in a vm. >>> also, it provides an interface to set the io throttle

[Qemu-devel] [RFC PATCH 20/56] block: Make ImageInfo sizes unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). ImageInfo members @virtual-size, @actual-size, @cluster-size are 'int' (int64_t). bdrv_query_image_info() gets their values from bdrv_getlength(), bdrv_get_allocated_file_size(), bdrv_get_info(), all signed. It ensures the former two are non-negative,

[Qemu-devel] [RFC PATCH 56/56] crypto: Make QCryptoBlockInfoLUKS offsets unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte offsets should use QAPI type 'size' (uint64_t). QCryptoBlockInfoLUKS member @payload-offset and QCryptoBlockInfoLUKSSlot member @key-offset are 'int' (int64_t). qcrypto_block_luks_get_info() gets the former QCryptoBlock member @payload_offset, implicitly converting from uint64_t, and computes

[Qemu-devel] [RFC PATCH 46/56] blockjob: Make job commands' speed parameter unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte rates should use QAPI type 'size' (uint64_t). drive-backup, blockdev-backup, block-commit, drive-mirror, blockdev-mirror, block-stream and block-job-set-speed parameter @size is 'int' (int64_t). Their QMP command handlers all ensure it's non-negative before they pass it on to the next lower

[Qemu-devel] [RFC PATCH 47/56] blockjob: Make BlockJobInfo and event offsets unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
File offsets should use QAPI type 'size' (uint64_t). BlockJobInfo members @len, offset and parameters @len, @offset of events BLOCK_JOB_COMPLETED, BLOCK_JOB_CANCELLED, BLOCK_JOB_READY are 'int' (int64_t). block_job_query(), block_job_event_completed(), block_job_event_cancelled(), block_job_event

[Qemu-devel] [RFC PATCH 49/56] block: Make ImageCheck file offset unsigned in QAPI

2017-08-07 Thread Markus Armbruster
File offsets should use QAPI type 'size' (uint64_t). ImageCheck member @image-end-offset is 'int' (int64_t). collect_image_check() gets it from BdrvCheckResult member @image_end_offset (also int64_t, should never be negative). Change the ImageCheck member to 'size', for QAPI/QMP consistency. Si

[Qemu-devel] [RFC PATCH 53/56] block: Make blockdev-add byte counts unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
File offsets, sizes and alignments should use QAPI type 'size' (uint64_t). blockdev-add parameters are 'int' (int64_t): BlockdevOptionsNull member @size; BlockdevOptionsQcow2 members @cache-size, @l2-cache-size, @refcount-cache-size; BlockdevOptionsNfs members @readahead-size, @page-cache-size; Bl

[Qemu-devel] [RFC PATCH 40/56] blockjob: Lift speed sign conversion out of backup_job_create()

2017-08-07 Thread Markus Armbruster
backup_job_create() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. backup_job_create() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of backup_job_create() into its callers. I'm going to lift it further until it falls o

[Qemu-devel] [RFC PATCH 50/56] block: Make BLOCK_IMAGE_CORRUPTED offset, size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
File offsets should use QAPI type 'size' (uint64_t). BLOCK_IMAGE_CORRUPTED parameters @offset and @size are 'int' (int64_t). qcow2_signal_corruption() passes non-negative int64_t values. Change the event parameters to 'size', for QAPI/QMP consistency. Signed-off-by: Markus Armbruster --- qapi/

[Qemu-devel] [RFC PATCH 54/56] qemu-img: blk_getlength() can fail, fix img_map() to check

2017-08-07 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qemu-img.c | 4 1 file changed, 4 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index 3ae5fe3..cf3ef3e 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2838,6 +2838,10 @@ static int img_map(int argc, char **argv) } length = blk_getlength(blk

Re: [Qemu-devel] [PATCH v7 6/6] fsdev: QMP interface for throttling

2017-08-07 Thread Markus Armbruster
Pradeep Jagadeesh writes: > On 7/6/2017 8:47 PM, Markus Armbruster wrote: >> Pradeep Jagadeesh writes: >> >>> This patch introduces qmp interfaces for the fsdev >>> devices. This provides two interfaces one >>> for querying info of all the fsdev devices. The second one >>> to set the IO limits f

[Qemu-devel] [RFC PATCH 27/56] block/dirty-bitmap: Clean up signed vs. unsigned dirty counts

2017-08-07 Thread Markus Armbruster
hbitmap_count() returns uint64_t. Clean up test-hbitmap.c to check its value with g_assert_cmpuint() instead of g_assert_cmpint(). bdrv_get_dirty_count() and bdrv_get_meta_dirty_count() return its value converted to int64_t. Clean them up to return it unadulterated. This moves the implicit conv

[Qemu-devel] [RFC PATCH 12/56] pc-dimm: Make size and address unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes and addresses should use QAPI type 'size' (uint64_t). PCDIMMDeviceInfo members @addr and @size are 'int' (int64_t). qmp_pc_dimm_device_list() implicitly converts from uint64_t. Change these PCDIMMDeviceInfo members to 'size'. query-memory-devices now reports sizes and addresses above 2^63-1

[Qemu-devel] [RFC PATCH 30/56] block: Make write thresholds unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
File offsets should use QAPI type 'size' (uint64_t). block-set-write-threshold parameter @write-threshold is 'int' (int64_t). qmp_block_set_write_threshold() passes it on to bdrv_write_threshold_set(), implicitly converting to uint64_t. BLOCK_WRITE_THRESHOLD parameters @write-threshold, @amount-ex

[Qemu-devel] [RFC PATCH 07/56] cpus: Make memsave, pmemsave sizes, addresses unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes, virtual and physical addresses should use QAPI type 'size' (uint64_t). memsave, pmemsave parameters @val, @size are 'int' (int64_t). qmp_memsave() and qmp_pmemsave() implicitly convert to target_ulong or hwaddr. Change the parameters to 'size'. Both commands now accept size and address v

[Qemu-devel] [RFC PATCH 26/56] block: Make BlockMeasureInfo sizes unsigned in QAPI

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). BlockMeasureInfo members @required and @fully-allocated are 'int' (int64_t). qcow2_measure() computes their values from qcow2_calc_prealloc_size(), @virtual_size and @required, all uint64_t (the former only since the previous commit). raw_measure() c

[Qemu-devel] [RFC PATCH 44/56] blockjob: Lift speed sign conversion out of blockdev_mirror_common()

2017-08-07 Thread Markus Armbruster
blockdev_mirror_common() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. blockdev_mirror_common() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of blockdev_mirror_common() into its callers. I'm going to lift it further u

[Qemu-devel] [RFC PATCH 34/56] block: Make BlockDeviceStats sizes, offsets unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte counts and file offsets should use QAPI type 'size' (uint64_t). BlockDeviceStats members @rd_bytes, @wr_bytes and @wr_highest_offset are 'int' (int64_t). bdrv_query_blk_stats() gets them from BlockAcctStats member nr_bytes[] and stat64_get(), implicitly converting from uint64_t. Change all t

[Qemu-devel] [RFC PATCH 10/56] hmp: Make balloon's argument unsigned

2017-08-07 Thread Markus Armbruster
The previous commit made it unsigned in QMP. Switch HMP's args_type from 'M' to 'o'. Loses support for expressions (QEMU pocket calculator), gains support for units other than mebibytes. Negative values are no longer accepted and interpreted modulo 2^64. Instead, values between 2^63 and 2^64-1

[Qemu-devel] [RFC PATCH 52/56] block/nfs: Reject negative readahead-size, page-cache-size

2017-08-07 Thread Markus Armbruster
The nfs block driver uses QEMU_OPT_NUMBER for these sizes. All other block drivers use QEMU_OPT_SIZE. Both are uint64_t, but QEMU_OPT_SIZE rejects negative numbers, while QEMU_OPT_NUMBER interprets them modulo 2^64. Switch the nfs block driver to QEMU_OPT_SIZE. Signed-off-by: Markus Armbruster

[Qemu-devel] [RFC PATCH 29/56] block: Make BlockDirtyInfo byte count unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte counts should use QAPI type 'size' (uint64_t). BlockDirtyInfo member @count is 'int' (int64_t). bdrv_query_dirty_bitmaps() computes @count from bdrv_get_dirty_count() in uint64_t, then implicitly converts to int64_t. Before the commit before previous, the conversion was in bdrv_get_dirty_co

[Qemu-devel] [RFC PATCH 48/56] block: Make mirror buffer size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte counts should use QAPI type 'size' (uint64_t). Parameter @buf-size of drive-mirror and blockdev-mirror is 'int' (int64_t). The underlying MirrorBlockJob abstraction takes size_t. mirror_start_job() converts from int64_t to size_t, rejecting negative sizes (but not values exceeding SIZE_MAX).

[Qemu-devel] [RFC PATCH 08/56] dump: Make sizes and addresses unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes, virtual and physical addresses should use QAPI type 'size' (uint64_t). dump-guest-memory parameters @begin, @length are 'int' (int64_t). They get implicitly converted to unsigned types somewhere down in the bowels of the dump machinery. DumpQueryResult members @completed and @total are al

[Qemu-devel] [RFC PATCH 45/56] blockjob: Lift speed sign conversion out of commit_start() etc.

2017-08-07 Thread Markus Armbruster
commit_start() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. commit_start() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of commit_start() and commit_active_start() into their caller qmp_block_commit(). I'm going to l

[Qemu-devel] [RFC PATCH 32/56] hmp: Make block_set_io_throttle's arguments unsigned

2017-08-07 Thread Markus Armbruster
The previous commit made them unsigned in QMP. Switch HMP's args_type from 'l' to 'o'. Loses support for expressions (QEMU pocket calculator), gains support for unit suffixes. Negative values are no longer accepted and interpreted modulo 2^64. Instead, values between 2^63 and 2^64-1 are now acc

[Qemu-devel] [RFC PATCH 33/56] block: Make block_resize size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). block_resize parameter @size is 'int' (int64_t). qmp_block_resize() ensures it's non-negative before it passes it on to blk_truncate(). Change parameter @size to 'size', and update the range check accordingly. Just cleanup; block_resize accepts the

[Qemu-devel] [RFC PATCH 06/56] char: Don't truncate -chardev and HMP chardev-add ringbuf size

2017-08-07 Thread Markus Armbruster
qemu_chr_parse_ringbuf() initializes the new ChardevRingbuf's @size to the value of qemu_opt_get_size(). Except it first truncates the value from uint64_t to int. Fix that, so you can waste your RAM on multi-gigabyte ring buffers. Signed-off-by: Markus Armbruster --- chardev/char-ringbuf.c | 8

[Qemu-devel] [RFC PATCH 36/56] blockjob: Drop unused parameter @errp of method set_speed()

2017-08-07 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- block/backup.c | 2 +- block/commit.c | 2 +- block/mirror.c | 2 +- block/stream.c | 2 +- blockjob.c | 9 + include/block/blockjob_int.h | 2 +- 6 files changed, 6 insertions(+

[Qemu-devel] [RFC PATCH 23/56] option: Fix type of qemu_opt_set_number() parameter @val

2017-08-07 Thread Markus Armbruster
Parameter @val is int64_t. It's assigned to opt->value.uint, which is uint64_t, because that's what QemuOpts integers are. Screwed up when the function was added in commit b83c18e. Change @val to uint64_t. Signed-off-by: Markus Armbruster --- include/qemu/option.h | 2 +- util/qemu-option.c

[Qemu-devel] [RFC PATCH 39/56] blockjob: Lift speed sign conversion out of block_job_create()

2017-08-07 Thread Markus Armbruster
block_job_create() takes int64_t speed. The underlying RateLimit abstraction takes uint64_t. block_job_create() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of block_job_create() into its callers. I'm going to lift it further until it falls off

[Qemu-devel] [RFC PATCH 18/56] migration: Make parameter max-bandwidth unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Byte rates should use QAPI type 'size' (uint64_t). migrate_set_speed's parameter @value and member @max-bandwidth of MigrationParameters and MigrateSetParameters are 'int' (int64_t). Change them all to 'size'. migrate_set_speed and migrate-set-parameters now accept bandwidth values between 2^63 a

[Qemu-devel] [RFC PATCH 22/56] block: Mix up signed and unsigned less in bdrv_img_create()

2017-08-07 Thread Markus Armbruster
@size is declared int64_t. It's set in two places. The second one assigns the (signed) value of bdrv_getlength(), then errors out if its negative. The first one assigns qemu_opt_get_size(opts, BLOCK_OPT_SIZE, 0), i.e. an uint64_t value. What if it exceeds INT64_MAX? Is that even possible? Tur

[Qemu-devel] [RFC PATCH 02/56] qdict: New helpers to put and get unsigned integers

2017-08-07 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qmp/qdict.h | 5 + qobject/qdict.c | 43 --- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index 363e431..3b52481 100644 --

[Qemu-devel] [RFC PATCH 43/56] blockjob: Lift speed sign conversion out of mirror_start()

2017-08-07 Thread Markus Armbruster
mirror_start() takes int64_t speed. The underlying BlockJob abstraction takes uint64_t. mirror_start() converts from int64_t to uint64_t, rejecting negative speed. Lift this check and conversion out of mirror_start() into its caller. I'm going to lift it further until it falls off the top. Sign

<    1   2   3   4   >