Revision e6da7680

b/hw/virtio-pci.c
126 126
    VirtIOPCIProxy *proxy = opaque;
127 127
    int ret;
128 128
    ret = pci_device_load(&proxy->pci_dev, f);
129
    if (ret)
129
    if (ret) {
130 130
        return ret;
131
    }
131 132
    msix_load(&proxy->pci_dev, f);
132
    if (msix_present(&proxy->pci_dev))
133
    if (msix_present(&proxy->pci_dev)) {
133 134
        qemu_get_be16s(f, &proxy->vdev->config_vector);
135
    } else {
136
        proxy->vdev->config_vector = VIRTIO_NO_VECTOR;
137
    }
138
    if (proxy->vdev->config_vector != VIRTIO_NO_VECTOR) {
139
        return msix_vector_use(&proxy->pci_dev, proxy->vdev->config_vector);
140
    }
134 141
    return 0;
135 142
}
136 143

  
......
138 145
{
139 146
    VirtIOPCIProxy *proxy = opaque;
140 147
    uint16_t vector;
141
    if (!msix_present(&proxy->pci_dev))
142
        return 0;
143
    qemu_get_be16s(f, &vector);
148
    if (msix_present(&proxy->pci_dev)) {
149
        qemu_get_be16s(f, &vector);
150
    } else {
151
        vector = VIRTIO_NO_VECTOR;
152
    }
144 153
    virtio_queue_set_vector(proxy->vdev, n, vector);
154
    if (vector != VIRTIO_NO_VECTOR) {
155
        return msix_vector_use(&proxy->pci_dev, vector);
156
    }
145 157
    return 0;
146 158
}
147 159

  

Also available in: Unified diff