From patchwork Wed Mar 13 15:51:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160245 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp14477441jad; Wed, 13 Mar 2019 08:55:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXzKj9mNIXwsCN4jM/AdFgRJMMeFJG1fBrmQuNmIDkdWhTGc0raXCPCrznwAJYuPRciHU2 X-Received: by 2002:aed:3bb3:: with SMTP id r48mr35925467qte.278.1552492531589; Wed, 13 Mar 2019 08:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552492531; cv=none; d=google.com; s=arc-20160816; b=VhnPuuqltTFppkj0LOdYIlYja/mqisiktY10HXagOLvDpeCn0SVLzgeFil/PKx+O8j CpWBU1oY29sLz/3CSZiTbPCIQpXPoZqzBW0kOnueEzip357RgeywE7fbhyXlK+8O3r8E KawBV5Afkw7evtu36/VEGBlWZt0+iNrHASUaMmiBGGeT/rAyeue9+gYoIisDH2cw/Zjz bWmMZuYJ6CWq9oK+Wurv0RenrIpeZJMqCs8vr8y54+xzHSssq3KPSoEQieZtApJxuZpq fPqzAfSUCF1RJ0ziXoVMJ+AJpfO9OR12qC5APybWp5sgtsMGjPsH6ZTMsE+oq/q74hAj ZW4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:delivered-to; bh=aEKgIf/RJo5KCSJttdr5f/JtrrBeFvmCqDW1us8H6TI=; b=bu3v/mk5KJdNyUys6pUyLkuEXJGf2BVRF0SE0YSWSrHAhukRBR03z8PpPKDGRYv0XN B5t13mUPAaCoJi77GGTzbxcKiA50svANyCVsr9oI3gbroWPdy/BRWuDwwP6qIkEFYDsI RQmKb3ZEMmysnOhIW6qFqir13VJN7+r3IugVL5SQsBS4T7TZcbG4GefSbaFjdnH97Qrh 9rJMLSZxgshgRouNCd5qWWha4dn9Dfs9uNyQ4C0BoM1i+NSYiyBerKTQPjsGi05DdigG w1yvLunQjlJPpuCmfKgJ9rf6WKLWP0kZPwlQLWkwW6aSRJw8cAqULK2h2ASsYVjlBz4H bCaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id w22si6774545qkj.248.2019.03.13.08.55.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 08:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 11961C6548; Wed, 13 Mar 2019 15:55:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DFEEF60CD3; Wed, 13 Mar 2019 15:55:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 98D404EE74; Wed, 13 Mar 2019 15:55:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2DFpPna001330 for ; Wed, 13 Mar 2019 11:51:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4FFA56B8C4; Wed, 13 Mar 2019 15:51:25 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-40.rdu2.redhat.com [10.10.124.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCD7F17CEB; Wed, 13 Mar 2019 15:51:22 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 13 Mar 2019 11:51:09 -0400 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 00/11] conf: partial net model enum conversion X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 13 Mar 2019 15:55:30 +0000 (UTC) v1 here: https://www.redhat.com/archives/libvir-list/2019-January/msg00763.html Changes since v1: - patch #7, case insensitive model input comparison - Add xml2xml testing - compile tested on freebsd12.0 This series partially converts the net->model value from a string to an enum. We wrap the existing ->model string in accessor functions, rename it to ->modelstr, add a ->model enum, and convert internal driver usage bit by bit. At the end, all driver code that is acting on specific network model values is comparing against an enum, not a string. This is only partial because of xen/libxl/xm and qemu drivers, which if they don't know anything particular about the model string will just place it on the qemu command line/xen config and see what happens. So basically if I were to pass in qemu would turn that into -device idontexist,... That behavior is untouched by this series, as fully unwinding that will take some more work: * Figuring out all reasonable qemu + xen values that could actually result in a working VM config, and adding them to the enum * Figuring out a long term plan for disabling passthrough entirely. There's some discussion in the v1 thread about this. Some caveats: * vz driver is not compile tested. What's the sdk magic to actually get this building? * net model enum lookup is done case insensitive. this is to maintain the behavior of the vmx and virtualbox drivers, but it's different than all our other enum usage. Cole Robinson (11): tests: Add several net model passthrough tests conf: net: Add wrapper functions for value conf: net: Rename 'model' to 'modelstr' conf: net: Add model enum, and netfront value vz: convert to net model enum bhyve: convert to net model enum qemu: Partially convert to net model enum conf: Make net model enum compare case insensitive vmx: convert to net model enum vbox: Convert to net enum model conf: Add VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING src/bhyve/bhyve_command.c | 15 +-- src/bhyve/bhyve_parse_command.c | 10 +- src/conf/domain_conf.c | 111 ++++++++++++++---- src/conf/domain_conf.h | 35 +++++- src/libvirt_private.syms | 4 + src/libxl/libxl_conf.c | 8 +- src/libxl/libxl_domain.c | 1 + src/qemu/qemu_command.c | 13 +- src/qemu/qemu_domain.c | 32 +++-- src/qemu/qemu_domain_address.c | 13 +- src/qemu/qemu_driver.c | 14 ++- src/qemu/qemu_hotplug.c | 15 ++- src/qemu/qemu_parse_command.c | 5 +- src/security/virt-aa-helper.c | 3 +- src/vbox/vbox_common.c | 29 ++--- src/vmx/vmx.c | 55 ++++----- src/vz/vz_driver.c | 7 +- src/vz/vz_sdk.c | 17 ++- src/xenconfig/xen_common.c | 31 ++--- src/xenconfig/xen_sxpr.c | 30 ++--- tests/qemuxml2argvdata/net-many-models.args | 39 ++++++ tests/qemuxml2argvdata/net-many-models.xml | 38 ++++++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmloutdata/net-many-models.xml | 53 +++++++++ tests/qemuxml2xmltest.c | 1 + tests/xlconfigdata/test-net-fakemodel.cfg | 24 ++++ tests/xlconfigdata/test-net-fakemodel.xml | 39 ++++++ tests/xlconfigtest.c | 1 + .../test-paravirt-net-fakemodel.cfg | 13 ++ .../test-paravirt-net-fakemodel.xml | 40 +++++++ .../test-paravirt-net-modelstr.cfg | 13 ++ tests/xmconfigtest.c | 1 + .../xml2sexpr-fv-net-many-models.sexpr | 1 + .../xml2sexpr-fv-net-many-models.xml | 43 +++++++ tests/xml2sexprtest.c | 1 + 35 files changed, 586 insertions(+), 170 deletions(-) create mode 100644 tests/qemuxml2argvdata/net-many-models.args create mode 100644 tests/qemuxml2argvdata/net-many-models.xml create mode 100644 tests/qemuxml2xmloutdata/net-many-models.xml create mode 100644 tests/xlconfigdata/test-net-fakemodel.cfg create mode 100644 tests/xlconfigdata/test-net-fakemodel.xml create mode 100644 tests/xmconfigdata/test-paravirt-net-fakemodel.cfg create mode 100644 tests/xmconfigdata/test-paravirt-net-fakemodel.xml create mode 100644 tests/xmconfigdata/test-paravirt-net-modelstr.cfg create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-many-models.sexpr create mode 100644 tests/xml2sexprdata/xml2sexpr-fv-net-many-models.xml -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list