Re: [Qemu-devel] [PATCHv2] Prevent segmentation fault in case of relative resolve of uri

2015-02-09 Thread Miroslav Rezanina
On Mon, Feb 09, 2015 at 12:31:18PM +0100, Paolo Bonzini wrote: > > > On 09/02/2015 11:47, mreza...@redhat.com wrote: > > From: Miroslav Rezanina > > > > It was possible to call strcmp with NULL argument, that can cause > > segmentation fault. Properly checking parameters to prevent this > > sit

Re: [Qemu-devel] [RFC PATCH v8 19/21] replay: initialization and deinitialization

2015-02-09 Thread Pavel Dovgaluk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 22/01/2015 09:53, Pavel Dovgalyuk wrote: > > This patch introduces the functions for enabling the record/replay and for > > freeing the resources when simulator closes. > > > > Signed-off-by: Pavel Dovgalyuk > > > }; > > > > /* Asynchronou

Re: [Qemu-devel] [RFC PATCH v8 19/21] replay: initialization and deinitialization

2015-02-09 Thread Paolo Bonzini
On 09/02/2015 13:59, Pavel Dovgaluk wrote: >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> On 22/01/2015 09:53, Pavel Dovgalyuk wrote: >>> This patch introduces the functions for enabling the record/replay and for >>> freeing the resources when simulator closes. >>> >>> Signed-off-by: Pave

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] openpic: convert to vmstate

2015-02-09 Thread Mark Cave-Ayland
On 09/02/15 12:43, Alexander Graf wrote: Hi Juan, > On 09.02.15 13:39, Juan Quintela wrote: >> Mark Cave-Ayland wrote: >>> Signed-off-by: Mark Cave-Ayland >>> --- >>> hw/intc/openpic.c | 253 >>> + >>> 1 file changed, 119 insertions(+), 134

Re: [Qemu-devel] Virtio Disk drivers and Microsoft clustering

2015-02-09 Thread Stefan Hajnoczi
On Mon, Feb 09, 2015 at 09:18:15AM +0800, Fam Zheng wrote: > On Fri, 02/06 11:23, Fam Zheng wrote: > > On Thu, 02/05 15:29, massimo buscato wrote: > > > Hi all! > > > > > > About virtio-scsi driver: > > > There are many problem to use it on windows 2012 cluster service. > > > > > > Every time you

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] openpic: convert to vmstate

2015-02-09 Thread Juan Quintela
Alexander Graf wrote: > Yes, please, just bump the version number and ignore all the legacy > cruft. OpenPIC state saving is broken for years, any old state that we > could potentially save is not usable anyway :) I didn't knew that bit O:-) Then you get a; Reviewed-by: Juan Quintela

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] openpic: convert to vmstate

2015-02-09 Thread Juan Quintela
Alexander Graf wrote: > On 09.02.15 13:39, Juan Quintela wrote: >> Mark Cave-Ayland wrote: >>> Signed-off-by: Mark Cave-Ayland >>> --- >>> hw/intc/openpic.c | 253 >>> + >>VMSTATE_UINT32_EQUAL(nb_cpus, OpenPICState), This change

Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] openpic: convert to vmstate

2015-02-09 Thread Juan Quintela
Mark Cave-Ayland wrote: > On 09/02/15 12:43, Alexander Graf wrote: > Ha! I did actually do this but I accidentally messed up a rebase just > before sending out the patchset so it got lost. But yes, I agree a > version bump to 3 should be sufficient here. > > Just to put this in context: before th

[Qemu-devel] [PATCH v4 1/3] acpi: update RSDP on guest access

2015-02-09 Thread Igor Mammedov
From: "Michael S. Tsirkin" RSDT offset can change across reboots and that makes immutable RSDP, which is build at startup, point to incorrect place in ACPI table blob. That results in BIOS corrupting tables and guest OS failing to find ACPI tables. We really should have put it in a ROM region, bu

[Qemu-devel] [PATCH v4 2/3] pc: acpi-build: update linker on guest access

2015-02-09 Thread Igor Mammedov
Linker table is build only once, so if later during tables rebuild sizes of other ACPI tables change pointers will be patched incorrectly due to wrong offsets in linker. Resulting in guest not being able to find ACPI tables. Fix it by updating 'linker' table with the rest of tables when firmware re

[Qemu-devel] [PATCH v4 0/3] pc: acpi-build: make linker & RSDP tables dynamic

2015-02-09 Thread Igor Mammedov
changes since v3: * split out linker changes * fix Michael's patch, by passing build_state to callback so it would actually do something * split out RSDP migration in separate patch * s/imutable/immutable/ Patches 1-2: fix reboot issue after bridge hotplug Patch 3: addresses RSDP readi

[Qemu-devel] [PATCH v4 3/3] pc: acpi-build: migrate RSDP table

2015-02-09 Thread Igor Mammedov
Makes sure that RSDP stays the same /i.e. matches ACPI tables blob in source/ if guest is migrated during RSDP reading or has been already shadowed by firmware. Fix applies only to new machine types starting from 2.3, so it won't break migration for old machine types. Signed-off-by: Igor Mammedov

Re: [Qemu-devel] [PATCH v2 1/2] target-mips: Rework ABIs to allow all required configurations

2015-02-09 Thread Maciej W. Rozycki
On Mon, 9 Feb 2015, Leon Alrae wrote: > > Rework the MIPS ABIs and CPU emulations available according to the > > following target list: > > > > - mips|mipsel -- 32-bit CPUs only, system and user emulation mode, > >o32 user ABI, > > > > - mips64|mips64el -- 32-bi

Re: [Qemu-devel] [PATCH v4 1/3] acpi: update RSDP on guest access

2015-02-09 Thread Marcel Apfelbaum
On 02/09/2015 03:59 PM, Igor Mammedov wrote: From: "Michael S. Tsirkin" RSDT offset can change across reboots and that makes immutable RSDP, which is build at startup, point to incorrect place in ACPI table blob. That results in BIOS corrupting tables and guest OS failing to find ACPI tables. W

Re: [Qemu-devel] [PATCH v4 2/3] pc: acpi-build: update linker on guest access

2015-02-09 Thread Marcel Apfelbaum
On 02/09/2015 03:59 PM, Igor Mammedov wrote: Linker table is build only once, so if later during tables rebuild sizes of other ACPI tables change pointers will be patched incorrectly due to wrong offsets in linker. Resulting in guest not being able to find ACPI tables. Fix it by updating 'linker'

Re: [Qemu-devel] [PATCH v4 3/3] pc: acpi-build: migrate RSDP table

2015-02-09 Thread Marcel Apfelbaum
On 02/09/2015 03:59 PM, Igor Mammedov wrote: Makes sure that RSDP stays the same /i.e. matches ACPI tables blob in source/ if guest is migrated during RSDP reading or has been already shadowed by firmware. Fix applies only to new machine types starting from 2.3, so it won't break migration for o

Re: [Qemu-devel] [PATCH] checkpatch: port fix from kernel "## is not a valid modifier"

2015-02-09 Thread Paolo Bonzini
On 09/02/2015 13:18, Christian Borntraeger wrote: > From: Andy Whitcroft > > checkpatch currently loops on fpu/softfloat.c > Turns out this is fixed in the Linux version of checkpatch. > > So this is a port of Andy Whitcrofts fix from Linux, > Original commit was commit 89a883530fe7 ("checkpat

Re: [Qemu-devel] [PATCH RFC v4 5/6] qemu-iotests: s390x: fix test 051

2015-02-09 Thread Max Reitz
On 2015-02-09 at 03:06, chen xiao guang wrote: On 02/05/2015 11:11 PM, Max Reitz wrote: On 2015-02-04 at 22:44, Xiao Guang Chen wrote: From: Mao Chuan Li The tests for device type "ide_cd" are skipped for the s390 platform. The default device id of hard disk on the s390 platform differs to t

Re: [Qemu-devel] [PATCH v2 1/2] target-mips: Rework ABIs to allow all required configurations

2015-02-09 Thread Peter Maydell
Added RTH to cc because IIRC you did the last lot of rearranging how we handle these "same CPU architecture, different ABI" variants of linux-user... On 9 February 2015 at 14:09, Maciej W. Rozycki wrote: > On Mon, 9 Feb 2015, Leon Alrae wrote: > >> > Rework the MIPS ABIs and CPU emulations availa

Re: [Qemu-devel] [PATCH v2] qemu-coroutine: segfault when restarting co_queue

2015-02-09 Thread Stefan Hajnoczi
On Mon, Feb 09, 2015 at 02:50:39PM +0800, Bin Wu wrote: > From: Bin Wu > > We tested VMs migration with their disk images by drive_mirror. With > migration, two VMs copyed large files between each other. During the > test, a segfault occured. The stack was as follow: > > (gdb) bt > qemu-coroutin

Re: [Qemu-devel] [PATCH 0/7] NUMA code cleanup

2015-02-09 Thread Eduardo Habkost
On Mon, Feb 09, 2015 at 10:16:08AM +0100, Paolo Bonzini wrote: > > > On 08/02/2015 19:51, Eduardo Habkost wrote: > > This cleans up some of the NUMA code: moves declarations to numa.h, rename > > some > > functions, and remove some existing code that was inside main(). > > > > Eduardo Habkost (

Re: [Qemu-devel] [PATCH] block:Fix FIXED base vpc be probed to raw format

2015-02-09 Thread Stefan Hajnoczi
On Sun, Feb 08, 2015 at 08:39:52PM +0800, Xiaodong Gong wrote: > When open the vpc snapshot based FIXED format, its backing file, > this FIXED vpc image, could be probed as a raw image, because that > the find_image_format just checkout the first sector. > > Add a re-probe for the last sector to F

[Qemu-devel] [PATCH] softfloat: roundAndPackFloat16 should return FPInfinity and FPMaxNormal based on overflow_to_inf.

2015-02-09 Thread Xiangyu Hu
Flag overflow_to_inf is specified by ARM manual to decide if FPInfinity(sign) or FPMaxNormal(sign) is returned. Current codepath fails to check it. Fixed by adding overflow_to_inf flag to return infinity when it's true and maxnormal otherwise. Signed-off-by: Xiangyu Hu --- fpu/softfloat.c | 12 +

Re: [Qemu-devel] [PATCH v2 2/3] iotests: Add "wait" functionality to _cleanup_qemu

2015-02-09 Thread Stefan Hajnoczi
On Fri, Feb 06, 2015 at 04:06:17PM -0500, Max Reitz wrote: > diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu > index 8e618b5..4e1996c 100644 > --- a/tests/qemu-iotests/common.qemu > +++ b/tests/qemu-iotests/common.qemu > @@ -187,13 +187,23 @@ function _launch_qemu() >

Re: [Qemu-devel] [PATCH] checkpatch: port fix from kernel "## is not a valid modifier"

2015-02-09 Thread Christian Borntraeger
Am 09.02.2015 um 15:31 schrieb Paolo Bonzini: > > > On 09/02/2015 13:18, Christian Borntraeger wrote: >> From: Andy Whitcroft >> >> checkpatch currently loops on fpu/softfloat.c >> Turns out this is fixed in the Linux version of checkpatch. >> >> So this is a port of Andy Whitcrofts fix from Lin

Re: [Qemu-devel] [PATCH v2 2/3] iotests: Add "wait" functionality to _cleanup_qemu

2015-02-09 Thread Max Reitz
On 2015-02-09 at 10:01, Stefan Hajnoczi wrote: On Fri, Feb 06, 2015 at 04:06:17PM -0500, Max Reitz wrote: diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu index 8e618b5..4e1996c 100644 --- a/tests/qemu-iotests/common.qemu +++ b/tests/qemu-iotests/common.qemu @@ -187,1

Re: [Qemu-devel] [PATCH] checkpatch: port fix from kernel "## is not a valid modifier"

2015-02-09 Thread Don Slutz
On 02/09/15 10:08, Christian Borntraeger wrote: > Am 09.02.2015 um 15:31 schrieb Paolo Bonzini: >> >> >> On 09/02/2015 13:18, Christian Borntraeger wrote: >>> From: Andy Whitcroft >>> >>> checkpatch currently loops on fpu/softfloat.c >>> Turns out this is fixed in the Linux version of checkpatch.

Re: [Qemu-devel] [PATCH 0/7] NUMA code cleanup

2015-02-09 Thread Paolo Bonzini
On 09/02/2015 15:53, Eduardo Habkost wrote: > Thanks! > > Do you think this should go through Michael's tree, like past NUMA > patches, or through yours? Through Michael's tree or yours :) Paolo

[Qemu-devel] [RFC PATCH] vpc: Ignore geometry for large images

2015-02-09 Thread Kevin Wolf
The CHS calculation as done per the VHD spec imposes a maximum image size of ~127 GB. Real VHD images exist that are larger than that. Apparently there are two separate non-standard ways to achieve this: You could use more heads than the spec does - this is the option that qemu-img create chooses.

Re: [Qemu-devel] [PATCH 0/7] NUMA code cleanup

2015-02-09 Thread Michael S. Tsirkin
On Mon, Feb 09, 2015 at 12:53:37PM -0200, Eduardo Habkost wrote: > On Mon, Feb 09, 2015 at 10:16:08AM +0100, Paolo Bonzini wrote: > > > > > > On 08/02/2015 19:51, Eduardo Habkost wrote: > > > This cleans up some of the NUMA code: moves declarations to numa.h, > > > rename some > > > functions, a

Re: [Qemu-devel] [PATCH 1/7] numa: Move NUMA declarations from sysemu.h to numa.h

2015-02-09 Thread Michael S. Tsirkin
On Sun, Feb 08, 2015 at 04:51:16PM -0200, Eduardo Habkost wrote: > Not all sysemu.h users need the NUMA declarations, and keeping them in a > separate file makes easier to see what are the interfaces provided by s/makes easier/makes it easier/ > numa.c. > > Signed-off-by: Eduardo Habkost > ---

Re: [Qemu-devel] [PATCH v4 03/17] spapr_rtas: add get/set-power-level RTAS interfaces

2015-02-09 Thread Nathan Fontenot
On 01/27/2015 06:42 PM, Michael Roth wrote: > Quoting Tyrel Datwyler (2015-01-27 16:05:52) >> On 01/27/2015 01:36 PM, Michael Roth wrote: >>> Quoting David Gibson (2015-01-26 23:24:11) On Sun, Jan 25, 2015 at 11:21:26PM -0600, Michael Roth wrote: > Quoting David Gibson (2015-01-16 00:21:55

Re: [Qemu-devel] [PATCH 7/7] target-mips: Add IEEE 754-2008 features support

2015-02-09 Thread Leon Alrae
On 09/12/2014 01:56, Maciej W. Rozycki wrote: > +if (info->elf_flags & EF_MIPS_NAN2008) > +env->active_fpu.fcr31 |= > +(1 << FCR31_NAN2008) & env->active_fpu.fcr31_rw_bitmask; > +else > +env->active_fpu.fcr31 &= > +~((1 << FCR3

[Qemu-devel] [PATCH v2 04/37] hw/usb-storage: Check whether BB is inserted

2015-02-09 Thread Max Reitz
Only call bdrv_key_required() on the BlockDriverState if the BlockBackend has an inserted medium. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- hw/usb/dev-storage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 45397

[Qemu-devel] [PATCH v2 07/37] block: Add blk_is_available()

2015-02-09 Thread Max Reitz
blk_is_available() returns true iff the BDS is inserted (which means blk_bs() is not NULL and bdrv_is_inserted() returns true) and if the tray of the guest device is closed. blk_is_inserted() is changed to return true only if blk_bs() is not NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake

[Qemu-devel] [PATCH v2 00/37] blockdev: BlockBackend and media

2015-02-09 Thread Max Reitz
This series reworks a lot regarding BlockBackend and media. It is essentially a v3 to the "blockdev: Add blockdev-change-medium with read-only option" series (which is in fact a part of this series), but of course does a lot more. Basically, this series allows empty BlockBackends, that is BBs with

[Qemu-devel] [PATCH v2 06/37] block: Make bdrv_is_inserted() return a bool

2015-02-09 Thread Max Reitz
Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake Signed-off-by: Max Reitz --- block.c| 12 +++- block/block-backend.c | 2 +- block/raw-posix.c | 10

[Qemu-devel] [PATCH v2 01/37] blockdev: Allow creation of BDS trees without BB

2015-02-09 Thread Max Reitz
If the "id" field is missing from the options given to blockdev-add, just omit the BlockBackend and create the BlockDriverState tree alone. However, if "id" is missing, "node-name" must be specified; otherwise, the BDS tree would no longer be accessible. Signed-off-by: Max Reitz --- blockdev.c

[Qemu-devel] [PATCH v2 03/37] hw/block/fdc: Implement tray status

2015-02-09 Thread Max Reitz
The tray of an FDD is open iff there is no medium inserted (there are only two states for an FDD: "medium inserted" or "no medium inserted"). This results in the tray being reported as open if qemu has been started with the default floppy drive, which breaks some tests. Fix them. Signed-off-by: M

[Qemu-devel] [PATCH v2 05/37] block: Fix BB AIOCB AioContext without BDS

2015-02-09 Thread Max Reitz
Fix the BlockBackend's AIOCB AioContext for aborting AIO in case there is no BDS. If there is no implementation of AIOCBInfo::get_aio_context() the AioContext is derived from the BDS the AIOCB belongs to. If that BDS is NULL (because it has been removed from the BB) this will not work. This patch

[Qemu-devel] [PATCH v2 08/37] block: Make bdrv_is_inserted() recursive

2015-02-09 Thread Max Reitz
If bdrv_is_inserted() is called on the top level BDS, it should make sure all nodes in the BDS tree are actually inserted. Signed-off-by: Max Reitz --- block.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index ee7dfba..dafa4b7 100644 --- a/block.c

[Qemu-devel] [PATCH v2 02/37] iotests: Only create BB if necessary

2015-02-09 Thread Max Reitz
Tests 071 and 081 test giving references in blockdev-add. It is not necessary to create a BlockBackend here, so omit it. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/071 | 50 ++ tests/qemu-iotests/071.out | 12 +++--

[Qemu-devel] [PATCH v2 17/37] block: Prepare remaining BB functions for NULL BDS

2015-02-09 Thread Max Reitz
There are several BlockBackend functions which, in theory, cannot fail. This patch makes them cope with the BlockDriverState pointer being NULL by making them fall back to some default action like ignoring the value in setters and returning the default in getters. Signed-off-by: Max Reitz --- bl

[Qemu-devel] [PATCH v2 09/37] block/quorum: Implement bdrv_is_inserted()

2015-02-09 Thread Max Reitz
bdrv_is_inserted() should be invoked recursively on the children of quorum. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/quorum.c | 16 1 file changed, 16 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index 437b122..7a75cea 100644 --- a/block/quorum.

[Qemu-devel] [PATCH v2 16/37] block: Fail requests to empty BlockBackend

2015-02-09 Thread Max Reitz
If there is no BlockDriverState in a BlockBackend or if the tray of the guest device is open, fail all requests (where that is possible) with -ENOMEDIUM. The reason the status of the guest device is taken into account is because once the guest device's tray is opened, any request on the same Block

[Qemu-devel] [PATCH v2 18/37] blockdev: Use BB for blockdev-backup transaction

2015-02-09 Thread Max Reitz
When preparing a blockdev-backup transaction, the BlockBackend should be used because there may be no medium associated to the BB (which would make bdrv_find() fail, whereas blk_by_name() does not). This does not make a real difference because blockdev-backup will fail without a medium anyway; how

[Qemu-devel] [PATCH v2 14/37] block: Add BlockBackendRootState

2015-02-09 Thread Max Reitz
This structure will store some of the state of the root BDS if the BDS tree is removed, so that state can be restored once a new BDS tree is inserted. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 26 ++ include/block/block_int.h

[Qemu-devel] [PATCH v2 21/37] blockdev: Do not create BDS for empty drive

2015-02-09 Thread Max Reitz
Do not use "rudimentary" BDSs for empty drives any longer (for freshly created drives). With this change, bdrv_close_all() has no effect on empty drives (whose media were not changed) any longer. This breaks some test outputs, fix them. After a follow-up patch, empty drives will generally use a N

[Qemu-devel] [PATCH v2 10/37] block: Move guest_block_size into BlockBackend

2015-02-09 Thread Max Reitz
guest_block_size is a guest device property so it should be moved into the interface between block layer and guest devices, which is the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c | 7 --- block/block-backend.c | 7 +-- include/block

[Qemu-devel] [PATCH v2 22/37] blockdev: Pull out blockdev option extraction

2015-02-09 Thread Max Reitz
Extract some of the blockdev option extraction code from blockdev_init() into its own function. This simplifies blockdev_init() and will allow reusing the code in a different function added in a follow-up patch. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockdev.c | 201 +

[Qemu-devel] [PATCH v2 19/37] block: Add blk_insert_bs()

2015-02-09 Thread Max Reitz
This function associates the given BlockDriverState with the given BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 16 include/sysemu/block-backend.h | 1 + 2 files changed, 17 insertions(+) diff --git a/block/block-backend.

[Qemu-devel] [PATCH v2 11/37] block: Remove wr_highest_sector from BlockAcctStats

2015-02-09 Thread Max Reitz
BlockAcctStats contains statistics about the data transferred from and to the device; wr_highest_sector does not fit in with the rest. Furthermore, those statistics are supposed to be specific for a certain device and not necessarily for a BDS (see the comment above bdrv_get_stats()); on the other

[Qemu-devel] [PATCH v2 33/37] hmp: Use blockdev-change-medium for change command

2015-02-09 Thread Max Reitz
Use separate code paths for the two overloaded functions of the 'change' HMP command, and invoke the 'blockdev-change-medium' QMP command if used on a block device (by calling qmp_blockdev_change_medium()). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- hmp.c | 27 +++-

[Qemu-devel] [PATCH v2 34/37] blockdev: read-only-mode for blockdev-change-medium

2015-02-09 Thread Max Reitz
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may

[Qemu-devel] [PATCH v2 27/37] blockdev: Add blockdev-remove-medium

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 25 + qapi/block-core.json | 15 +++ qmp-commands.hx | 45 + 3 files changed, 85 insertions(+) diff --git a/blockdev.c b/blockdev.c index eef8944..2544c6f 1006

[Qemu-devel] [PATCH v2 31/37] block: Inquire tray state before tray-moved events

2015-02-09 Thread Max Reitz
blk_dev_change_media_cb() is called for all potential tray movements; however, it is possible to request closing the tray but nothing actually happening (on a floppy disk drive without a medium). Thus, the actual tray status should be inquired before sending a tray-moved event (and an event should

[Qemu-devel] [PATCH v2 13/37] block: Move I/O status and error actions into BB

2015-02-09 Thread Max Reitz
These options are only relevant for the user of a whole BDS tree (like a guest device or a block job) and should thus be moved into the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c| 125 - block/backup

[Qemu-devel] [PATCH v2 36/37] iotests: More options for VM.add_drive()

2015-02-09 Thread Max Reitz
This patch allows specifying the interface to be used for the drive, and makes specifying a path optional (if the path is None, the "file" option will be omitted, thus creating an empty drive). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 9 ++--- 1 f

[Qemu-devel] [PATCH v2 15/37] block: Make some BB functions fall back to BBRS

2015-02-09 Thread Max Reitz
If there is no BDS tree attached to a BlockBackend, functions that can do so should fall back to the BlockBackendRootState structure (which are blk_is_read_only() and blk_get_flags(), because the read-only status and the "open flags" are part of the BBRS). Signed-off-by: Max Reitz Reviewed-by: Er

[Qemu-devel] [PATCH v2 35/37] hmp: Add read-only-mode option to change command

2015-02-09 Thread Max Reitz
Expose the new read-only-mode option of 'blockdev-change-medium' for the 'change' HMP command. Signed-off-by: Max Reitz --- hmp-commands.hx | 20 +--- hmp.c | 22 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/hmp-commands.hx b/hm

[Qemu-devel] [PATCH v2 37/37] iotests: Add test for change-related QMP commands

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/118 | 653 + tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 659 insertions(+) create mode 100755 tests/qemu-iotests/118 create mode 100644 tests/qemu-iotests

[Qemu-devel] [PATCH v2 32/37] qmp: Introduce blockdev-change-medium

2015-02-09 Thread Max Reitz
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by: Max Reitz --- blockdev.c| 7 --- inclu

[Qemu-devel] [PATCH v2 24/37] block: Add blk_remove_bs()

2015-02-09 Thread Max Reitz
This function removes the BlockDriverState associated with the given BlockBackend from that BB and sets the BDS pointer in the BB to NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 22 +- include/sysemu/block-backend.h | 1 + 2 fi

[Qemu-devel] [PATCH v2 23/37] blockdev: Allow more options for BB-less BDS tree

2015-02-09 Thread Max Reitz
Most of the options which blockdev_init() parses for both the BlockBackend and the root BDS are valid for just the root BDS as well (e.g. read-only). This patch allows specifying these options even if not creating a BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockdev.c |

Re: [Qemu-devel] [PATCH v2 2/3] iotests: Add "wait" functionality to _cleanup_qemu

2015-02-09 Thread Stefan Hajnoczi
On Mon, Feb 09, 2015 at 10:37:22AM -0500, Max Reitz wrote: > On 2015-02-09 at 10:01, Stefan Hajnoczi wrote: > >On Fri, Feb 06, 2015 at 04:06:17PM -0500, Max Reitz wrote: > >>diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu > >>index 8e618b5..4e1996c 100644 > >>--- a/test

[Qemu-devel] [PATCH v2 28/37] blockdev: Add blockdev-insert-medium

2015-02-09 Thread Max Reitz
And a helper function for that which directly takes a pointer to the BDS to be inserted instead of its node-name (which will be used for implementing 'change' using blockdev-insert-medium). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockdev.c | 43 ++

[Qemu-devel] [PATCH v2 30/37] blockdev: Implement change with basic operations

2015-02-09 Thread Max Reitz
Implement 'change' on block devices by calling blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium (a variation of that which does not need a node-name) and blockdev-close-tray. Signed-off-by: Max Reitz --- blockdev.c | 185 +

Re: [Qemu-devel] [PATCH v2 0/3] nbd: Drop BDS backpointer

2015-02-09 Thread Stefan Hajnoczi
On Fri, Feb 06, 2015 at 04:06:15PM -0500, Max Reitz wrote: > Right now, bdrv_swap() on NBD BDSs results in a segmentation fault > pretty much all of the time. This series fixes this. > > Note that this is not a common case, as bdrv_swap() is generally only > performed on root BDSs (there are excep

[Qemu-devel] [PATCH v2 29/37] blockdev: Implement eject with basic operations

2015-02-09 Thread Max Reitz
Implement 'eject' by calling blockdev-open-tray and blockdev-remove-medium. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockdev.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blockdev.c b/blockdev.c index 819a3c1..d4f7b9b 100644 --- a/blockdev.c +++ b

[Qemu-devel] [PATCH v2 26/37] blockdev: Add blockdev-close-tray

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 22 ++ qapi/block-core.json | 16 qmp-commands.hx | 35 +++ 3 files changed, 73 insertions(+) diff --git a/blockdev.c b/blockdev.c index 7d06230..eef8944 100644 --- a/blo

[Qemu-devel] [PATCH v2 20/37] block: Prepare for NULL BDS

2015-02-09 Thread Max Reitz
blk_bs() will not necessarily return a non-NULL value any more (unless blk_is_available() is true or it can be assumed to otherwise, e.g. because it is called immediately after a successful blk_new_with_bs() or blk_new_open()). Signed-off-by: Max Reitz --- block.c | 5 ++ block/qap

[Qemu-devel] [PATCH v2 25/37] blockdev: Add blockdev-open-tray

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 48 qapi/block-core.json | 23 +++ qmp-commands.hx | 39 +++ 3 files changed, 110 insertions(+) diff --git a/blockdev.c b/blockdev.c i

[Qemu-devel] [PATCH v2 12/37] block: Move BlockAcctStats into BlockBackend

2015-02-09 Thread Max Reitz
As the comment above bdrv_get_stats() says, BlockAcctStats is something which belongs to the device instead of each BlockDriverState. This patch therefore moves it into the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c | 16 block/

Re: [Qemu-devel] [PATCH v2 01/37] blockdev: Allow creation of BDS trees without BB

2015-02-09 Thread Eric Blake
On 02/09/2015 10:11 AM, Max Reitz wrote: > If the "id" field is missing from the options given to blockdev-add, > just omit the BlockBackend and create the BlockDriverState tree alone. > > However, if "id" is missing, "node-name" must be specified; otherwise, > the BDS tree would no longer be acce

Re: [Qemu-devel] [PATCH v2 03/37] hw/block/fdc: Implement tray status

2015-02-09 Thread Eric Blake
On 02/09/2015 10:11 AM, Max Reitz wrote: > The tray of an FDD is open iff there is no medium inserted (there are > only two states for an FDD: "medium inserted" or "no medium inserted"). > > This results in the tray being reported as open if qemu has been started > with the default floppy drive, w

Re: [Qemu-devel] Virtio Disk drivers and Microsoft clustering

2015-02-09 Thread Massimo Buscato
I use raw image on gfs2 ... Filesystem is shared on 2 red hat cluster node (centos 7). Il 09/feb/2015 14:46 "Stefan Hajnoczi" ha scritto: > On Mon, Feb 09, 2015 at 09:18:15AM +0800, Fam Zheng wrote: > > On Fri, 02/06 11:23, Fam Zheng wrote: > > > On Thu, 02/05 15:29, massimo buscato wrote: > > >

Re: [Qemu-devel] [PATCH v2 06/37] block: Make bdrv_is_inserted() return a bool

2015-02-09 Thread Eric Blake
On 02/09/2015 10:11 AM, Max Reitz wrote: > Make bdrv_is_inserted(), blk_is_inserted(), and the callback > BlockDriver.bdrv_is_inserted() return a bool. > > Suggested-by: Eric Blake > Signed-off-by: Max Reitz > --- > block.c| 12 +++- > block/block-backend.c

Re: [Qemu-devel] [PATCH v2 01/37] blockdev: Allow creation of BDS trees without BB

2015-02-09 Thread Max Reitz
On 2015-02-09 at 13:17, Eric Blake wrote: On 02/09/2015 10:11 AM, Max Reitz wrote: If the "id" field is missing from the options given to blockdev-add, just omit the BlockBackend and create the BlockDriverState tree alone. However, if "id" is missing, "node-name" must be specified; otherwise, t

[Qemu-devel] [Bug 1392504] Re: USB Passthrough is not working anymore

2015-02-09 Thread Serge Hallyn
@lj-keus if you turn off apparmor sudo /etc/init.d/apparmor stop sudo /etc/init.d/apparmor teardown does that fix the issue for you? (Please re-enable apparmor immediately after the test using sudo /etc/init.d/apparmor start sudo stop libvirt-bin sudo start libvirt-bin ) -- You received this

[Qemu-devel] [PATCH v2 00/22] block: Rework bdrv_close_all()

2015-02-09 Thread Max Reitz
Currently, bdrv_close_all() force-closes all BDSs with a BlockBackend, which can lead to data corruption (see the iotest added in the final patch of this series) and is most certainly very ugly. This series reworks bdrv_close_all() to notify all owners of a BlockBackend that they should release th

[Qemu-devel] [PATCH v2 03/22] iotests: Add test for eject under NBD server

2015-02-09 Thread Max Reitz
This patch adds a test for ejecting the BlockBackend an NBD server is connected to (the NBD server is supposed to stop). Signed-off-by: Max Reitz --- tests/qemu-iotests/096 | 89 ++ tests/qemu-iotests/096.out | 16 + tests/qemu-iotests/grou

[Qemu-devel] [PATCH v2 12/22] block: Add blk_next_inserted()

2015-02-09 Thread Max Reitz
This function skips to the next BlockBackend for which blk_is_inserted() is true. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 15 +++ include/sysemu/block-backend.h | 1 + 2 files changed, 16 insertions(+) diff --git a/block/block-backend.

[Qemu-devel] [PATCH v2 01/22] iotests: Move _filter_nbd into common.filter

2015-02-09 Thread Max Reitz
_filter_nbd can be useful for other NBD tests, too, therefore it should reside in common.filter, and it should support URLs of the "nbd://" format and export names. The NBD log lines ("/your/source/dir/nbd.c:function():line: error") should not be converted to empty lines but removed altogether. S

[Qemu-devel] [PATCH v2 07/22] block: Add bdrv_close_all() handlers

2015-02-09 Thread Max Reitz
Every time a reference to a BlockBackend is taken, a notifier for bdrv_close_all() has to be deposited so the reference holder can relinquish its reference when bdrv_close_all() is called. That notifier should be revoked on a bdrv_unref() call. Add a Notifier * parameter to all the functions chang

[Qemu-devel] [PATCH v2 17/22] block: Make bdrv_drain_one() public

2015-02-09 Thread Max Reitz
We will need it in block/block-backend.c. Signed-off-by: Max Reitz --- block.c | 2 +- include/block/block_int.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 8502957..3f3258c 100644 --- a/block.c +++ b/block.c @@ -1949,7 +1949,7

[Qemu-devel] [PATCH v2 02/22] iotests: Do not redirect qemu's stderr

2015-02-09 Thread Max Reitz
Redirecting qemu's stderr to stdout makes working with the stderr output difficult due to the other file descriptor magic performed in _launch_qemu ("ambiguous redirect"). There is no harm in leaving stderr on stderr, so do it. Signed-off-by: Max Reitz --- If someone has a better solution, espec

[Qemu-devel] [PATCH v2 05/22] block: Move BDS close notifiers into BB

2015-02-09 Thread Max Reitz
The only remaining user of the BDS close notifiers is NBD which uses them to determine when a BDS tree is being ejected. This patch removes the BDS-level close notifiers and adds a notifier list to the BlockBackend structure that is invoked whenever a BDS is removed. While it might make sense to ha

[Qemu-devel] [PATCH v2 22/22] iotests: Add test for multiple BB on BDS tree

2015-02-09 Thread Max Reitz
This adds a test for having multiple BlockBackends in one BDS tree. In this case, there is one BB for the protocol BDS and one BB for the format BDS in a simple two-BDS tree (with the protocol BDS and BB added first). When bdrv_close_all() is executed, no cached data from any BDS should be lost; t

[Qemu-devel] [PATCH v2 04/22] quorum: Fix close path

2015-02-09 Thread Max Reitz
bdrv_unref() can lead to bdrv_close(), which in turn will result in bdrv_drain_all(). This function will later be called blk_drain_all() and iterate only over the BlockBackends for which blk_is_inserted() holds true; therefore, bdrv_is_inserted() and thus quorum_is_inserted() will probably be calle

[Qemu-devel] [PATCH v2 11/22] block: Add blk_name_taken()

2015-02-09 Thread Max Reitz
There may be BlockBackends which are not returned by blk_by_name(), but do exist and have a name. blk_name_taken() allows testing whether a specific name is in use already, independent of whether the BlockBackend with that name is accessible through blk_by_name(). Signed-off-by: Max Reitz Reviewe

[Qemu-devel] [PATCH v2 08/22] block: Use blk_remove_bs() in blk_delete()

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index 98f4af9..bcad1dc 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -167,12 +

[Qemu-devel] [PATCH v2 13/22] block: Add blk_commit_all() and blk_invalidate_cache_all()

2015-02-09 Thread Max Reitz
These functions will be changed to iterate through the BDS trees as defined by the BlockBackends instead of the list of root BDS, therefore prepare moving their code to the BlockBackend level. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 10 ++ i

[Qemu-devel] [PATCH v2 06/22] block: Add bdrv_close_all() notifiers

2015-02-09 Thread Max Reitz
This adds a list of notifiers to be invoked on bdrv_close_all(). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c | 10 ++ include/block/block.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/block.c b/block.c index 6ad80fe..143c7cc 100644 --- a/block

[Qemu-devel] [PATCH v2 18/22] block: Move some bdrv_*_all() functions to BB

2015-02-09 Thread Max Reitz
Move bdrv_drain_all(), bdrv_commit_all(), bdrv_flush_all() and bdrv_invalidate_cache_all() to BB. The only operation left is bdrv_close_all(), which cannot be moved to the BB because it should not only close all BBs, but also all monitor-owned BDSs. Signed-off-by: Max Reitz --- block.c

[Qemu-devel] [PATCH v2 15/22] blockdev: Add list of monitor-owned BlockBackends

2015-02-09 Thread Max Reitz
The monitor does hold references to some BlockBackends so it should have a list of those BBs; blk_backends is a different list, as it contains references to all BBs (after a follow-up patch, that is), and that should not be changed because we do need such a list. Signed-off-by: Max Reitz --- blo

[Qemu-devel] [PATCH v2 09/22] blockdev: Use blk_remove_bs() in do_drive_del()

2015-02-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- blockdev.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/blockdev.c b/blockdev.c index 75baf16..3dfb5a2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2281,11 +2281,7 @@ int do_drive_del(Monitor *mon, const QDict *qdic

[Qemu-devel] [PATCH v2 16/22] blockdev: Remove blk_hide_on_behalf_of_do_drive_del()

2015-02-09 Thread Max Reitz
This function first removed the BlockBackend from the blk_backends list and cleared its name so it would no longer be found by blk_name(); since blk_next() now iterates through monitor_block_backends (which the BB is removed from in do_drive_del()), this is no longer necessary. Second, bdrv_make_a

[Qemu-devel] [PATCH v2 19/22] block: Remove bdrv_states

2015-02-09 Thread Max Reitz
Every entry in this list should be a root BDS and as such either be anchored to a BlockBackend or be owned by the monitor. Signed-off-by: Max Reitz --- block.c | 21 + include/block/block.h | 1 - include/block/block_int.h | 2 -- 3 files changed, 1 in

[Qemu-devel] [PATCH v2 10/22] block: Make bdrv_close() static

2015-02-09 Thread Max Reitz
There are no users of bdrv_close() left, except for one of bdrv_open()'s failure paths, bdrv_close_all() and bdrv_delete(), and that is good. Make bdrv_close() static so nobody makes the mistake of directly using bdrv_close() again. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c

[Qemu-devel] [PATCH v2 14/22] block: Use BlockBackend more

2015-02-09 Thread Max Reitz
Replace bdrv_drain_all(), bdrv_commmit_all(), bdrv_flush_all(), bdrv_invalidate_cache_all(), bdrv_next() and occurrences of bdrv_states by their BlockBackend equivalents. Signed-off-by: Max Reitz --- block.c | 22 - block/block-backend.c | 8 +++ block/qapi.c

<    1   2   3   4   >