Re: [Qemu-devel] [Qemu-block] [PATCH] block: drop bdrv_set_key from BlockDriver

2017-08-07 Thread Kevin Wolf
Am 04.08.2017 um 17:26 hat Paolo Bonzini geschrieben: > This is not used anymore since c01c214b69 ("block: remove all encryption > handling APIs", 2017-07-11). > > Signed-off-by: Paolo Bonzini Thanks, applied to the block branch. Kevin

Re: [Qemu-devel] [PATCH v7 0/4] Unit test+fix for problem with QEMU handling of multiple bind()s to the same port

2017-08-07 Thread Daniel P. Berrange
On Mon, Aug 07, 2017 at 12:58:38PM +0200, Knut Omang wrote: > This series contains: > * a unit test that exposes a race condition which causes QEMU to fail > to find a port even when there is plenty of available ports. > * a refactor of the qemu-sockets inet_listen_saddr() function > to better

Re: [Qemu-devel] [Qemu-block] [PATCH] block/null: Remove 'filename' option

2017-08-07 Thread Kevin Wolf
Am 04.08.2017 um 16:56 hat Eric Blake geschrieben: > On 08/04/2017 09:43 AM, Kevin Wolf wrote: > > This option was only added to allow 'null-co://' and 'null-aio://' as > > filenames, its value never served any actual purpose and was ignored. > > Nevertheless it was accepted as '-drive driver=null,

Re: [Qemu-devel] [PATCH v2 for-2.10 2/4] block/vhdx: check for offset overflow to bdrv_truncate()

2017-08-07 Thread Philippe Mathieu-Daudé
On Mon, Aug 7, 2017 at 9:38 AM, Jeff Cody wrote: > VHDX uses uint64_t types for most offsets, following the VHDX spec. > However, bdrv_truncate() takes an int64_t value for the truncating > offset. Check for overflow before calling bdrv_truncate(). > > While we are here, replace the bit shifting

Re: [Qemu-devel] [PATCH v2] kvm: workaround build break on gcc-7.1.1 / fedora26

2017-08-07 Thread Philippe Mathieu-Daudé
On Mon, Aug 7, 2017 at 8:55 AM, Paolo Bonzini wrote: > On 07/08/2017 13:36, Greg Kurz wrote: >> Building QEMU on fedora26 with the latest gcc package fails: >> >> CC ppc64-softmmu/target/ppc/kvm.o >> In file included from include/sysemu/hw_accel.h:16:0, >> from target/ppc/k

Re: [Qemu-devel] [PATCH v4 00/22] Clean up around qmp() and hmp()

2017-08-07 Thread Philippe Mathieu-Daudé
On Mon, Aug 7, 2017 at 4:33 AM, Fam Zheng wrote: > On Mon, 08/07 14:43, Fam Zheng wrote: >> On Fri, 08/04 20:10, Fam Zheng wrote: >> > On Fri, 08/04 06:50, Eric Blake wrote: >> > > On 08/03/2017 08:54 PM, no-re...@patchew.org wrote: >> > > > Hi, >> > > > >> > > > This series failed automatic build

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

2017-08-07 Thread Vladimir Sementsov-Ogievskiy
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) --- /work/src/qemu/master/tests/qemu-iotests/185.out2017-07-14 \ 15:14:29.520343805 +0300

Re: [Qemu-devel] [PATCH v4 7/9] s390x/pci: fence off instructions for non-pci

2017-08-07 Thread David Hildenbrand
On 07.08.2017 11:52, Cornelia Huck wrote: > On Fri, 4 Aug 2017 15:17:25 +0200 > David Hildenbrand wrote: > >> On 04.08.2017 13:29, Cornelia Huck wrote: >>> If a guest running on a machine without zpci issues a pci instruction, >>> throw them an exception. >>> >>> Reviewed-by: Thomas Huth >>> Sig

Re: [Qemu-devel] [PATCH v2 1/4] i386/kvm: use a switch statement for MSR detection

2017-08-07 Thread David Hildenbrand
On 07.08.2017 10:57, Ladi Prosek wrote: > Switch is easier on the eye and might lead to better codegen. > > Signed-off-by: Ladi Prosek > --- > target/i386/kvm.c | 75 > +++ > 1 file changed, 31 insertions(+), 44 deletions(-) > > diff --git a/

Re: [Qemu-devel] [PATCH v2 3/4] i386/kvm: introduce tsc_is_stable_and_known()

2017-08-07 Thread David Hildenbrand
On 07.08.2017 10:57, Ladi Prosek wrote: > Move the "is TSC stable and known" condition to a reusable helper. > > Signed-off-by: Ladi Prosek > --- > target/i386/kvm.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/target/i386/kvm.c b/target/i386/kvm.c > i

Re: [Qemu-devel] [PATCH v2 1/4] i386/kvm: use a switch statement for MSR detection

2017-08-07 Thread Ladi Prosek
On Mon, Aug 7, 2017 at 4:19 PM, David Hildenbrand wrote: > On 07.08.2017 10:57, Ladi Prosek wrote: >> Switch is easier on the eye and might lead to better codegen. >> >> Signed-off-by: Ladi Prosek >> --- >> target/i386/kvm.c | 75 >> +++ >> 1

Re: [Qemu-devel] [PATCH v2 4/4] i386/kvm: advertise Hyper-V frequency MSRs

2017-08-07 Thread David Hildenbrand
On 07.08.2017 10:57, Ladi Prosek wrote: > As of kernel commit eb82feea59d6 ("KVM: hyperv: support > HV_X64_MSR_TSC_FREQUENCY > and HV_X64_MSR_APIC_FREQUENCY"), KVM supports two new MSRs which are required > for nested Hyper-V to read timestamps with RDTSC + TSC page. > > This commit makes QEMU ad

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

2017-08-07 Thread Eric Blake
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.bad) > --- /work/src/qemu

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

2017-08-07 Thread Igor Mammedov
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 we do with SeaBIOS and other roms? PS: Mostly I'm interested in having AVMF ROM in QEMU, to make testin

[Qemu-devel] [PATCH 1/2] loader: Handle ELF files with overlapping zero-initialized data

2017-08-07 Thread Peter Maydell
For embedded systems, notably ARM, one common use of ELF file segments is that the 'physical addresses' represent load addresses and the 'virtual addresses' execution addresses, such that the load addresses are packed into ROM or flash, and the relocation and zero-initialization of data is done at

[Qemu-devel] [PATCH 2/2] loader: Ignore zero-sized ELF segments

2017-08-07 Thread Peter Maydell
Some ELF files have program headers that specify segments that are of zero size. Ignore them, rather than trying to create zero-length ROM blobs for them, because the zero-length blob can falsely trigger the overlapping-ROM-blobs check. Signed-off-by: Peter Maydell --- include/hw/elf_ops.h | 24

[Qemu-devel] [PATCH 0/2] loader: Handle ELF files with overlapping zero-init data

2017-08-07 Thread Peter Maydell
For embedded systems, notably ARM, one common use of ELF file segments is that the 'physical addresses' represent load addresses and the 'virtual addresses' execution addresses, such that the load addresses are packed into ROM or flash, and the relocation and zero-initialization of data is done at

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

2017-08-07 Thread Peter Maydell
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 we do with SeaBIOS and other roms? I suspect

[Qemu-devel] [RFC PATCH 09/56] balloon: Make balloon size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). balloon parameter @value is 'int' (int64_t). qmp_balloon() implicitly converts to ram_addr_t, i.e. uint64_t. BALLOON_CHANGE parameter @actual and BalloonInfo member @actual are also 'int'. virtio_balloon_set_config() and virtio_balloon_stat() implici

[Qemu-devel] [RFC PATCH 13/56] pci: Make PCI addresses and sizes unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes and addresses should use QAPI type 'size' (uint64_t). PciMemoryRegion members @address and @size are 'int' (int64_t). qmp_query_pci_regions() implicitly converts from pcibus_t, i.e. uint64_t. Change these PciMemoryRegion members to 'size'. query-pci now reports sizes and addresses above 2^6

[Qemu-devel] [RFC PATCH 05/56] char: Make ringbuf size unsigned in QAPI

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). ChardevRingbuf member @size is 'int' (int64_t). Doesn't really matter, as its users chardev-add and chardev-change manually reject sizes that aren't powers of two. Change the ChardevRingbuf member to 'size' anyway. Signed-off-by: Markus Armbruster

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

2017-08-07 Thread Markus Armbruster
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 to use uint64_t or size_t for cach

[Qemu-devel] [RFC PATCH 04/56] char: Make ringbuf-read size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). ringbuf-read parameter @size is 'int' (int64_t). qmp_ringbuf_read() rejects negative values, then implicitly converts to size_t. Change the parameter to 'size' and drop the check for negative values. ringbuf-read now accepts size values between 2^63

[Qemu-devel] [RFC PATCH 11/56] monitor: Drop unused HMP .args_type 'M'

2017-08-07 Thread Markus Armbruster
The previous commit switched balloon from 'M' to 'o', rendering 'M' unused. It was never used for anything else. Drop it. Signed-off-by: Markus Armbruster --- monitor.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/monitor.c b/monitor.c index 8b54ba1..3b2757e

[Qemu-devel] [RFC PATCH 03/56] monitor: Rewrite comment describing HMP .args_type

2017-08-07 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- monitor.c | 75 +++ 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/monitor.c b/monitor.c index e0f8801..8b54ba1 100644 --- a/monitor.c +++ b/monitor.c @@ -85,37 +85,56 @@ #endif /

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

2017-08-07 Thread Markus Armbruster
Byte rates should use QAPI type 'size' (uint64_t). BlockJobInfo member @speed and parameter @speed 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_ready() all get

[Qemu-devel] [RFC PATCH 01/56] qobject: Touch up comments to say @param instead of 'param'

2017-08-07 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/qdict.c | 68 - qobject/qlist.c | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/qobject/qdict.c b/qobject/qdict.c index 576018e..d795079 100644 --- a/qobject/qdict.c +++

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

2017-08-07 Thread Markus Armbruster
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 'size' and clean up save_xbzrle_page().

[Qemu-devel] [RFC PATCH 00/56] qapi: Use 'size' for byte counts & offsets

2017-08-07 Thread Markus Armbruster
Byte sizes, offsets and the like should use QAPI type 'size' (uint64_t). This rule is more honored in the breach than in the observance. Fix the obvious offenders. The series is RFC for at least two reasons: 1. It's only lightly tested. Commit message claims like "FOO now works" haven't bee

[Qemu-devel] [RFC PATCH 35/56] blockjob: Lift speed sign conversion into 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 the BlockJobDriver speed_set() methods. They all reject negative speed. Lift this check and conversion up into the method's caller block_job_set_speed(). I'

[Qemu-devel] [RFC PATCH 21/56] block: Clean up get_human_readable_size()

2017-08-07 Thread Markus Armbruster
get_human_readable_size() formats all negative numbers as if they were small. The previous two commits changed all callers to pass unsigned arguments. Change the parameter type to from int64_t to uint64_t. Also change the buffer size parameter from int (ahem!) to size_t. Signed-off-by: Markus A

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

2017-08-07 Thread Markus Armbruster
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 implicitly convert from unsigned ty

[Qemu-devel] [RFC PATCH 31/56] block: Make throttle byte rates and sizes unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes and byte rates should use QAPI type 'size' (uint64_t). BlockIOThrottle and BlockDeviceInfo members @bps, @bps_rd, @bps_wr, @bps_max, @bps_rd_max, @bps_wr_max, @iops_size are 'int' (int64_t). qmp_block_set_io_throttle() and bdrv_block_device_info() copy @bps, @bps_rd, @bps_wr to / from LeakyBu

[Qemu-devel] [RFC PATCH 25/56] block/qcow2: Change qcow2_calc_prealloc_size() to uint64_t

2017-08-07 Thread Markus Armbruster
Change parameter @total_size and return value to uint64_t. Callers mix uint64_t and int64_t. Thus, the commit reduces, but does not eliminate implicit conversions. qcow2_create2() passes a (presumably non-negative) int64_t argument, then passes the result through a local variable to qemu_opt_set

[Qemu-devel] [RFC PATCH 24/56] block/qcow2: Change align_offset() to operate on uint64_t

2017-08-07 Thread Markus Armbruster
align_offset() mixes different widths, and its callers pass both signed and unsigned values. It's best to stick to unsigned when twiddling bits. Signed-off-by: Markus Armbruster --- block/qcow2.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/qcow2.h b/block/qcow

[Qemu-devel] [RFC PATCH 19/56] block: Make snapshot VM state size unsigned in QAPI/QMP

2017-08-07 Thread Markus Armbruster
Sizes should use QAPI type 'size' (uint64_t). SnapshotInfo member @vm-state-size is 'int' (int64_t). QEMUSnapshotInfo member @vm_state_size is uint64_t. bdrv_query_snapshot_info_list(), bdrv_image_info_dump(), qmp_blockdev_snapshot_delete_internal_sync() convert implicitly between the two. Chan

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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

[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 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 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 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 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 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 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 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,

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

[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] [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 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] [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 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

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

[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"

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

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] [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] [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

[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é

[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] (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 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] [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 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 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

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 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] [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

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

[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/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 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

[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 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/

<    1   2   3   4   >