All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gonglei (Arei)" <arei.gonglei@huawei.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	Luonengjun <luonengjun@huawei.com>,
	"mst@redhat.com" <mst@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"Huangweidong (C)" <weidong.huang@huawei.com>,
	"mike.caraman@nxp.com" <mike.caraman@nxp.com>,
	"agraf@suse.de" <agraf@suse.de>,
	"xin.zeng@intel.com" <xin.zeng@intel.com>,
	Claudio Fontana <Claudio.Fontana@huawei.com>,
	"nmorey@kalray.eu" <nmorey@kalray.eu>,
	"vincent.jardin@6wind.com" <vincent.jardin@6wind.com>
Subject: Re: [Qemu-devel] [PATCH v2 01/15] crypto: introduce cryptodev backend and crypto legacy hardware
Date: Tue, 13 Sep 2016 10:06:41 +0000	[thread overview]
Message-ID: <33183CC9F5247A488A2544077AF19020B03CA2ED@SZXEMA503-MBS.china.huawei.com> (raw)
In-Reply-To: <20160913095916.GK30949@redhat.com>


> -----Original Message-----
> From: Daniel P. Berrange [mailto:berrange@redhat.com]
> Sent: Tuesday, September 13, 2016 5:59 PM
> Subject: Re: [PATCH v2 01/15] crypto: introduce cryptodev backend and crypto
> legacy hardware
> 
> On Tue, Sep 13, 2016 at 09:55:27AM +0000, Gonglei (Arei) wrote:
> >
> > >
> > > From: Daniel P. Berrange [mailto:berrange@redhat.com]
> > > Sent: Tuesday, September 13, 2016 5:14 PM
> > > Subject: Re: [PATCH v2 01/15] crypto: introduce cryptodev backend and
> crypto
> > > legacy hardware
> > >
> > > On Tue, Sep 13, 2016 at 11:52:07AM +0800, Gonglei wrote:
> > > > cryptodev backend is used to realize the active work for
> > > > virtual crypto device. CryptoLegacyHW device is a cryptographic
> > > > hardware device seen by the virtual machine.
> > > > The relationship between cryptodev backend and legacy hadware
> > > > as follow:
> > > >  crypto_legacy_hw device (1)--->(n) cryptodev client backend
> > > >
> > > > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> > >
> > > > diff --git a/crypto/crypto.c b/crypto/crypto.c
> > > > new file mode 100644
> > > > index 0000000..fbc6497
> > > > --- /dev/null
> > > > +++ b/crypto/crypto.c
> > > > @@ -0,0 +1,171 @@
> > > > +/*
> > > > + * QEMU Crypto Device Implement
> > > > + *
> > > > + * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
> > > > + *
> > > > + * Authors:
> > > > + *    Gonglei <arei.gonglei@huawei.com>
> > > > + *
> > > > + * Permission is hereby granted, free of charge, to any person obtaining
> a
> > > copy
> > > > + * of this software and associated documentation files (the "Software"),
> to
> > > deal
> > > > + * in the Software without restriction, including without limitation the
> rights
> > > > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> > > > + * copies of the Software, and to permit persons to whom the Software is
> > > > + * furnished to do so, subject to the following conditions:
> > > > + *
> > > > + * The above copyright notice and this permission notice shall be included
> in
> > > > + * all copies or substantial portions of the Software.
> > > > + *
> > > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
> KIND,
> > > EXPRESS OR
> > > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> > > MERCHANTABILITY,
> > > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
> NO
> > > EVENT SHALL
> > > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
> > > DAMAGES OR OTHER
> > > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
> OTHERWISE,
> > > ARISING FROM,
> > > > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > > OTHER DEALINGS IN
> > > > + * THE SOFTWARE.
> > > > + */
> > >
> > > New files are expected to be submitted under the GPLv2+ license,
> > > unless they're header files imported from an external project,
> > > which this is not.
> > >
> > > The same license mistake is made across other files / patches
> > > in this series, so I won't repeat the comment - just fix all
> > > of them to be GPLv2+ please.
> > >
> > > > +#include "qemu/osdep.h"
> > > > +#include "sysemu/sysemu.h"
> > > > +#include "qapi/error.h"
> > > > +#include "qemu/iov.h"
> > > > +#include "qapi-visit.h"
> > > > +#include "qapi/opts-visitor.h"
> > > > +
> > > > +#include "crypto/crypto.h"
> > > > +#include "qemu/config-file.h"
> > > > +#include "monitor/monitor.h"
> > > > +
> > > > +
> > > > +static QTAILQ_HEAD(, CryptoClientState) crypto_clients;
> > > > +
> > > > +QemuOptsList qemu_cryptodev_opts = {
> > > > +    .name = "cryptodev",
> > > > +    .implied_opt_name = "type",
> > > > +    .head = QTAILQ_HEAD_INITIALIZER(qemu_cryptodev_opts.head),
> > > > +    .desc = {
> > > > +        /*
> > > > +         * no elements => accept any params
> > > > +         * validation will happen later
> > > > +         */
> > > > +        { /* end of list */ }
> > > > +    },
> > > > +};
> > >
> > > No new code should be adding more command line options for
> > > device backends.
> > >
> > > Your backend impl should be using QOM to define a object,
> > > which can be created via the -object command line arg,
> > > or object_add monitor command.
> > >
> > Any backgrounds about this rule? Maybe I missed something.
> 
> I don't think it has been documented anywhere explicitly.
> The general idea of using QOM though is that it avoids the
> need for you to re-invent the wheel for command line parsing
> and gives you QMP/HMP based hotplug for free at the same
> time. It was first used for the RNG and hostmem backends,
> and more recently my tls-creds and secrets objects.
> 
> A very very very long term goal would be for exinsting backends
> to be converted to be QOM based too, but for now we're just aiming
> for any new backends to use QOM from the start.
> 
OK, I see. Thanks!


Regards,
-Gonglei

> Regards,
> Daniel
> --
> |: http://berrange.com      -o-
> http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-
> http://virt-manager.org :|
> |: http://autobuild.org       -o-
> http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-
> http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2016-09-13 10:07 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  3:52 [Qemu-devel] [PATCH v2 00/15] virtio-crypto: introduce framework and device emulation Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 01/15] crypto: introduce cryptodev backend and crypto legacy hardware Gonglei
2016-09-13  9:13   ` Daniel P. Berrange
2016-09-13  9:55     ` Gonglei (Arei)
2016-09-13  9:59       ` Daniel P. Berrange
2016-09-13 10:06         ` Gonglei (Arei) [this message]
2016-09-13 10:50     ` Paolo Bonzini
2016-09-13 11:04       ` Daniel P. Berrange
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 02/15] crypto: introduce crypto queue handler Gonglei
2016-09-13  9:20   ` Daniel P. Berrange
2016-09-13  9:58     ` Gonglei (Arei)
2016-09-13 10:58     ` Paolo Bonzini
2016-09-13 11:52       ` [Qemu-devel] [virtio-dev] " Ola Liljedahl
2016-09-14  1:07         ` Gonglei (Arei)
2016-09-14  8:24           ` Ola Liljedahl
2016-09-14  1:03       ` Gonglei (Arei)
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 03/15] crypto: add cryptoLegacyHW stuff Gonglei
2016-09-13  9:22   ` Daniel P. Berrange
2016-09-13 10:05     ` Gonglei (Arei)
2016-09-13 10:08       ` Daniel P. Berrange
2016-09-13 10:14         ` Gonglei (Arei)
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 04/15] crypto: add symetric algorithms support Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 05/15] crypto: add cryptodev-linux as a cryptodev backend Gonglei
2016-09-13  9:23   ` Daniel P. Berrange
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 06/15] crypto: add internal handle logic layer Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 07/15] virtio-crypto: introduce virtio-crypto.h Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 08/15] virtio-crypto-pci: add virtio crypto pci support Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 09/15] virtio-crypto: add virtio crypto realization Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 10/15] virtio-crypto: set capacity of crypto legacy hardware Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 11/15] virtio-crypto: add control queue handler Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 12/15] virtio-crypto: add destroy session logic Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 13/15] virtio-crypto: get correct input data address for each request Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 14/15] virtio-crypto: add data virtqueue processing handler Gonglei
2016-09-13  3:52 ` [Qemu-devel] [PATCH v2 15/15] virtio-crypto: support scatter gather list Gonglei
2016-09-13  8:57 ` [Qemu-devel] [PATCH v2 00/15] virtio-crypto: introduce framework and device emulation Daniel P. Berrange
2016-09-13  9:45   ` Gonglei (Arei)
2016-09-13  9:54     ` Daniel P. Berrange
2016-09-13 10:08       ` Gonglei (Arei)
2016-09-13 10:58       ` Paolo Bonzini
2016-09-13 11:07         ` Daniel P. Berrange

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=33183CC9F5247A488A2544077AF19020B03CA2ED@SZXEMA503-MBS.china.huawei.com \
    --to=arei.gonglei@huawei.com \
    --cc=Claudio.Fontana@huawei.com \
    --cc=agraf@suse.de \
    --cc=berrange@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=nmorey@kalray.eu \
    --cc=pbonzini@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vincent.jardin@6wind.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=weidong.huang@huawei.com \
    --cc=xin.zeng@intel.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.