From patchwork Wed Jan 23 21:32:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 156406 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1201771jaa; Wed, 23 Jan 2019 13:33:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN5bHONBEFPiLcVbierzJ/FPxkuPfrDxOd/jErc1KWeFbpTOozZa6u676nwPffTH2XbyBJL4 X-Received: by 2002:ac8:28d2:: with SMTP id j18mr4087829qtj.191.1548279230569; Wed, 23 Jan 2019 13:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548279230; cv=none; d=google.com; s=arc-20160816; b=i7NRJFMiVdGeZqQH4KzIbhlwr3AsT1RTkdM3sBStWSgLmq2kn6Kb0Jxij3I0aiD5qu aoYOUO+HcYQtmjTfmYzV4DXFG26d7KPOgjmNVqdgGDmWM5/s8heJaUSsKML2GNUuAt1N XGKhqDqOPo3VD7leadDnJpOssLfX8tA90JZLVr8GgBHGiOZona5jQW38q/ESQc7bDcUf 7GWH7fgzyc8A+LHmEJNOXvvcQJseMfGCEJ0dCDbxMxu5mmuopNekZHMVJeLg3P9oyvXJ jbfr8g2EFd50otV0rqOJXYUCI1laFgh1Stf9Jf7ZgD14sa6ic6an70We7u3qlQZ5AWFf +G6g== 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:references:in-reply-to:message-id:date:to:from :delivered-to; bh=z3ocsB6q8W6aofWnZDgv8+ygDwfDYEZbdUxeAIWj6Z0=; b=Zpl4N79c+VZs84e4YcaUjR8q7++CZxXiwjJtVE1mNxOWGCVR5pnUHKDKCPO806NW/O aWMachPAdWBGxMeh/coKD+/oswtEuYRuXaPetdpbHfqZ5AYpdi4WyQ92WbaO2MmmTIf3 HEyp9Wev6oPgbsybfkH7dFuOHSE0ZhWS6l3lY0EjMEUTmD5sbSrQB7Hh/XXV8W7Bfja7 WBn2aceBbbF3pbOLhZOcTT4fPkc/eXDCyVXKevniR1SErVxqnKrbwzwLcOw4Ua+nd30g HOoYXEdvWOtS7ko7GRtloyJ6Vg4ere4iBQBGeewNcvCx44hwO6kY38ODh40mhq0RH64D rC+w== 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 j13si7402416qti.103.2019.01.23.13.33.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jan 2019 13:33:50 -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 BF5097F3FA; Wed, 23 Jan 2019 21:33:48 +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 7E4EC5D75F; Wed, 23 Jan 2019 21:33:48 +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 262AF3F60C; Wed, 23 Jan 2019 21:33:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0NLXOH7032319 for ; Wed, 23 Jan 2019 16:33:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8C318BA8D; Wed, 23 Jan 2019 21:33:24 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-120-34.rdu2.redhat.com [10.10.120.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7A7A65F72; Wed, 23 Jan 2019 21:33:23 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 23 Jan 2019 16:32:37 -0500 Message-Id: <4a44cafbddd520ecb3214afc1b334546de2d8441.1548278585.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/25] 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.25]); Wed, 23 Jan 2019 21:33:49 +0000 (UTC) It will be used in future patches 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 Reviewed-by: Andrea Bolognani diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3a9e9def78..659274f25a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -400,6 +400,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 * @@ -413,6 +414,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, static int qemuBuildVirtioDevStr(virBufferPtr buf, const char *baseName, + virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED, virDomainDeviceType devtype, void *devdata) { @@ -2069,7 +2071,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; } @@ -2660,7 +2662,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; } @@ -2868,7 +2870,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; } @@ -2911,7 +2913,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; } @@ -3682,7 +3684,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; } @@ -4078,7 +4080,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; @@ -4178,25 +4180,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; } @@ -4517,7 +4519,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; } @@ -4965,7 +4967,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; } @@ -5915,7 +5917,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; } @@ -10390,7 +10392,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; }