From patchwork Thu May 19 18:59:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?J=C3=A1n_Tomko?= X-Patchwork-Id: 68200 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3368388qge; Thu, 19 May 2016 12:03:53 -0700 (PDT) X-Received: by 10.55.5.66 with SMTP id 63mr15853415qkf.84.1463684633516; Thu, 19 May 2016 12:03:53 -0700 (PDT) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id b49si13599019qgb.61.2016.05.19.12.03.52 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 19 May 2016 12:03:53 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u4JIxqnb000419; Thu, 19 May 2016 14:59:52 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u4JIxplr016751 for ; Thu, 19 May 2016 14:59:51 -0400 Received: from localhost.localdomain (ovpn-204-22.brq.redhat.com [10.40.204.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4JIxlKV003990 for ; Thu, 19 May 2016 14:59:50 -0400 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 19 May 2016 20:59:41 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] qemu: process: Drop !QEMU_CAPS_DEVICE code 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: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com From: Cole Robinson Nowadays we only support qemu 0.12.0+ which provides QEMU_CAPS_DEVICE, so this is all dead code. --- src/qemu/qemu_process.c | 53 ++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 29 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 40c238b..b7c8f25 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2406,31 +2406,29 @@ qemuProcessInitPasswords(virConnectPtr conn, goto cleanup; } - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - for (i = 0; i < vm->def->ndisks; i++) { - size_t secretLen; + for (i = 0; i < vm->def->ndisks; i++) { + size_t secretLen; - if (!vm->def->disks[i]->src->encryption || - !virDomainDiskGetSource(vm->def->disks[i])) - continue; + if (!vm->def->disks[i]->src->encryption || + !virDomainDiskGetSource(vm->def->disks[i])) + continue; - VIR_FREE(secret); - if (qemuProcessGetVolumeQcowPassphrase(conn, - vm->def->disks[i], - &secret, &secretLen) < 0) - goto cleanup; + VIR_FREE(secret); + if (qemuProcessGetVolumeQcowPassphrase(conn, + vm->def->disks[i], + &secret, &secretLen) < 0) + goto cleanup; - VIR_FREE(alias); - if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0) - goto cleanup; - if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) - goto cleanup; - ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret); - if (qemuDomainObjExitMonitor(driver, vm) < 0) - ret = -1; - if (ret < 0) - goto cleanup; - } + VIR_FREE(alias); + if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0) + goto cleanup; + if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) + goto cleanup; + ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret); + if (qemuDomainObjExitMonitor(driver, vm) < 0) + ret = -1; + if (ret < 0) + goto cleanup; } cleanup: @@ -3290,9 +3288,8 @@ qemuProcessReconnect(void *opaque) goto cleanup; } - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) - if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0) - goto error; + if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0) + goto error; /* if domain requests security driver we haven't loaded, report error, but * do not kill the domain @@ -5981,11 +5978,9 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED, * we also need to populate the PCI address set cache for later * use in hotplug */ - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) { - VIR_DEBUG("Assigning domain PCI addresses"); - if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0) + VIR_DEBUG("Assigning domain PCI addresses"); + if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0) goto error; - } if ((timestamp = virTimeStringNow()) == NULL) goto error;