diff mbox series

[2/4] hw: vfio: drop TYPE_FOO MACRO in VMStateDescription

Message ID 20190518032811.60341-2-liq3ea@163.com (mailing list archive)
State New, archived
Headers show
Series [1/4] vfio: pci: make "vfio-pci-nohotplug" as MACRO | expand

Commit Message

Li Qiang May 18, 2019, 3:28 a.m. UTC
As the vmstate structure names aren't related with
the QOM type names.

CC: qemu-trivial@nongnu.org
Signed-off-by: Li Qiang <liq3ea@163.com>
---
 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(-)

Comments

Alex Williamson May 18, 2019, 2:20 p.m. UTC | #1
On Fri, 17 May 2019 20:28:09 -0700
Li Qiang <liq3ea@163.com> wrote:

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

Seems contrary to the first patch in the series.
 
> CC: qemu-trivial@nongnu.org
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  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(-)
> 
> diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c
> index ee64a3b4a2..1b06c0f3ea 100644
> --- a/hw/vfio/amd-xgbe.c
> +++ b/hw/vfio/amd-xgbe.c
> @@ -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,
>  };
>  
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index d8b79ebe53..564751650f 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -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,
>  };
>  
> diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c
> index e7767c4b02..6cc608b6ca 100644
> --- a/hw/vfio/calxeda-xgmac.c
> +++ b/hw/vfio/calxeda-xgmac.c
> @@ -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,
>  };
>  
> diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> index 31dd3a2a87..d9e39552e2 100644
> --- a/hw/vfio/ccw.c
> +++ b/hw/vfio/ccw.c
> @@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
>  };
>  
>  static const VMStateDescription vfio_ccw_vmstate = {
> -    .name = TYPE_VFIO_CCW,
> +    .name = "vfio-ccw",
>      .unmigratable = 1,
>  };
>  
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index 398db38f14..e59a0234dd 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -697,7 +697,7 @@ out:
>  }
>  
>  static const VMStateDescription vfio_platform_vmstate = {
> -    .name = TYPE_VFIO_PLATFORM,
> +    .name = "vfio-platform",
>      .unmigratable = 1,
>  };
>
Li Qiang May 20, 2019, 1:29 a.m. UTC | #2
Alex Williamson <alex.williamson@redhat.com> 于2019年5月18日周六 下午10:20写道:

> On Fri, 17 May 2019 20:28:09 -0700
> Li Qiang <liq3ea@163.com> 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



> > CC: qemu-trivial@nongnu.org
> > Signed-off-by: Li Qiang <liq3ea@163.com>
> > ---
> >  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(-)
> >
> > diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c
> > index ee64a3b4a2..1b06c0f3ea 100644
> > --- a/hw/vfio/amd-xgbe.c
> > +++ b/hw/vfio/amd-xgbe.c
> > @@ -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,
> >  };
> >
> > diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> > index d8b79ebe53..564751650f 100644
> > --- a/hw/vfio/ap.c
> > +++ b/hw/vfio/ap.c
> > @@ -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,
> >  };
> >
> > diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c
> > index e7767c4b02..6cc608b6ca 100644
> > --- a/hw/vfio/calxeda-xgmac.c
> > +++ b/hw/vfio/calxeda-xgmac.c
> > @@ -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,
> >  };
> >
> > diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> > index 31dd3a2a87..d9e39552e2 100644
> > --- a/hw/vfio/ccw.c
> > +++ b/hw/vfio/ccw.c
> > @@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
> >  };
> >
> >  static const VMStateDescription vfio_ccw_vmstate = {
> > -    .name = TYPE_VFIO_CCW,
> > +    .name = "vfio-ccw",
> >      .unmigratable = 1,
> >  };
> >
> > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> > index 398db38f14..e59a0234dd 100644
> > --- a/hw/vfio/platform.c
> > +++ b/hw/vfio/platform.c
> > @@ -697,7 +697,7 @@ out:
> >  }
> >
> >  static const VMStateDescription vfio_platform_vmstate = {
> > -    .name = TYPE_VFIO_PLATFORM,
> > +    .name = "vfio-platform",
> >      .unmigratable = 1,
> >  };
> >
>
>
Alex Williamson May 20, 2019, 8:12 p.m. UTC | #3
On Mon, 20 May 2019 09:29:21 +0800
Li Qiang <liq3ea@gmail.com> wrote:

> Alex Williamson <alex.williamson@redhat.com> 于2019年5月18日周六 下午10:20写道:
> 
> > On Fri, 17 May 2019 20:28:09 -0700
> > Li Qiang <liq3ea@163.com> 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  

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.

  Link: https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html

Otherwise this appears as a rather arbitrary change.  Thanks,

Alex

> > > CC: qemu-trivial@nongnu.org
> > > Signed-off-by: Li Qiang <liq3ea@163.com>
> > > ---
> > >  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(-)
> > >
> > > diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c
> > > index ee64a3b4a2..1b06c0f3ea 100644
> > > --- a/hw/vfio/amd-xgbe.c
> > > +++ b/hw/vfio/amd-xgbe.c
> > > @@ -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,
> > >  };
> > >
> > > diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> > > index d8b79ebe53..564751650f 100644
> > > --- a/hw/vfio/ap.c
> > > +++ b/hw/vfio/ap.c
> > > @@ -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,
> > >  };
> > >
> > > diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c
> > > index e7767c4b02..6cc608b6ca 100644
> > > --- a/hw/vfio/calxeda-xgmac.c
> > > +++ b/hw/vfio/calxeda-xgmac.c
> > > @@ -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,
> > >  };
> > >
> > > diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
> > > index 31dd3a2a87..d9e39552e2 100644
> > > --- a/hw/vfio/ccw.c
> > > +++ b/hw/vfio/ccw.c
> > > @@ -468,7 +468,7 @@ static Property vfio_ccw_properties[] = {
> > >  };
> > >
> > >  static const VMStateDescription vfio_ccw_vmstate = {
> > > -    .name = TYPE_VFIO_CCW,
> > > +    .name = "vfio-ccw",
> > >      .unmigratable = 1,
> > >  };
> > >
> > > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> > > index 398db38f14..e59a0234dd 100644
> > > --- a/hw/vfio/platform.c
> > > +++ b/hw/vfio/platform.c
> > > @@ -697,7 +697,7 @@ out:
> > >  }
> > >
> > >  static const VMStateDescription vfio_platform_vmstate = {
> > > -    .name = TYPE_VFIO_PLATFORM,
> > > +    .name = "vfio-platform",
> > >      .unmigratable = 1,
> > >  };
> > >  
> >
> >
diff mbox series

Patch

diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c
index ee64a3b4a2..1b06c0f3ea 100644
--- a/hw/vfio/amd-xgbe.c
+++ b/hw/vfio/amd-xgbe.c
@@ -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,
 };
 
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index d8b79ebe53..564751650f 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -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,
 };
 
diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c
index e7767c4b02..6cc608b6ca 100644
--- a/hw/vfio/calxeda-xgmac.c
+++ b/hw/vfio/calxeda-xgmac.c
@@ -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,
 };
 
diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c
index 31dd3a2a87..d9e39552e2 100644
--- a/hw/vfio/ccw.c
+++ b/hw/vfio/ccw.c
@@ -468,7 +468,7 @@  static Property vfio_ccw_properties[] = {
 };
 
 static const VMStateDescription vfio_ccw_vmstate = {
-    .name = TYPE_VFIO_CCW,
+    .name = "vfio-ccw",
     .unmigratable = 1,
 };
 
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 398db38f14..e59a0234dd 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -697,7 +697,7 @@  out:
 }
 
 static const VMStateDescription vfio_platform_vmstate = {
-    .name = TYPE_VFIO_PLATFORM,
+    .name = "vfio-platform",
     .unmigratable = 1,
 };