[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/9] virtio-pci: Remove duplicate test
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 6/9] virtio-pci: Remove duplicate test |
Date: |
Tue, 16 Mar 2010 19:51:22 +0100 |
We already do the test for msix on the caller, just use that test
Signed-off-by: Juan Quintela <address@hidden>
---
hw/msix.c | 8 --------
hw/virtio-pci.c | 7 ++++---
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/msix.c b/hw/msix.c
index 2ca0900..867f0b1 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -323,10 +323,6 @@ void msix_save(PCIDevice *dev, QEMUFile *f)
{
unsigned n = dev->msix_entries_nr;
- if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
- return;
- }
-
qemu_put_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);
}
@@ -336,10 +332,6 @@ void msix_load(PCIDevice *dev, QEMUFile *f)
{
unsigned n = dev->msix_entries_nr;
- if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) {
- return;
- }
-
msix_free_irq_entries(dev);
qemu_get_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
qemu_get_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 799f664..ce48ddc 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -115,9 +115,10 @@ static void virtio_pci_save_config(void * opaque, QEMUFile
*f)
{
VirtIOPCIProxy *proxy = opaque;
pci_device_save(&proxy->pci_dev, f);
- msix_save(&proxy->pci_dev, f);
- if (msix_present(&proxy->pci_dev))
+ if (msix_present(&proxy->pci_dev)) {
+ msix_save(&proxy->pci_dev, f);
qemu_put_be16(f, proxy->vdev->config_vector);
+ }
}
static void virtio_pci_save_queue(void * opaque, int n, QEMUFile *f)
@@ -135,8 +136,8 @@ static int virtio_pci_load_config(void * opaque, QEMUFile
*f)
if (ret) {
return ret;
}
- msix_load(&proxy->pci_dev, f);
if (msix_present(&proxy->pci_dev)) {
+ msix_load(&proxy->pci_dev, f);
qemu_get_be16s(f, &proxy->vdev->config_vector);
} else {
proxy->vdev->config_vector = VIRTIO_NO_VECTOR;
--
1.6.6.1
- [Qemu-devel] [PATCH 0/9] Virtio cleanups, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 1/9] qemu/pci: document msix_entries_nr field, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 2/9] virtio: Teach virtio-balloon about DO_UPCAST, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 5/9] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 7/9] QLIST: Introduce QLIST_COPY_HEAD, Juan Quintela, 2010/03/16
- [Qemu-devel] [PATCH 6/9] virtio-pci: Remove duplicate test,
Juan Quintela <=
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Michael S. Tsirkin, 2010/03/18
- [Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test, Juan Quintela, 2010/03/18
[Qemu-devel] [PATCH 4/9] virtio: Teach virtio-net about DO_UPCAST, Juan Quintela, 2010/03/16