qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] xen-140220
@ 2014-02-20 18:12 Stefano Stabellini
  2014-02-20 18:13 ` [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks Stefano Stabellini
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Stefano Stabellini @ 2014-02-20 18:12 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Peter Maydell, Olaf Hering, xen-devel, Stefano Stabellini,
	qemu-devel, Anthony.Perard, Paolo Bonzini

The following changes since commit 2ca92bb993991d6dcb8f68751aca9fc2ec2b8867:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-3' into staging (2014-02-20 15:25:05 +0000)

are available in the git repository at:


  git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-140220

for you to fetch changes up to 58da5b1e01a586eb5a52ba3eec342d6828269839:

  xen_disk: fix io accounting (2014-02-20 17:57:13 +0000)

----------------------------------------------------------------
Olaf Hering (1):
      xen_disk: fix io accounting

Stefano Stabellini (1):
      Call pci_piix3_xen_ide_unplug from unplug_disks

 hw/block/xen_disk.c   |   13 ++++++++++++-
 hw/ide/piix.c         |    3 +--
 hw/xen/xen_platform.c |    3 ++-
 include/hw/ide.h      |    1 +
 4 files changed, 16 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks
  2014-02-20 18:12 [Qemu-devel] [PULL 0/2] xen-140220 Stefano Stabellini
@ 2014-02-20 18:13 ` Stefano Stabellini
  2014-02-20 18:13 ` [Qemu-devel] [PULL 2/2] xen_disk: fix io accounting Stefano Stabellini
  2014-02-25 10:52 ` [Qemu-devel] [PULL 0/2] xen-140220 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2014-02-20 18:13 UTC (permalink / raw)
  To: anthony
  Cc: peter.maydell, olaf, xen-devel, Stefano Stabellini, qemu-devel,
	Anthony.Perard, pbonzini

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ide/piix.c         |    3 +--
 hw/xen/xen_platform.c |    3 ++-
 include/hw/ide.h      |    1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 0eda301..40757eb 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -167,7 +167,7 @@ static int pci_piix_ide_initfn(PCIDevice *dev)
     return 0;
 }
 
-static int pci_piix3_xen_ide_unplug(DeviceState *dev)
+int pci_piix3_xen_ide_unplug(DeviceState *dev)
 {
     PCIIDEState *pci_ide;
     DriveInfo *di;
@@ -266,7 +266,6 @@ static void piix3_ide_xen_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1;
     k->class_id = PCI_CLASS_STORAGE_IDE;
     set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
-    dc->unplug = pci_piix3_xen_ide_unplug;
 }
 
 static const TypeInfo piix3_ide_xen_info = {
diff --git a/hw/xen/xen_platform.c b/hw/xen/xen_platform.c
index 70875e4..1d9d0e9 100644
--- a/hw/xen/xen_platform.c
+++ b/hw/xen/xen_platform.c
@@ -27,6 +27,7 @@
 
 #include "hw/hw.h"
 #include "hw/i386/pc.h"
+#include "hw/ide.h"
 #include "hw/pci/pci.h"
 #include "hw/irq.h"
 #include "hw/xen/xen_common.h"
@@ -110,7 +111,7 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *o)
     if (pci_get_word(d->config + PCI_CLASS_DEVICE) ==
             PCI_CLASS_STORAGE_IDE
             && strcmp(d->name, "xen-pci-passthrough") != 0) {
-        qdev_unplug(DEVICE(d), NULL);
+        pci_piix3_xen_ide_unplug(DEVICE(d));
     }
 }
 
diff --git a/include/hw/ide.h b/include/hw/ide.h
index 507e6d3..bc8bd32 100644
--- a/include/hw/ide.h
+++ b/include/hw/ide.h
@@ -17,6 +17,7 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,
 PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
+int pci_piix3_xen_ide_unplug(DeviceState *dev);
 void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 
 /* ide-mmio.c */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] xen_disk: fix io accounting
  2014-02-20 18:12 [Qemu-devel] [PULL 0/2] xen-140220 Stefano Stabellini
  2014-02-20 18:13 ` [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks Stefano Stabellini
@ 2014-02-20 18:13 ` Stefano Stabellini
  2014-02-25 10:52 ` [Qemu-devel] [PULL 0/2] xen-140220 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2014-02-20 18:13 UTC (permalink / raw)
  To: anthony
  Cc: peter.maydell, olaf, xen-devel, Stefano Stabellini, qemu-devel,
	Anthony.Perard, pbonzini

From: Olaf Hering <olaf@aepfle.de>

bdrv_acct_done was called unconditional. But in case the ioreq has no
segments there is no matching bdrv_acct_start call. This could lead to
bogus accounting values.

Found by code inspection.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/block/xen_disk.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 098f6c6..7f0f14a 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -483,7 +483,18 @@ static void qemu_aio_complete(void *opaque, int ret)
     ioreq->status = ioreq->aio_errors ? BLKIF_RSP_ERROR : BLKIF_RSP_OKAY;
     ioreq_unmap(ioreq);
     ioreq_finish(ioreq);
-    bdrv_acct_done(ioreq->blkdev->bs, &ioreq->acct);
+    switch (ioreq->req.operation) {
+    case BLKIF_OP_WRITE:
+    case BLKIF_OP_FLUSH_DISKCACHE:
+        if (!ioreq->req.nr_segments) {
+            break;
+        }
+    case BLKIF_OP_READ:
+        bdrv_acct_done(ioreq->blkdev->bs, &ioreq->acct);
+        break;
+    default:
+        break;
+    }
     qemu_bh_schedule(ioreq->blkdev->bh);
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] xen-140220
  2014-02-20 18:12 [Qemu-devel] [PULL 0/2] xen-140220 Stefano Stabellini
  2014-02-20 18:13 ` [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks Stefano Stabellini
  2014-02-20 18:13 ` [Qemu-devel] [PULL 2/2] xen_disk: fix io accounting Stefano Stabellini
@ 2014-02-25 10:52 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-02-25 10:52 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Olaf Hering, xen-devel@lists.xensource.com Devel, QEMU Developers,
	Anthony Liguori, Anthony PERARD, Paolo Bonzini

On 20 February 2014 18:12, Stefano Stabellini
<stefano.stabellini@eu.citrix.com> wrote:
> The following changes since commit 2ca92bb993991d6dcb8f68751aca9fc2ec2b8867:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-3' into staging (2014-02-20 15:25:05 +0000)
>
> are available in the git repository at:
>
>
>   git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-140220
>
> for you to fetch changes up to 58da5b1e01a586eb5a52ba3eec342d6828269839:
>
>   xen_disk: fix io accounting (2014-02-20 17:57:13 +0000)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-25 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 18:12 [Qemu-devel] [PULL 0/2] xen-140220 Stefano Stabellini
2014-02-20 18:13 ` [Qemu-devel] [PULL 1/2] Call pci_piix3_xen_ide_unplug from unplug_disks Stefano Stabellini
2014-02-20 18:13 ` [Qemu-devel] [PULL 2/2] xen_disk: fix io accounting Stefano Stabellini
2014-02-25 10:52 ` [Qemu-devel] [PULL 0/2] xen-140220 Peter Maydell

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