[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH v2 2/4] conf: Parse virtio-crypto in the domain XML



On Wed, Feb 08, 2017 at 11:25:21AM +0800, Longpeng (Mike) wrote:
Hi Martin,

On 2017/2/7 20:15, Martin Kletzander wrote:

On Wed, Jan 11, 2017 at 04:28:24PM +0800, Longpeng(Mike) wrote:
This patch parse the domain XML with virtio-crypto
support, the virtio-crypto XML looks like this:

 <crypto model='virtio'>
   <backend type='builtin' queues='1'/>
 </crypto>

Signed-off-by: Longpeng(Mike) <longpeng2 huawei com>
---
src/conf/domain_conf.c         | 213 ++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_conf.h         |  32 +++++++
src/libvirt_private.syms       |   2 +
src/qemu/qemu_domain.c         |   2 +
src/qemu/qemu_domain_address.c |   1 +
src/qemu/qemu_driver.c         |   6 ++
src/qemu/qemu_hotplug.c        |   1 +
7 files changed, 256 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 52aee2b..ef44930 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18967,6 +19096,25 @@ virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src,


static bool
+virDomainCryptoDefCheckABIStability(virDomainCryptoDefPtr src,
+                                    virDomainCryptoDefPtr dst)
+{
+    if (src->model != dst->model) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("Target Crypto model '%s' does not match source '%s'"),
+                       virDomainCryptoModelTypeToString(dst->model),
+                       virDomainCryptoModelTypeToString(src->model));
+        return false;
+    }
+

The number of queues is not part of ABI?  That'd make sense, I'm just
making sure.


Oh, yep! I think it's necessary to check 'queues' for future scalability,
although QEMU cryptodev only support one queue currently.


Just try migrating (or restoring) a domain with one queue to a domain
with multiple queues.  If that works, there is no need to check for the
number of queues in this function.

I will take all your other suggestions and rebase the patchset on master in V3.

Thanks. :)


...
    case VIR_DOMAIN_DEVICE_LAST:
    case VIR_DOMAIN_DEVICE_NONE:
        return 0;


--
Regards,
Longpeng(Mike)

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]