qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Cong Meng <mc@linux.vnet.ibm.com>
Cc: stefanha@linux.vnet.ibm.com, zwanp@cn.ibm.com,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	linuxram@us.ibm.com, senwang@linux.vnet.ibm.com,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	qemu-devel@nongnu.org, "Anthony Liguori" <anthony@codemonkey.ws>,
	virtualization@lists.linux-foundation.org,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 1/2 v2] scsi bus: introduce hotplug() and hot_unplug() interfaces for SCSI bus
Date: Mon, 02 Jul 2012 10:27:44 +0200	[thread overview]
Message-ID: <4FF15B80.9090200@redhat.com> (raw)
In-Reply-To: <ad3714e594248d5a8d558b6983db3fb2da65ae9a.1340264611.git.mc@linux.vnet.ibm.com>

Il 21/06/2012 09:54, Cong Meng ha scritto:
> Add two interfaces hotplug() and hot_unplug() to scsi bus info.
> The embody scsi bus can implement these two interfaces to signal the HBA driver
> of guest kernel to add/remove the scsi device in question.
> 
> Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
> Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com>
> ---
>  hw/scsi-bus.c |   16 +++++++++++++++-
>  hw/scsi.h     |    2 ++
>  2 files changed, 17 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
> index dbdb99c..f08900e 100644
> --- a/hw/scsi-bus.c
> +++ b/hw/scsi-bus.c
> @@ -177,6 +177,10 @@ static int scsi_qdev_init(DeviceState *qdev)
>                                                           dev);
>      }
>  
> +    if (bus->info->hotplug) {
> +        bus->info->hotplug(bus, dev);
> +    }
> +
>  err:
>      return rc;
>  }
> @@ -1539,6 +1543,16 @@ static int get_scsi_requests(QEMUFile *f, void *pv, size_t size)
>      return 0;
>  }
>  
> +static int scsi_qdev_unplug(DeviceState *qdev)
> +{
> +    SCSIDevice *dev = SCSI_DEVICE(qdev);
> +    SCSIBus *bus = scsi_bus_from_device(dev);
> +
> +    if (bus->info->hot_unplug)
> +        bus->info->hot_unplug(bus, dev);

Tab indentation and braces missing.  I fixed this up and applied it to
the scsi-next branch.

Paolo

> +    return qdev_simple_unplug_cb(qdev);
> +}
> +
>  const VMStateInfo vmstate_info_scsi_requests = {
>      .name = "scsi-requests",
>      .get  = get_scsi_requests,
> @@ -1575,7 +1589,7 @@ static void scsi_device_class_init(ObjectClass *klass, void *data)
>      DeviceClass *k = DEVICE_CLASS(klass);
>      k->bus_info = &scsi_bus_info;
>      k->init     = scsi_qdev_init;
> -    k->unplug   = qdev_simple_unplug_cb;
> +    k->unplug   = scsi_qdev_unplug;
>      k->exit     = scsi_qdev_exit;
>  }
>  
> diff --git a/hw/scsi.h b/hw/scsi.h
> index 2eb66f7..5768071 100644
> --- a/hw/scsi.h
> +++ b/hw/scsi.h
> @@ -130,6 +130,8 @@ struct SCSIBusInfo {
>      void (*transfer_data)(SCSIRequest *req, uint32_t arg);
>      void (*complete)(SCSIRequest *req, uint32_t arg, size_t resid);
>      void (*cancel)(SCSIRequest *req);
> +    void (*hotplug)(SCSIBus *bus, SCSIDevice *dev);
> +    void (*hot_unplug)(SCSIBus *bus, SCSIDevice *dev);
>      QEMUSGList *(*get_sg_list)(SCSIRequest *req);
>  
>      void (*save_request)(QEMUFile *f, SCSIRequest *req);
> 

      parent reply	other threads:[~2012-07-02  8:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1340264611.git.mc@linux.vnet.ibm.com>
2012-06-21  7:54 ` [Qemu-devel] [PATCH 1/2 v2] scsi bus: introduce hotplug() and hot_unplug() interfaces for SCSI bus Cong Meng
2012-06-21  9:17   ` Stefan Hajnoczi
2012-07-02  8:27   ` Paolo Bonzini [this message]

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=4FF15B80.9090200@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=linuxram@us.ibm.com \
    --cc=mc@linux.vnet.ibm.com \
    --cc=nab@linux-iscsi.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rusty@rustcorp.com.au \
    --cc=senwang@linux.vnet.ibm.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=zwanp@cn.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).