From patchwork Fri Feb 8 22:11:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 157872 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp917jaa; Fri, 8 Feb 2019 14:12:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IbERbWXeyX0dTsiEn+Rq8qxIo2/phw7DkOMoXcGoGXRmRZAOsJgLftETkH8lq6QUTTMLVJx X-Received: by 2002:ac8:1702:: with SMTP id w2mr5197036qtj.164.1549663947777; Fri, 08 Feb 2019 14:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549663947; cv=none; d=google.com; s=arc-20160816; b=Jm6Nshqt0PQkrSejatacwlJp7Z7Wk5pP9WWwBDsqtVJXPEPiG0pijaUlEo04gQLFWA X8FQbRfwMP3dnwiTSMwxr0La9FbmcPVHfiNXyfib7JBwUF2VDFJFb4cWavdlhR/8lLA9 aeSVdjcMkco4UlRcysnwB1k79puW9AzhdRBxShn+8py8VFZw85VsDGlBZF3j2uurZm4K czsYGY5+0Wcp2YhYa7ifv7ZIwj15nnl8Oa1fVwy9bcKoU4LXBgHpXbr0CEE1lt64MVEd iiUMGR738/SU76BMnXq8yoOu0D9i0V4ICcwktjy+ButJ/vM9JP8dNbJOojp2zNuCZWTA RAKQ== 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 :cc:mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=B5woJz2t6W4TlgoRa0ZdHQh+YSJqo4/VAfuxLdhtek8=; b=uPo3T07e5zDCBVChDQVA+EQMCrYlUUSxWno/gl89GIrGVGvk7E5fNFIXqdyT3/qwuX UcCcjDnieVos4Cu+SlC/oDSYRvN2uPKpHUfXi3+FC2t+1xqUWBatmoTz5OqisA2VpVUN 7eIXVQ7+QnzPUFk9q/om5oJJ9iO5US1FFO3js5A8yIh8xlbxM1o9XG4xPIPpiDwWEb3l IqWxby7bJXAi6YYxIgFQCkJFPmckzG+KZJIuULooH7YrCUzKWC87OiBmlENbpUs3PXCI lOhfHlcGoONIJXs8m7kIZbx2AaGPIyjDsej7ZXJX/fqi4OYNwqEzxXkEiDo1QWJHYWLm iz9g== 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 i14si2324944qkg.219.2019.02.08.14.12.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Feb 2019 14:12:27 -0800 (PST) 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-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4E9959450; Fri, 8 Feb 2019 22:12:25 +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 2C1455B682; Fri, 8 Feb 2019 22:12:25 +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 18BED3F7D0; Fri, 8 Feb 2019 22:12:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x18MCJau008383 for ; Fri, 8 Feb 2019 17:12:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 91E8A5C6A6; Fri, 8 Feb 2019 22:12:19 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-115.rdu2.redhat.com [10.10.123.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B37B5C6A5; Fri, 8 Feb 2019 22:12:19 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 8 Feb 2019 17:11:52 -0500 Message-Id: <68983230e2f6aad3b1e1e9178f689de5172833b9.1549663396.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH v3 01/17] qemu: command: Add qemuCaps to BuildVirtioStr 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 08 Feb 2019 22:12:26 +0000 (UTC) It will be used in future patches Reviewed-by: Andrea Bolognani Signed-off-by: Cole Robinson --- src/qemu/qemu_command.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 572d3bc20f..a26f6291ac 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -409,6 +409,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, * qemuBuildVirtioDevStr * @buf: virBufferPtr to append the built string * @baseName: qemu virtio device basename string. Ex: virtio-rng for + * @qemuCaps: virQEMUCapPtr * @devtype: virDomainDeviceType of the device. Ex: VIR_DOMAIN_DEVICE_TYPE_RNG * @devdata: *DefPtr of the device definition * @@ -422,6 +423,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, static int qemuBuildVirtioDevStr(virBufferPtr buf, const char *baseName, + virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, virDomainDeviceType devtype, void *devdata) { @@ -2078,7 +2080,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, break; case VIR_DOMAIN_DISK_BUS_VIRTIO: - if (qemuBuildVirtioDevStr(&opt, "virtio-blk", + if (qemuBuildVirtioDevStr(&opt, "virtio-blk", qemuCaps, VIR_DOMAIN_DEVICE_DISK, disk) < 0) { goto error; } @@ -2673,7 +2675,7 @@ qemuBuildFSDevStr(const virDomainDef *def, goto error; } - if (qemuBuildVirtioDevStr(&opt, "virtio-9p", + if (qemuBuildVirtioDevStr(&opt, "virtio-9p", qemuCaps, VIR_DOMAIN_DEVICE_FS, fs) < 0) { goto error; } @@ -2880,7 +2882,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: switch ((virDomainControllerModelSCSI) def->model) { case VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI: - if (qemuBuildVirtioDevStr(&buf, "virtio-scsi", + if (qemuBuildVirtioDevStr(&buf, "virtio-scsi", qemuCaps, VIR_DOMAIN_DEVICE_CONTROLLER, def) < 0) { goto error; } @@ -2923,7 +2925,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef, break; case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: - if (qemuBuildVirtioDevStr(&buf, "virtio-serial", + if (qemuBuildVirtioDevStr(&buf, "virtio-serial", qemuCaps, VIR_DOMAIN_DEVICE_CONTROLLER, def) < 0) { goto error; } @@ -3745,7 +3747,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, char macaddr[VIR_MAC_STRING_BUFLEN]; if (virDomainNetIsVirtioModel(net)) { - if (qemuBuildVirtioDevStr(&buf, "virtio-net", + if (qemuBuildVirtioDevStr(&buf, "virtio-net", qemuCaps, VIR_DOMAIN_DEVICE_NET, net) < 0) { goto error; } @@ -4141,7 +4143,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd, if (!virDomainDefHasMemballoon(def)) return 0; - if (qemuBuildVirtioDevStr(&buf, "virtio-balloon", + if (qemuBuildVirtioDevStr(&buf, "virtio-balloon", qemuCaps, VIR_DOMAIN_DEVICE_MEMBALLOON, def->memballoon) < 0) { goto error; @@ -4241,25 +4243,25 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, switch ((virDomainInputType)dev->type) { case VIR_DOMAIN_INPUT_TYPE_MOUSE: - if (qemuBuildVirtioDevStr(&buf, "virtio-mouse", + if (qemuBuildVirtioDevStr(&buf, "virtio-mouse", qemuCaps, VIR_DOMAIN_DEVICE_INPUT, dev) < 0) { goto error; } break; case VIR_DOMAIN_INPUT_TYPE_TABLET: - if (qemuBuildVirtioDevStr(&buf, "virtio-tablet", + if (qemuBuildVirtioDevStr(&buf, "virtio-tablet", qemuCaps, VIR_DOMAIN_DEVICE_INPUT, dev) < 0) { goto error; } break; case VIR_DOMAIN_INPUT_TYPE_KBD: - if (qemuBuildVirtioDevStr(&buf, "virtio-keyboard", + if (qemuBuildVirtioDevStr(&buf, "virtio-keyboard", qemuCaps, VIR_DOMAIN_DEVICE_INPUT, dev) < 0) { goto error; } break; case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: - if (qemuBuildVirtioDevStr(&buf, "virtio-input-host", + if (qemuBuildVirtioDevStr(&buf, "virtio-input-host", qemuCaps, VIR_DOMAIN_DEVICE_INPUT, dev) < 0) { goto error; } @@ -4580,7 +4582,7 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, } if (STREQ(model, "virtio-gpu")) { - if (qemuBuildVirtioDevStr(&buf, "virtio-gpu", + if (qemuBuildVirtioDevStr(&buf, "virtio-gpu", qemuCaps, VIR_DOMAIN_DEVICE_VIDEO, video) < 0) { goto error; } @@ -5028,7 +5030,7 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def, goto cleanup; } - if (qemuBuildVirtioDevStr(&buf, "vhost-scsi", + if (qemuBuildVirtioDevStr(&buf, "vhost-scsi", qemuCaps, VIR_DOMAIN_DEVICE_HOSTDEV, dev) < 0) { goto cleanup; } @@ -5978,7 +5980,7 @@ qemuBuildRNGDevStr(const virDomainDef *def, dev->source.file)) goto error; - if (qemuBuildVirtioDevStr(&buf, "virtio-rng", + if (qemuBuildVirtioDevStr(&buf, "virtio-rng", qemuCaps, VIR_DOMAIN_DEVICE_RNG, dev) < 0) { goto error; } @@ -10449,7 +10451,7 @@ qemuBuildVsockDevStr(virDomainDefPtr def, char *ret = NULL; - if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", + if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", qemuCaps, VIR_DOMAIN_DEVICE_VSOCK, vsock) < 0) { goto cleanup; }