From: Stefan Hajnoczi <stefanha@gmail.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
stefanha@redhat.com, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-scsi: Implement fc_host feature
Date: Tue, 17 Jan 2017 10:54:05 +0000 [thread overview]
Message-ID: <20170117105405.GE4265@stefanha-x1.localdomain> (raw)
In-Reply-To: <20170116160730.4696-3-famz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]
On Tue, Jan 17, 2017 at 12:07:30AM +0800, Fam Zheng wrote:
> static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
> {
> VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> VirtIOSCSI *s = VIRTIO_SCSI(dev);
> + VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev);
> Error *err = NULL;
>
> + if (vs->conf.fc_host) {
> + if (!strcmp(vs->conf.fc_host, "off")) {
> + vs->conf.primary_wwpn = 0;
> + vs->conf.primary_wwnn = 0;
> + vs->conf.secondary_wwpn = 0;
> + vs->conf.secondary_wwnn = 0;
> + } else if (!strcmp(vs->conf.fc_host, "primary") ||
> + !strcmp(vs->conf.fc_host, "secondary")) {
> + virtio_add_feature(&vdev->host_features, VIRTIO_SCSI_F_FC_HOST);
> + vs->conf.primary_active = !strcmp(vs->conf.fc_host, "primary");
> + if (!vs->conf.primary_wwpn) {
> + error_setg(errp, "fc_host enabled but primary_wwpn not set");
> + return;
> + }
> + if (!vs->conf.primary_wwnn) {
> + error_setg(errp, "fc_host enabled but primary_wwnn not set");
> + return;
> + }
> + if (!vs->conf.secondary_wwpn) {
> + error_setg(errp, "fc_host enabled but secondary_wwpn not set");
> + return;
> + }
> + if (!vs->conf.secondary_wwnn) {
> + error_setg(errp, "fc_host enabled but secondary_wwnn not set");
> + return;
> + }
> + s->vm_state_change =
> + qemu_add_vm_change_state_handler(virtio_scsi_vm_state_change, s);
Missing qemu_del_vm_change_state_handler() in .unrealize() and in error
code paths in this function.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
next prev parent reply other threads:[~2017-01-17 10:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 16:07 [Qemu-devel] [PATCH 0/2] virtio-scsi: Implement fc_host feature Fam Zheng
2017-01-16 16:07 ` [Qemu-devel] [PATCH 1/2] manual update linux header for virtio scsi fc_host Fam Zheng
2017-01-16 16:07 ` [Qemu-devel] [PATCH 2/2] virtio-scsi: Implement fc_host feature Fam Zheng
2017-01-17 10:54 ` Stefan Hajnoczi [this message]
2017-01-18 0:02 ` Fam Zheng
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=20170117105405.GE4265@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=famz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).