All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: anthony.perard@citrix.com, kraxel@redhat.com,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Qemu-devel] [Xen-devel] [PATCH] xen: move xen_sysdev to xen_backend.c
Date: Mon, 13 Jun 2016 11:17:12 +0200	[thread overview]
Message-ID: <575E7A18.8090502@suse.com> (raw)
In-Reply-To: <1465809141-4474-1-git-send-email-jgross@suse.com>

On 13/06/16 11:12, Juergen Gross wrote:
> Commit 9432e53a5bc88681b2d3aec4dac9db07c5476d1b added xen_sysdev as a
> system device to serve as an anchor for removable virtual buses. This
> introduced a build failure for non-x86 builds with CONFIG_XEN_BACKEND
> set, as xen_sysdev was defined in a x86 specific file while being
> consumed in an architecture independent source.
> 
> Move the xen_sysdev definition and initialization to xen_backend.c to
> avoid the build failure.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Sorry, used old mail address of Stefano. Corrected.


Juergen

> ---
>  hw/xen/xen_backend.c      | 41 +++++++++++++++++++++++++++++++++++++++++
>  hw/xenpv/xen_machine_pv.c | 40 ----------------------------------------
>  2 files changed, 41 insertions(+), 40 deletions(-)
> 
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index c63f9df..6e52474 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -27,12 +27,17 @@
>  #include <sys/signal.h>
>  
>  #include "hw/hw.h"
> +#include "hw/sysbus.h"
>  #include "sysemu/char.h"
>  #include "qemu/log.h"
>  #include "hw/xen/xen_backend.h"
>  
>  #include <xen/grant_table.h>
>  
> +#define TYPE_XENSYSDEV "xensysdev"
> +
> +DeviceState *xen_sysdev;
> +
>  /* ------------------------------------------------------------- */
>  
>  /* public */
> @@ -763,6 +768,10 @@ int xen_be_init(void)
>          /* Check if xen_init() have been called */
>          goto err;
>      }
> +
> +    xen_sysdev = qdev_create(NULL, TYPE_XENSYSDEV);
> +    qdev_init_nofail(xen_sysdev);
> +
>      return 0;
>  
>  err:
> @@ -863,3 +872,35 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...
>      }
>      qemu_log_flush();
>  }
> +
> +static int xen_sysdev_init(SysBusDevice *dev)
> +{
> +    return 0;
> +}
> +
> +static Property xen_sysdev_properties[] = {
> +    {/* end of property list */},
> +};
> +
> +static void xen_sysdev_class_init(ObjectClass *klass, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(klass);
> +    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> +
> +    k->init = xen_sysdev_init;
> +    dc->props = xen_sysdev_properties;
> +}
> +
> +static const TypeInfo xensysdev_info = {
> +    .name          = TYPE_XENSYSDEV,
> +    .parent        = TYPE_SYS_BUS_DEVICE,
> +    .instance_size = sizeof(SysBusDevice),
> +    .class_init    = xen_sysdev_class_init,
> +};
> +
> +static void xenbe_register_types(void)
> +{
> +    type_register_static(&xensysdev_info);
> +}
> +
> +type_init(xenbe_register_types);
> diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c
> index f68cf48..48f725c 100644
> --- a/hw/xenpv/xen_machine_pv.c
> +++ b/hw/xenpv/xen_machine_pv.c
> @@ -25,15 +25,10 @@
>  #include "qemu/osdep.h"
>  #include "hw/hw.h"
>  #include "hw/boards.h"
> -#include "hw/sysbus.h"
>  #include "hw/xen/xen_backend.h"
>  #include "xen_domainbuild.h"
>  #include "sysemu/block-backend.h"
>  
> -#define TYPE_XENSYSDEV "xensysdev"
> -
> -DeviceState *xen_sysdev;
> -
>  static void xen_init_pv(MachineState *machine)
>  {
>      DriveInfo *dinfo;
> @@ -72,9 +67,6 @@ static void xen_init_pv(MachineState *machine)
>          break;
>      }
>  
> -    xen_sysdev = qdev_create(NULL, TYPE_XENSYSDEV);
> -    qdev_init_nofail(xen_sysdev);
> -
>      xen_be_register("console", &xen_console_ops);
>      xen_be_register("vkbd", &xen_kbdmouse_ops);
>      xen_be_register("vfb", &xen_framebuffer_ops);
> @@ -112,38 +104,6 @@ static void xen_init_pv(MachineState *machine)
>      xen_init_display(xen_domid);
>  }
>  
> -static int xen_sysdev_init(SysBusDevice *dev)
> -{
> -    return 0;
> -}
> -
> -static Property xen_sysdev_properties[] = {
> -    {/* end of property list */},
> -};
> -
> -static void xen_sysdev_class_init(ObjectClass *klass, void *data)
> -{
> -    DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> -
> -    k->init = xen_sysdev_init;
> -    dc->props = xen_sysdev_properties;
> -}
> -
> -static const TypeInfo xensysdev_info = {
> -    .name          = TYPE_XENSYSDEV,
> -    .parent        = TYPE_SYS_BUS_DEVICE,
> -    .instance_size = sizeof(SysBusDevice),
> -    .class_init    = xen_sysdev_class_init,
> -};
> -
> -static void xenpv_register_types(void)
> -{
> -    type_register_static(&xensysdev_info);
> -}
> -
> -type_init(xenpv_register_types);
> -
>  static void xenpv_machine_init(MachineClass *mc)
>  {
>      mc->desc = "Xen Para-virtualized PC";
> 

WARNING: multiple messages have this Message-ID (diff)
From: Juergen Gross <jgross@suse.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: anthony.perard@citrix.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	kraxel@redhat.com
Subject: Re: [PATCH] xen: move xen_sysdev to xen_backend.c
Date: Mon, 13 Jun 2016 11:17:12 +0200	[thread overview]
Message-ID: <575E7A18.8090502@suse.com> (raw)
In-Reply-To: <1465809141-4474-1-git-send-email-jgross@suse.com>

On 13/06/16 11:12, Juergen Gross wrote:
> Commit 9432e53a5bc88681b2d3aec4dac9db07c5476d1b added xen_sysdev as a
> system device to serve as an anchor for removable virtual buses. This
> introduced a build failure for non-x86 builds with CONFIG_XEN_BACKEND
> set, as xen_sysdev was defined in a x86 specific file while being
> consumed in an architecture independent source.
> 
> Move the xen_sysdev definition and initialization to xen_backend.c to
> avoid the build failure.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Sorry, used old mail address of Stefano. Corrected.


Juergen

> ---
>  hw/xen/xen_backend.c      | 41 +++++++++++++++++++++++++++++++++++++++++
>  hw/xenpv/xen_machine_pv.c | 40 ----------------------------------------
>  2 files changed, 41 insertions(+), 40 deletions(-)
> 
> diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c
> index c63f9df..6e52474 100644
> --- a/hw/xen/xen_backend.c
> +++ b/hw/xen/xen_backend.c
> @@ -27,12 +27,17 @@
>  #include <sys/signal.h>
>  
>  #include "hw/hw.h"
> +#include "hw/sysbus.h"
>  #include "sysemu/char.h"
>  #include "qemu/log.h"
>  #include "hw/xen/xen_backend.h"
>  
>  #include <xen/grant_table.h>
>  
> +#define TYPE_XENSYSDEV "xensysdev"
> +
> +DeviceState *xen_sysdev;
> +
>  /* ------------------------------------------------------------- */
>  
>  /* public */
> @@ -763,6 +768,10 @@ int xen_be_init(void)
>          /* Check if xen_init() have been called */
>          goto err;
>      }
> +
> +    xen_sysdev = qdev_create(NULL, TYPE_XENSYSDEV);
> +    qdev_init_nofail(xen_sysdev);
> +
>      return 0;
>  
>  err:
> @@ -863,3 +872,35 @@ void xen_be_printf(struct XenDevice *xendev, int msg_level, const char *fmt, ...
>      }
>      qemu_log_flush();
>  }
> +
> +static int xen_sysdev_init(SysBusDevice *dev)
> +{
> +    return 0;
> +}
> +
> +static Property xen_sysdev_properties[] = {
> +    {/* end of property list */},
> +};
> +
> +static void xen_sysdev_class_init(ObjectClass *klass, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(klass);
> +    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> +
> +    k->init = xen_sysdev_init;
> +    dc->props = xen_sysdev_properties;
> +}
> +
> +static const TypeInfo xensysdev_info = {
> +    .name          = TYPE_XENSYSDEV,
> +    .parent        = TYPE_SYS_BUS_DEVICE,
> +    .instance_size = sizeof(SysBusDevice),
> +    .class_init    = xen_sysdev_class_init,
> +};
> +
> +static void xenbe_register_types(void)
> +{
> +    type_register_static(&xensysdev_info);
> +}
> +
> +type_init(xenbe_register_types);
> diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c
> index f68cf48..48f725c 100644
> --- a/hw/xenpv/xen_machine_pv.c
> +++ b/hw/xenpv/xen_machine_pv.c
> @@ -25,15 +25,10 @@
>  #include "qemu/osdep.h"
>  #include "hw/hw.h"
>  #include "hw/boards.h"
> -#include "hw/sysbus.h"
>  #include "hw/xen/xen_backend.h"
>  #include "xen_domainbuild.h"
>  #include "sysemu/block-backend.h"
>  
> -#define TYPE_XENSYSDEV "xensysdev"
> -
> -DeviceState *xen_sysdev;
> -
>  static void xen_init_pv(MachineState *machine)
>  {
>      DriveInfo *dinfo;
> @@ -72,9 +67,6 @@ static void xen_init_pv(MachineState *machine)
>          break;
>      }
>  
> -    xen_sysdev = qdev_create(NULL, TYPE_XENSYSDEV);
> -    qdev_init_nofail(xen_sysdev);
> -
>      xen_be_register("console", &xen_console_ops);
>      xen_be_register("vkbd", &xen_kbdmouse_ops);
>      xen_be_register("vfb", &xen_framebuffer_ops);
> @@ -112,38 +104,6 @@ static void xen_init_pv(MachineState *machine)
>      xen_init_display(xen_domid);
>  }
>  
> -static int xen_sysdev_init(SysBusDevice *dev)
> -{
> -    return 0;
> -}
> -
> -static Property xen_sysdev_properties[] = {
> -    {/* end of property list */},
> -};
> -
> -static void xen_sysdev_class_init(ObjectClass *klass, void *data)
> -{
> -    DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
> -
> -    k->init = xen_sysdev_init;
> -    dc->props = xen_sysdev_properties;
> -}
> -
> -static const TypeInfo xensysdev_info = {
> -    .name          = TYPE_XENSYSDEV,
> -    .parent        = TYPE_SYS_BUS_DEVICE,
> -    .instance_size = sizeof(SysBusDevice),
> -    .class_init    = xen_sysdev_class_init,
> -};
> -
> -static void xenpv_register_types(void)
> -{
> -    type_register_static(&xensysdev_info);
> -}
> -
> -type_init(xenpv_register_types);
> -
>  static void xenpv_machine_init(MachineClass *mc)
>  {
>      mc->desc = "Xen Para-virtualized PC";
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-06-13  9:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13  9:12 [Qemu-devel] [PATCH] xen: move xen_sysdev to xen_backend.c Juergen Gross
2016-06-13  9:12 ` Juergen Gross
2016-06-13  9:17 ` Juergen Gross [this message]
2016-06-13  9:17   ` Juergen Gross
2016-06-14 14:46 ` [Qemu-devel] " Anthony PERARD
2016-06-14 14:46   ` Anthony PERARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=575E7A18.8090502@suse.com \
    --to=jgross@suse.com \
    --cc=anthony.perard@citrix.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.