RE: [PATCH v2] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chenqun (kuhn)
> -Original Message- > From: Max Reitz [mailto:mre...@redhat.com] > Sent: Tuesday, October 13, 2020 10:47 PM > To: Chenqun (kuhn) ; qemu-de...@nongnu.org; > qemu-triv...@nongnu.org > Cc: vsement...@virtuozzo.com; stefa...@redhat.com; f...@euphon.net; > ebl...@redhat.com;

Re: [PATCH v6 01/11] hw/block/nvme: Add Commands Supported and Effects log

2020-10-13 Thread Keith Busch
On Wed, Oct 14, 2020 at 06:42:02AM +0900, Dmitry Fomichev wrote: > +{ > +NvmeEffectsLog log = {}; > +uint32_t *dst_acs = log.acs, *dst_iocs = log.iocs; > +uint32_t trans_len; > +int i; > + > +trace_pci_nvme_cmd_supp_and_effects_log_read(); > + > +if (off >= sizeof(log)) { >

[PATCH v6 06/11] hw/block/nvme: Introduce max active and open zone limits

2020-10-13 Thread Dmitry Fomichev
Add two module properties, "max_active" and "max_open" to control the maximum number of zones that can be active or open. Once these variables are set to non-default values, these limits are checked during I/O and Too Many Active or Too Many Open command status is returned if they are exceeded.

[PATCH v6 08/11] hw/block/nvme: Add injection of Offline/Read-Only zones

2020-10-13 Thread Dmitry Fomichev
ZNS specification defines two zone conditions for the zones that no longer can function properly, possibly because of flash wear or other internal fault. It is useful to be able to "inject" a small number of such zones for testing purposes. This commit defines two optional device properties,

[PATCH v6 11/11] hw/block/nvme: Merge nvme_write_zeroes() with nvme_write()

2020-10-13 Thread Dmitry Fomichev
nvme_write() now handles WRITE, WRITE ZEROES and ZONE_APPEND. Signed-off-by: Dmitry Fomichev --- hw/block/nvme.c | 95 +-- hw/block/trace-events | 1 - 2 files changed, 28 insertions(+), 68 deletions(-) diff --git a/hw/block/nvme.c

[PATCH v6 05/11] hw/block/nvme: Support Zoned Namespace Command Set

2020-10-13 Thread Dmitry Fomichev
The emulation code has been changed to advertise NVM Command Set when "zoned" device property is not set (default) and Zoned Namespace Command Set otherwise. Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053) in PCI NVMe controller emulator. Define

[PATCH v6 10/11] hw/block/nvme: Separate read and write handlers

2020-10-13 Thread Dmitry Fomichev
With ZNS support in place, the majority of code in nvme_rw() has become read- or write-specific. Move these parts to two separate handlers, nvme_read() and nvme_write() to make the code more readable and to remove multiple is_write checks that so far existed in the i/o path. This is a refactoring

[PATCH v6 03/11] hw/block/nvme: Add support for Namespace Types

2020-10-13 Thread Dmitry Fomichev
From: Niklas Cassel Define the structures and constants required to implement Namespace Types support. Namespace Types introduce a new command set, "I/O Command Sets", that allows the host to retrieve the command sets associated with a namespace. Introduce support for the command set and enable

[PATCH v6 00/11] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-10-13 Thread Dmitry Fomichev
v5 -> v6 - Remove zoned state persistence code. Replace position-independent zone lists with QTAILQs. - Close all open zones upon clearing of the controller. This is a similar procedure to the one previously performed upon powering up with zone persistence. - Squash NS Types and

[PATCH v6 02/11] hw/block/nvme: Generate namespace UUIDs

2020-10-13 Thread Dmitry Fomichev
In NVMe 1.4, a namespace must report an ID descriptor of UUID type if it doesn't support EUI64 or NGUID. Add a new namespace property, "uuid", that provides the user the option to either specify the UUID explicitly or have a UUID generated automatically every time a namespace is initialized.

[PATCH v6 09/11] hw/block/nvme: Document zoned parameters in usage text

2020-10-13 Thread Dmitry Fomichev
Added brief descriptions of the new device properties that are now available to users to configure features of Zoned Namespace Command Set in the emulator. This patch is for documentation only, no functionality change. Signed-off-by: Dmitry Fomichev --- hw/block/nvme.c | 41

[PATCH v6 07/11] hw/block/nvme: Support Zone Descriptor Extensions

2020-10-13 Thread Dmitry Fomichev
Zone Descriptor Extension is a label that can be assigned to a zone. It can be set to an Empty zone and it stays assigned until the zone is reset. This commit adds a new optional module property, "zone_descr_ext_size". Its value must be a multiple of 64 bytes. If this value is non-zero, it

[PATCH v6 01/11] hw/block/nvme: Add Commands Supported and Effects log

2020-10-13 Thread Dmitry Fomichev
This log page becomes necessary to implement to allow checking for Zone Append command support in Zoned Namespace Command Set. This commit adds the code to report this log page for NVM Command Set only. The parts that are specific to zoned operation will be added later in the series. All

[PATCH v6 04/11] hw/block/nvme: Support allocated CNS command variants

2020-10-13 Thread Dmitry Fomichev
From: Niklas Cassel Many CNS commands have "allocated" command variants. These include a namespace as long as it is allocated, that is a namespace is included regardless if it is active (attached) or not. While these commands are optional (they are mandatory for controllers supporting the

Re: [PATCH] hw/block/nvme: add block utilization tracking

2020-10-13 Thread Keith Busch
On Tue, Oct 13, 2020 at 09:08:46PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > This adds support for reporting the Deallocated or Unwritten Logical > Block error (DULBE). This requires tracking the allocated/deallocated > status of all logical blocks. > > Introduce a bitmap that does

[PATCH] hw/block/nvme: add block utilization tracking

2020-10-13 Thread Klaus Jensen
From: Klaus Jensen This adds support for reporting the Deallocated or Unwritten Logical Block error (DULBE). This requires tracking the allocated/deallocated status of all logical blocks. Introduce a bitmap that does this. The bitmap is always intialized to all ones (aka, all blocks are

Re: [PATCH 0/9] nvme qemu cleanups and fixes

2020-10-13 Thread Klaus Jensen
On Oct 13 10:48, Keith Busch wrote: > On Tue, Oct 13, 2020 at 11:04:01AM +0200, Klaus Jensen wrote: > > On Sep 30 15:04, Keith Busch wrote: > > > After going through the zns enabling, I notice the controller enabling > > > is not correct. Then I just continued maked more stuff. The series, I > > >

Re: [PATCH 0/9] nvme qemu cleanups and fixes

2020-10-13 Thread Keith Busch
On Tue, Oct 13, 2020 at 11:04:01AM +0200, Klaus Jensen wrote: > On Sep 30 15:04, Keith Busch wrote: > > After going through the zns enabling, I notice the controller enabling > > is not correct. Then I just continued maked more stuff. The series, I > > think, contains some of the less

Re: [PATCH v2] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Max Reitz
On 13.10.20 14:33, Chen Qun wrote: > A default value is provided for the variable 'bitmap_name' to avoid compiler > warning. > > The compiler show warning: > migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ > may be used uninitialized in this function [-Wmaybe-uninitialized] >

Re: [PATCH qemu 4/4] iotests: add test for bitmap mirror

2020-10-13 Thread Max Reitz
On 02.10.20 10:23, Fabian Grünbichler wrote: > On October 1, 2020 7:31 pm, Max Reitz wrote: >> On 22.09.20 11:14, Fabian Grünbichler wrote: >>> heavily based on/practically forked off iotest 257 for bitmap backups, >>> but: >>> >>> - no writes to filter node 'mirror-top' between completion and >>>

Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-13 Thread Stefan Berger
On 10/13/20 4:26 AM, Philippe Mathieu-Daudé wrote: On 10/13/20 9:20 AM, Gerd Hoffmann wrote: On Sun, Oct 11, 2020 at 09:32:23PM +0200, Philippe Mathieu-Daudé wrote: The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. IRQ 5 has no fixed

Re: [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition

2020-10-13 Thread Stefan Berger
On 10/13/20 3:23 AM, Gerd Hoffmann wrote: On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote: The network devices use IRQ #9 by default. Add this default definition to the IsaIrqNumber enum. IRQ #9 seems to be sort-of standard for acpi. Not sure whenever that is actually

[PATCH v2] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chen Qun
A default value is provided for the variable 'bitmap_name' to avoid compiler warning. The compiler show warning: migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used uninitialized in this function [-Wmaybe-uninitialized] g_strlcpy(s->bitmap_name, bitmap_name,

Re: [PATCH v2 1/2] crypto: luks: fix tiny memory leak

2020-10-13 Thread Maxim Levitsky
On Tue, 2020-10-13 at 14:26 +0200, Alberto Garcia wrote: > On Sun 11 Oct 2020 12:21:35 PM CEST, Maxim Levitsky wrote: > > In the case when underlying block device doesn't support the > > bdrv_co_delete_file interface, an 'Error' wasn't freed. > > > > Signed-off-by: Maxim Levitsky > > --- > >

Re: [PATCH v2 1/2] crypto: luks: fix tiny memory leak

2020-10-13 Thread Alberto Garcia
On Sun 11 Oct 2020 12:21:35 PM CEST, Maxim Levitsky wrote: > In the case when underlying block device doesn't support the > bdrv_co_delete_file interface, an 'Error' wasn't freed. > > Signed-off-by: Maxim Levitsky > --- > block/crypto.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

RE: [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chenqun (kuhn)
> Le 10/10/2020 à 13:07, Chen Qun a écrit : > > This if statement judgment is redundant and it will cause a warning: > > > > migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may > > be used uninitialized in this function [-Wmaybe-uninitialized] > >

Re: [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Vladimir Sementsov-Ogievskiy
13.10.2020 10:49, Chenqun (kuhn) wrote: -Original Message- From: Laurent Vivier [mailto:laur...@vivier.eu] Sent: Tuesday, October 13, 2020 3:11 PM To: Li Qiang Cc: Fam Zheng ; ganqixin ; vsement...@virtuozzo.com; Zhanghailiang ; qemu-block@nongnu.org; Juan Quintela ;

Re: [PATCH v1 0/2] Add timeout mechanism to qmp actions

2020-10-13 Thread Stefan Hajnoczi
On Mon, Sep 21, 2020 at 11:14:35AM +, Fam Zheng wrote: > On 2020-09-19 10:22, Zhenyu Ye wrote: > > On 2020/9/18 22:06, Fam Zheng wrote: > > > > > > I can see how blocking in a slow io_submit can cause trouble for main > > > thread. I think one way to fix it (until it's made truly async in new

Re: [PATCH 0/9] nvme qemu cleanups and fixes

2020-10-13 Thread Klaus Jensen
On Sep 30 15:04, Keith Busch wrote: > After going through the zns enabling, I notice the controller enabling > is not correct. Then I just continued maked more stuff. The series, I > think, contains some of the less controversial patches from the two > conflicting zns series, preceeded by some

Re: acceptance-system-fedora failures

2020-10-13 Thread Philippe Mathieu-Daudé
On 10/9/20 12:37 PM, Pavel Dovgalyuk wrote: On 08.10.2020 14:50, Kevin Wolf wrote: Am 08.10.2020 um 12:26 hat Philippe Mathieu-Daudé geschrieben: On 10/7/20 3:11 PM, Pavel Dovgalyuk wrote: On 07.10.2020 15:49, Philippe Mathieu-Daudé wrote: On 10/7/20 2:20 PM, Pavel Dovgalyuk wrote: On

Re: [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition

2020-10-13 Thread Philippe Mathieu-Daudé
On 10/13/20 9:23 AM, Gerd Hoffmann wrote: On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote: The network devices use IRQ #9 by default. Add this default definition to the IsaIrqNumber enum. IRQ #9 seems to be sort-of standard for acpi. Not sure whenever that is

Re: Attached disk blockpull

2020-10-13 Thread Peter Krempa
This is a libvirt question, so asking it on the qemu-block might not get you an answer that quick, ... or ever if I didn't notice your other question also addressed incorrectly. [adding libvirt-us...@redhat.com to cc] On Tue, Sep 01, 2020 at 10:57:34 -0400, Yoonho Park wrote: > I am trying to

Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-13 Thread Philippe Mathieu-Daudé
On 10/13/20 9:20 AM, Gerd Hoffmann wrote: On Sun, Oct 11, 2020 at 09:32:23PM +0200, Philippe Mathieu-Daudé wrote: The TPM TIS device uses IRQ #5 by default. Add this default definition to the IsaIrqNumber enum. IRQ 5 has no fixed assignment. All kinds of add-on isa cards (sound, net)

Re: [PATCH] hw/block/nvme: update nsid when registered

2020-10-13 Thread Klaus Jensen
On Oct 1 23:50, Klaus Jensen wrote: > From: Klaus Jensen > > If the user does not specify an nsid parameter on the nvme-ns device, > nvme_register_namespace will find the first free namespace id and assign > that. > > This fix makes sure the assigned id is saved. > > Signed-off-by: Klaus

Re: Overlay limit bug

2020-10-13 Thread Peter Krempa
Adding libvir-list to cc. If you come across stuff that involves both libvirt and qemu it's best to crosspost it to libvir-list too as I've noticed this only accidentally. On Mon, Oct 12, 2020 at 15:03:10 -0400, Yoonho Park wrote: > I stumbled on a bug in qemu 4.2.0 (virsh 6.0.0) with a large

RE: [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chenqun (kuhn)
> -Original Message- > From: Laurent Vivier [mailto:laur...@vivier.eu] > Sent: Tuesday, October 13, 2020 3:11 PM > To: Li Qiang > Cc: Fam Zheng ; ganqixin ; > vsement...@virtuozzo.com; Zhanghailiang > ; qemu-block@nongnu.org; Juan Quintela > ; qemu-triv...@nongnu.org; Qemu Developers > ;

RE: [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Chenqun (kuhn)
migration/block-dirty-bitmap.c > > > b/migration/block-dirty-bitmap.c index 5bef793ac0..e09ea4f22b 100644 > > > --- a/migration/block-dirty-bitmap.c > > > +++ b/migration/block-dirty-bitmap.c > > > @@ -1084,9 +1084,7 @@ static int dirty_bitmap_load_header(QEMUFile > *f, DBMLoadState *s, > > >

Re: [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition

2020-10-13 Thread Gerd Hoffmann
On Sun, Oct 11, 2020 at 09:32:29PM +0200, Philippe Mathieu-Daudé wrote: > The IDE controller uses IRQ #14 by default. Add this > default definition to the IsaIrqNumber enum. primary, while secondary uses IRQ 15. take care, Gerd

Re: [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition

2020-10-13 Thread Gerd Hoffmann
On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote: > The network devices use IRQ #9 by default. Add this > default definition to the IsaIrqNumber enum. IRQ #9 seems to be sort-of standard for acpi. Not sure whenever that is actually written down somewhere. IIRC in pre-ACPI

Re: [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition

2020-10-13 Thread Gerd Hoffmann
On Sun, Oct 11, 2020 at 09:32:23PM +0200, Philippe Mathieu-Daudé wrote: > The TPM TIS device uses IRQ #5 by default. Add this > default definition to the IsaIrqNumber enum. IRQ 5 has no fixed assignment. All kinds of add-on isa cards (sound, net) used to use irq #5 by default because that one

Re: [PATCH 03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition

2020-10-13 Thread Gerd Hoffmann
On Sun, Oct 11, 2020 at 09:32:22PM +0200, Philippe Mathieu-Daudé wrote: > The first serial port uses IRQ #4 by default. Add this ^ > +ISA_IRQ_SER_DEFAULT = 4, ... so name this SER1 maybe? And add SER2 = 3? take care, Gerd

Re: [PATCH] migration/block-dirty-bitmap: fix uninitialized variable warning

2020-10-13 Thread Laurent Vivier
Le 13/10/2020 à 03:34, Li Qiang a écrit : > Laurent Vivier 于2020年10月12日周一 下午11:33写道: >> >> Le 10/10/2020 à 13:07, Chen Qun a écrit : >>> This if statement judgment is redundant and it will cause a warning: >>> >>> migration/block-dirty-bitmap.c:1090:13: warning: ‘bitmap_name’ may be used >>>