Skip to contentSkip to conversation

vfio: pci: make "vfio-pci-nohotplug" as MACRO

PATCH Superseded Li Qiang 3 participants 12 messages May 18, 2019 – May 20, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Li Qiang

author
#0 lore raw

PATCH 1/4 vfio: pci: make "vfio-pci-nohotplug" as MACRO

---
 hw/vfio/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/vfio/pci.c +4 -2
index 8cecb53d5c..08729e5875 100644
@@ -40,6 +40,8 @@
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
+#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
 static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
 static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
 
@@ -3304,8 +3306,8 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
-    .name = "vfio-pci-nohotplug",
-    .parent = "vfio-pci",
+    .name = TYPE_VIFO_PCI_NOHOTPLUG,
+    .parent = TYPE_VFIO_PCI,
     .instance_size = sizeof(VFIOPCIDevice),
     .class_init = vfio_pci_nohotplug_dev_class_init,
 };
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/4 hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

As the vmstate structure names aren't related with the QOM type names.

---
 hw/vfio/amd-xgbe.c      | 2 +-
 hw/vfio/ap.c            | 2 +-
 hw/vfio/calxeda-xgmac.c | 2 +-
 hw/vfio/ccw.c           | 2 +-
 hw/vfio/platform.c      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
hw/vfio/amd-xgbe.c +1 -1
index ee64a3b4a2..1b06c0f3ea 100644
@@ -26,7 +26,7 @@ static void amd_xgbe_realize(DeviceState *dev, Error **errp)
 }
 
 static const VMStateDescription vfio_platform_amd_xgbe_vmstate = {
-    .name = TYPE_VFIO_AMD_XGBE,
+    .name = "vfio-amd-xgbe",
     .unmigratable = 1,
 };
 
hw/vfio/ap.c +1 -1
index d8b79ebe53..564751650f 100644
@@ -155,7 +155,7 @@ static void vfio_ap_reset(DeviceState *dev)
 }
 
 static const VMStateDescription vfio_ap_vmstate = {
-    .name = VFIO_AP_DEVICE_TYPE,
+    .name = "vfio-ap",
     .unmigratable = 1,
 };
 
hw/vfio/calxeda-xgmac.c +1 -1
index e7767c4b02..6cc608b6ca 100644
@@ -26,7 +26,7 @@ static void calxeda_xgmac_realize(DeviceState *dev, Error **errp)
 }
 
 static const VMStateDescription vfio_platform_calxeda_xgmac_vmstate = {
-    .name = TYPE_VFIO_CALXEDA_XGMAC,
+    .name = "vfio-calxeda-xgmac",
     .unmigratable = 1,
 };
 
hw/vfio/ccw.c +1 -1
index 31dd3a2a87..d9e39552e2 100644
@@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
 };
 
 static const VMStateDescription vfio_ccw_vmstate = {
-    .name = TYPE_VFIO_CCW,
+    .name = "vfio-ccw",
     .unmigratable = 1,
 };
 
hw/vfio/platform.c +1 -1
index 398db38f14..e59a0234dd 100644
@@ -697,7 +697,7 @@ out:
 }
 
 static const VMStateDescription vfio_platform_vmstate = {
-    .name = TYPE_VFIO_PLATFORM,
+    .name = "vfio-platform",
     .unmigratable = 1,
 };
 
Signature · 1 line
2.17.1
#2 lore raw

Re: [Qemu-devel] [PATCH 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

Quoted 2 lines · On Fri, 17 May 2019 20:28:09 -0700 Li Qiang <[email protected]> wrote:

As the vmstate structure names aren't related with the QOM type names.

Seems contrary to the first patch in the series.

Quoted 75 lines
---
 hw/vfio/amd-xgbe.c      | 2 +-
 hw/vfio/ap.c            | 2 +-
 hw/vfio/calxeda-xgmac.c | 2 +-
 hw/vfio/ccw.c           | 2 +-
 hw/vfio/platform.c      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
hw/vfio/amd-xgbe.c +1 -1
index ee64a3b4a2..1b06c0f3ea 100644
@@ -26,7 +26,7 @@ static void amd_xgbe_realize(DeviceState *dev, Error **errp)
 }
 
 static const VMStateDescription vfio_platform_amd_xgbe_vmstate = {
-    .name = TYPE_VFIO_AMD_XGBE,
+    .name = "vfio-amd-xgbe",
     .unmigratable = 1,
 };
 
hw/vfio/ap.c +1 -1
index d8b79ebe53..564751650f 100644
@@ -155,7 +155,7 @@ static void vfio_ap_reset(DeviceState *dev)
 }
 
 static const VMStateDescription vfio_ap_vmstate = {
-    .name = VFIO_AP_DEVICE_TYPE,
+    .name = "vfio-ap",
     .unmigratable = 1,
 };
 
hw/vfio/calxeda-xgmac.c +1 -1
index e7767c4b02..6cc608b6ca 100644
@@ -26,7 +26,7 @@ static void calxeda_xgmac_realize(DeviceState *dev, Error **errp)
 }
 
 static const VMStateDescription vfio_platform_calxeda_xgmac_vmstate = {
-    .name = TYPE_VFIO_CALXEDA_XGMAC,
+    .name = "vfio-calxeda-xgmac",
     .unmigratable = 1,
 };
 
hw/vfio/ccw.c +1 -1
index 31dd3a2a87..d9e39552e2 100644
@@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
 };
 
 static const VMStateDescription vfio_ccw_vmstate = {
-    .name = TYPE_VFIO_CCW,
+    .name = "vfio-ccw",
     .unmigratable = 1,
 };
 
hw/vfio/platform.c +1 -1
index 398db38f14..e59a0234dd 100644
@@ -697,7 +697,7 @@ out:
 }
 
 static const VMStateDescription vfio_platform_vmstate = {
-    .name = TYPE_VFIO_PLATFORM,
+    .name = "vfio-platform",
     .unmigratable = 1,
 };
 
#3 lore raw

Re: [Qemu-devel] [PATCH 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

Quoted 9 lines · Alex Williamson <[email protected]> 于2019年5月18日周六 下午10:20写道:
Quoted 2 lines · On Fri, 17 May 2019 20:28:09 -0700 Li Qiang <[email protected]> wrote:

As the vmstate structure names aren't related with the QOM type names.

Seems contrary to the first patch in the series.

No, once there is a discussion of this:
-->https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html

Thanks,
Li Qiang

Quoted 79 lines

hw/vfio/amd-xgbe.c static void amd_xgbe_realize(DeviceState *dev, Error

Quoted 15 lines
---
 hw/vfio/amd-xgbe.c      | 2 +-
 hw/vfio/ap.c            | 2 +-
 hw/vfio/calxeda-xgmac.c | 2 +-
 hw/vfio/ccw.c           | 2 +-
 hw/vfio/platform.c      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
hw/vfio/amd-xgbe.c +0 -0
index ee64a3b4a2..1b06c0f3ea 100644
@@ -26,7 +26,7 @@ static void amd_xgbe_realize(DeviceState *dev, Error

**errp)

hw/vfio/calxeda-xgmac.c static void calxeda_xgmac_realize(DeviceState *dev,

Quoted 26 lines
hw/vfio/amd-xgbe.c +1 -1
 }
 
 static const VMStateDescription vfio_platform_amd_xgbe_vmstate = {
-    .name = TYPE_VFIO_AMD_XGBE,
+    .name = "vfio-amd-xgbe",
     .unmigratable = 1,
 };
 
hw/vfio/ap.c +1 -1
index d8b79ebe53..564751650f 100644
@@ -155,7 +155,7 @@ static void vfio_ap_reset(DeviceState *dev)
 }
 
 static const VMStateDescription vfio_ap_vmstate = {
-    .name = VFIO_AP_DEVICE_TYPE,
+    .name = "vfio-ap",
     .unmigratable = 1,
 };
 
hw/vfio/calxeda-xgmac.c +0 -0
index e7767c4b02..6cc608b6ca 100644
@@ -26,7 +26,7 @@ static void calxeda_xgmac_realize(DeviceState *dev,

Error **errp)

Quoted 34 lines
hw/vfio/calxeda-xgmac.c +1 -1
 }
 
 static const VMStateDescription vfio_platform_calxeda_xgmac_vmstate = {
-    .name = TYPE_VFIO_CALXEDA_XGMAC,
+    .name = "vfio-calxeda-xgmac",
     .unmigratable = 1,
 };
 
hw/vfio/ccw.c +1 -1
index 31dd3a2a87..d9e39552e2 100644
@@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
 };
 
 static const VMStateDescription vfio_ccw_vmstate = {
-    .name = TYPE_VFIO_CCW,
+    .name = "vfio-ccw",
     .unmigratable = 1,
 };
 
hw/vfio/platform.c +1 -1
index 398db38f14..e59a0234dd 100644
@@ -697,7 +697,7 @@ out:
 }
 
 static const VMStateDescription vfio_platform_vmstate = {
-    .name = TYPE_VFIO_PLATFORM,
+    .name = "vfio-platform",
     .unmigratable = 1,
 };
 
#4 lore raw

Re: [Qemu-devel] [PATCH 2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

Quoted 5 lines · On Mon, 20 May 2019 09:29:21 +0800 Li Qiang <[email protected]> wrote:
Quoted 3 lines · Alex Williamson <[email protected]> 于2019年5月18日周六 下午10:20写道:

On Fri, 17 May 2019 20:28:09 -0700
Li Qiang <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

As the vmstate structure names aren't related with the QOM type names.

Seems contrary to the first patch in the series.

No, once there is a discussion of this:
-->https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html

Ok, then rather than the commit log above, it would be more useful (at least to me) to state:

It's recommended that VMStateDescription names are decoupled from QOM type names as the latter may freely change without consideration of migration compatibility.

Otherwise this appears as a rather arbitrary change. Thanks,

Alex

Quoted 79 lines
Quoted 79 lines

hw/vfio/amd-xgbe.c static void amd_xgbe_realize(DeviceState *dev, Error

Quoted 15 lines
---
 hw/vfio/amd-xgbe.c      | 2 +-
 hw/vfio/ap.c            | 2 +-
 hw/vfio/calxeda-xgmac.c | 2 +-
 hw/vfio/ccw.c           | 2 +-
 hw/vfio/platform.c      | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
hw/vfio/amd-xgbe.c +0 -0
index ee64a3b4a2..1b06c0f3ea 100644
@@ -26,7 +26,7 @@ static void amd_xgbe_realize(DeviceState *dev, Error  

**errp)

hw/vfio/calxeda-xgmac.c static void calxeda_xgmac_realize(DeviceState *dev,

Quoted 26 lines
hw/vfio/amd-xgbe.c +1 -1
 }
 
 static const VMStateDescription vfio_platform_amd_xgbe_vmstate = {
-    .name = TYPE_VFIO_AMD_XGBE,
+    .name = "vfio-amd-xgbe",
     .unmigratable = 1,
 };
 
hw/vfio/ap.c +1 -1
index d8b79ebe53..564751650f 100644
@@ -155,7 +155,7 @@ static void vfio_ap_reset(DeviceState *dev)
 }
 
 static const VMStateDescription vfio_ap_vmstate = {
-    .name = VFIO_AP_DEVICE_TYPE,
+    .name = "vfio-ap",
     .unmigratable = 1,
 };
 
hw/vfio/calxeda-xgmac.c +0 -0
index e7767c4b02..6cc608b6ca 100644
@@ -26,7 +26,7 @@ static void calxeda_xgmac_realize(DeviceState *dev,  

Error **errp)

Quoted 34 lines
hw/vfio/calxeda-xgmac.c +1 -1
 }
 
 static const VMStateDescription vfio_platform_calxeda_xgmac_vmstate = {
-    .name = TYPE_VFIO_CALXEDA_XGMAC,
+    .name = "vfio-calxeda-xgmac",
     .unmigratable = 1,
 };
 
hw/vfio/ccw.c +1 -1
index 31dd3a2a87..d9e39552e2 100644
@@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
 };
 
 static const VMStateDescription vfio_ccw_vmstate = {
-    .name = TYPE_VFIO_CCW,
+    .name = "vfio-ccw",
     .unmigratable = 1,
 };
 
hw/vfio/platform.c +1 -1
index 398db38f14..e59a0234dd 100644
@@ -697,7 +697,7 @@ out:
 }
 
 static const VMStateDescription vfio_platform_vmstate = {
-    .name = TYPE_VFIO_PLATFORM,
+    .name = "vfio-platform",
     .unmigratable = 1,
 };
 
author
#5 lore raw

PATCH 3/4 vfio: platform: fix a typo

In reply to Li Qiang
---
 hw/vfio/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/vfio/platform.c +2 -2
index e59a0234dd..d52d6552e0 100644
@@ -72,7 +72,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,
         g_free(intp->interrupt);
         g_free(intp);
         error_setg_errno(errp, -ret,
-                         "failed to initialize trigger eventd notifier");
+                         "failed to initialize trigger eventfd notifier");
         return NULL;
     }
     if (vfio_irq_is_automasked(intp)) {
@@ -84,7 +84,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,
             g_free(intp->unmask);
             g_free(intp);
             error_setg_errno(errp, -ret,
-                             "failed to initialize resample eventd notifier");
+                             "failed to initialize resample eventfd notifier");
             return NULL;
         }
     }
Signature · 1 line
2.17.1
#6 lore raw

Re: [Qemu-devel] [PATCH 3/4] vfio: platform: fix a typo

On Fri, 17 May 2019 20:28:10 -0700
Li Qiang <[email protected]> wrote:

An actual trivial patch, but it could still use a commit message.

Quoted 28 lines
---
 hw/vfio/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/vfio/platform.c +2 -2
index e59a0234dd..d52d6552e0 100644
@@ -72,7 +72,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,
         g_free(intp->interrupt);
         g_free(intp);
         error_setg_errno(errp, -ret,
-                         "failed to initialize trigger eventd notifier");
+                         "failed to initialize trigger eventfd notifier");
         return NULL;
     }
     if (vfio_irq_is_automasked(intp)) {
@@ -84,7 +84,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,
             g_free(intp->unmask);
             g_free(intp);
             error_setg_errno(errp, -ret,
-                             "failed to initialize resample eventd notifier");
+                             "failed to initialize resample eventfd notifier");
             return NULL;
         }
     }
author
#7 lore raw

PATCH 4/4 pci: msix: move 'MSIX_CAP_LENGTH' to header file

In reply to Li Qiang
---
 hw/pci/msix.c         | 2 --
 hw/vfio/pci.c         | 2 --
 include/hw/pci/msix.h | 2 ++
 3 files changed, 2 insertions(+), 4 deletions(-)
hw/pci/msix.c +0 -2
index 4e336416a7..d39dcf32e8 100644
@@ -24,8 +24,6 @@
 #include "qapi/error.h"
 #include "trace.h"
 
-#define MSIX_CAP_LENGTH 12
-
 /* MSI enable bit and maskall bit are in byte 1 in FLAGS register */
 #define MSIX_CONTROL_OFFSET (PCI_MSIX_FLAGS + 1)
 #define MSIX_ENABLE_MASK (PCI_MSIX_FLAGS_ENABLE >> 8)
hw/vfio/pci.c +0 -2
index 08729e5875..8e555db12e 100644
@@ -35,8 +35,6 @@
 #include "trace.h"
 #include "qapi/error.h"
 
-#define MSIX_CAP_LENGTH 12
-
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
include/hw/pci/msix.h +2 -0
index 1f27658d35..08acfa836e 100644
@@ -4,6 +4,8 @@
 #include "qemu-common.h"
 #include "hw/pci/pci.h"
 
+#define MSIX_CAP_LENGTH 12
+
 void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg);
 MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector);
 int msix_init(PCIDevice *dev, unsigned short nentries,
Signature · 1 line
2.17.1
#8 lore raw

Re: [Qemu-devel] [PATCH 4/4] pci: msix: move 'MSIX_CAP_LENGTH' to header file

On Fri, 17 May 2019 20:28:11 -0700
Li Qiang <[email protected]> wrote:

Lacking commit message.

Quoted 47 lines
---
 hw/pci/msix.c         | 2 --
 hw/vfio/pci.c         | 2 --
 include/hw/pci/msix.h | 2 ++
 3 files changed, 2 insertions(+), 4 deletions(-)
hw/pci/msix.c +0 -2
index 4e336416a7..d39dcf32e8 100644
@@ -24,8 +24,6 @@
 #include "qapi/error.h"
 #include "trace.h"
 
-#define MSIX_CAP_LENGTH 12
-
 /* MSI enable bit and maskall bit are in byte 1 in FLAGS register */
 #define MSIX_CONTROL_OFFSET (PCI_MSIX_FLAGS + 1)
 #define MSIX_ENABLE_MASK (PCI_MSIX_FLAGS_ENABLE >> 8)
hw/vfio/pci.c +0 -2
index 08729e5875..8e555db12e 100644
@@ -35,8 +35,6 @@
 #include "trace.h"
 #include "qapi/error.h"
 
-#define MSIX_CAP_LENGTH 12
-
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
include/hw/pci/msix.h +2 -0
index 1f27658d35..08acfa836e 100644
@@ -4,6 +4,8 @@
 #include "qemu-common.h"
 #include "hw/pci/pci.h"
 
+#define MSIX_CAP_LENGTH 12
+
 void msix_set_message(PCIDevice *dev, int vector, MSIMessage msg);
 MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector);
 int msix_init(PCIDevice *dev, unsigned short nentries,
#9 lore raw
In reply to Li Qiang

On Fri, 17 May 2019 20:28:08 -0700
Li Qiang <[email protected]> wrote:

Why? (No commit message, nor cover letter)

Quoted 30 lines
---
 hw/vfio/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/vfio/pci.c +4 -2
index 8cecb53d5c..08729e5875 100644
@@ -40,6 +40,8 @@
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
+#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
 static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
 static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
 
@@ -3304,8 +3306,8 @@ static void vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
-    .name = "vfio-pci-nohotplug",
-    .parent = "vfio-pci",
+    .name = TYPE_VIFO_PCI_NOHOTPLUG,
+    .parent = TYPE_VFIO_PCI,
     .instance_size = sizeof(VFIOPCIDevice),
     .class_init = vfio_pci_nohotplug_dev_class_init,
 };
#10 lore raw
Quoted 6 lines · Alex Williamson <[email protected]> 于2019年5月18日周六 下午10:18写道:

On Fri, 17 May 2019 20:28:08 -0700
Li Qiang <[email protected]> wrote:

Why? (No commit message, nor cover letter)

Once I think these are trivial so no cover letter and lack some commit message.
I will add some commit message in the next revision.

For this patch, this is more consistent with QOMConventions:
-->https://wiki.qemu.org/Documentation/QOMConventions

Thanks,
Li Qiang

Quoted 33 lines

hw/vfio/pci.c static void

Quoted 20 lines
---
 hw/vfio/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/vfio/pci.c +2 -0
index 8cecb53d5c..08729e5875 100644
@@ -40,6 +40,8 @@
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
+#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
 static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
 static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
 
@@ -3304,8 +3306,8 @@ static void

vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)

Quoted 10 lines
hw/vfio/pci.c +2 -2
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
-    .name = "vfio-pci-nohotplug",
-    .parent = "vfio-pci",
+    .name = TYPE_VIFO_PCI_NOHOTPLUG,
+    .parent = TYPE_VFIO_PCI,
     .instance_size = sizeof(VFIOPCIDevice),
     .class_init = vfio_pci_nohotplug_dev_class_init,
 };
#11 lore raw
Quoted 11 lines · On Mon, 20 May 2019 09:27:47 +0800 Li Qiang <[email protected]> wrote:
Quoted 6 lines · Alex Williamson <[email protected]> 于2019年5月18日周六 下午10:18写道:

On Fri, 17 May 2019 20:28:08 -0700
Li Qiang <[email protected]> wrote:

Why? (No commit message, nor cover letter)

Once I think these are trivial so no cover letter and lack some commit message.
I will add some commit message in the next revision.

There is no patch that is not improved by a commit message IMO.

Quoted 2 lines

For this patch, this is more consistent with QOMConventions:
-->https://wiki.qemu.org/Documentation/QOMConventions

Ok, so you're effectively just updating your previous commit 2683ccd5be8f ("vfio-pci: make vfio-pci device more QOM conventional") which crossed in flight with b290659fc3dd ("hw/vfio/display: add ramfb support") which added this new TypeInfo. The QOMConventions only recommend a TYPE_FOO if used in other parts of the code, but for consistency I think it's reasonable (with a commit log ;). Thanks,

Alex

Quoted 33 lines
Quoted 33 lines

hw/vfio/pci.c static void

Quoted 20 lines
---
 hw/vfio/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
hw/vfio/pci.c +2 -0
index 8cecb53d5c..08729e5875 100644
@@ -40,6 +40,8 @@
 #define TYPE_VFIO_PCI "vfio-pci"
 #define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
 
+#define TYPE_VIFO_PCI_NOHOTPLUG "vfio-pci-nohotplug"
+
 static void vfio_disable_interrupts(VFIOPCIDevice *vdev);
 static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled);
 
@@ -3304,8 +3306,8 @@ static void  

vfio_pci_nohotplug_dev_class_init(ObjectClass *klass, void *data)

Quoted 10 lines
hw/vfio/pci.c +2 -2
 }
 
 static const TypeInfo vfio_pci_nohotplug_dev_info = {
-    .name = "vfio-pci-nohotplug",
-    .parent = "vfio-pci",
+    .name = TYPE_VIFO_PCI_NOHOTPLUG,
+    .parent = TYPE_VFIO_PCI,
     .instance_size = sizeof(VFIOPCIDevice),
     .class_init = vfio_pci_nohotplug_dev_class_init,
 };