From: "Michael S. Tsirkin" <mst@redhat.com>
To: Cao jin <caoj.fnst@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Dmitry Fleytman <dmitry@daynix.com>,
Markus Armbruster <armbru@redhat.com>,
Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v8 15/17] vmw_pvscsi: remove unnecessary internal msi state flag
Date: Mon, 13 Jun 2016 22:42:36 +0300 [thread overview]
Message-ID: <20160613224151-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1465552478-5540-16-git-send-email-caoj.fnst@cn.fujitsu.com>
On Fri, Jun 10, 2016 at 05:54:36PM +0800, Cao jin wrote:
> Internal flag msi_used is uncesessary, msi_uninit() could be called
> directly, msi_enabled() is enough to check device msi state.
>
> cc: Paolo Bonzini <pbonzini@redhat.com>
> cc: Dmitry Fleytman <dmitry@daynix.com>
> cc: Markus Armbruster <armbru@redhat.com>
> cc: Marcel Apfelbaum <marcel@redhat.com>
> cc: Michael S. Tsirkin <mst@redhat.com>
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> hw/scsi/vmw_pvscsi.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> index ecd6077..363a7ed 100644
> --- a/hw/scsi/vmw_pvscsi.c
> +++ b/hw/scsi/vmw_pvscsi.c
> @@ -121,8 +121,6 @@ typedef struct {
> uint8_t msg_ring_info_valid; /* Whether message ring initialized */
> uint8_t use_msg; /* Whether to use message ring */
>
> - uint8_t msi_used; /* Whether MSI support was installed successfully */
> -
> PVSCSIRingInfo rings; /* Data transfer rings manager */
> uint32_t resetting; /* Reset in progress */
>
> @@ -362,7 +360,7 @@ pvscsi_update_irq_status(PVSCSIState *s)
> trace_pvscsi_update_irq_level(should_raise, s->reg_interrupt_enabled,
> s->reg_interrupt_status);
>
> - if (s->msi_used && msi_enabled(d)) {
> + if (msi_enabled(d)) {
> if (should_raise) {
> trace_pvscsi_update_irq_msi();
> msi_notify(d, PVSCSI_VECTOR_COMPLETION);
> @@ -1066,9 +1064,6 @@ pvscsi_init_msi(PVSCSIState *s)
> PVSCSI_USE_64BIT, PVSCSI_PER_VECTOR_MASK, NULL);
> if (res < 0) {
> trace_pvscsi_init_msi_fail(res);
> - s->msi_used = false;
> - } else {
> - s->msi_used = true;
> }
> }
>
> @@ -1077,9 +1072,7 @@ pvscsi_cleanup_msi(PVSCSIState *s)
> {
> PCIDevice *d = PCI_DEVICE(s);
>
> - if (s->msi_used) {
> - msi_uninit(d);
> - }
> + msi_uninit(d);
> }
>
> static const MemoryRegionOps pvscsi_ops = {
> @@ -1222,7 +1215,6 @@ static const VMStateDescription vmstate_pvscsi = {
> VMSTATE_STRUCT_TEST(parent_obj, PVSCSIState,
> pvscsi_vmstate_test_pci_device, 0,
> vmstate_pci_device, PCIDevice),
> - VMSTATE_UINT8(msi_used, PVSCSIState),
> VMSTATE_UINT32(resetting, PVSCSIState),
> VMSTATE_UINT64(reg_interrupt_status, PVSCSIState),
> VMSTATE_UINT64(reg_interrupt_enabled, PVSCSIState),
This change will break cross-version migration, we can't make it.
> --
> 2.1.0
>
>
next prev parent reply other threads:[~2016-06-13 19:42 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 9:54 [Qemu-devel] [PATCH v8 00/17] Add param Error ** for msi_init() Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 01/17] pci core: assert ENOSPC when add capability Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 02/17] fix some coding style problems Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 03/17] change pvscsi_init_msi() type to void Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 04/17] megasas: Fix check for msi_init() failure Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 05/17] mptsas: change .realize function name Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 06/17] usb xhci: change msi/msix property type Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 07/17] intel-hda: change msi " Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 08/17] mptsas: " Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 09/17] megasas: change msi/msix " Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 10/17] pci bridge dev: change msi " Cao jin
2016-06-13 9:35 ` Marcel Apfelbaum
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 11/17] msi_init: change return value to 0 on success Cao jin
2016-06-13 9:38 ` Marcel Apfelbaum
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 12/17] pci: Convert msi_init() to Error and fix callers to check it Cao jin
2016-06-13 10:16 ` Marcel Apfelbaum
2016-06-13 11:07 ` Markus Armbruster
2016-06-13 11:53 ` Marcel Apfelbaum
2016-06-13 11:09 ` Cao jin
2016-06-13 11:55 ` Marcel Apfelbaum
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 13/17] megasas: remove unnecessary megasas_use_msi() Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 14/17] mptsas: remove unnecessary internal msi state flag Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 15/17] vmw_pvscsi: " Cao jin
2016-06-13 19:42 ` Michael S. Tsirkin [this message]
2016-06-14 8:12 ` Markus Armbruster
2016-06-14 9:31 ` Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 16/17] vmxnet3: " Cao jin
2016-06-13 8:47 ` Markus Armbruster
2016-06-13 9:31 ` Cao jin
2016-06-10 9:54 ` [Qemu-devel] [PATCH v8 17/17] e1000e: " Cao jin
2016-06-13 8:48 ` [Qemu-devel] [PATCH v8 00/17] Add param Error ** for msi_init() Markus Armbruster
2016-06-13 9:15 ` Cao jin
2016-06-13 19:45 ` Michael S. Tsirkin
2016-06-13 20:31 ` Michael S. Tsirkin
2016-06-14 9:35 ` Cao jin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160613224151-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=armbru@redhat.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=dmitry@daynix.com \
--cc=marcel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).