From patchwork Sun Mar 17 20:02:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160473 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1888751jad; Sun, 17 Mar 2019 13:03:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnAVMIOPJMT7bdEbKE0oLA03ipu3Yc/XXDgl9dPOHYcNGFY3gAnbhNtbzRHRzsayLhlHGe X-Received: by 2002:a0c:804b:: with SMTP id 69mr10492651qva.133.1552852983454; Sun, 17 Mar 2019 13:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552852983; cv=none; d=google.com; s=arc-20160816; b=maotsXtsBCt0OmZR6Lu2RpbBbfKuYNRYH3VM3KtGRo3NU8j5+aT2iCrG+27wfYIhLd n1guXt/228xyUKLdEpdG65D5oOv9Jrr16r+t5oPK5UCFPxZZX6Ku+/XnKi2EEJ2h1X/f y40sKvQjcaWZj4GK2My7JgUVHaOQiLl2ZnXlxfZb93mHeEd/m2yxbwCS5hwKzkxD30o6 22lHhDGlfVhqzzjIDt0aJU+J9mqJ9NavklVvC4imFmOZqYtepFc6An6Y55Sdm2VphAgw Elu8mLHH0LTGDdEI+E4Ap67qz7HrM/ipJF0dF79ltLFY8+ue82lPJgdQFNmojAahpe+y lUqg== 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=GzL6igph3qcVyg1XsdsDOuJISgJawgRD1CfIQOiXG7Y=; b=xzAXKzCrngIOJg5q//9ZQC/PHxKGKbo5UQzSwQIWCLV26Wt60vfWwWukO838vkpww1 T1Z4tfKDioDaBkKdnE6PMWMwLdVZfhg+y4XCfBlNE7RuhIy4C2q1tQqH5l9jkqnQT1Ts rruKqeLULJqmerN8Cfj3MGM73zPd715ug+mLFIlrrLiN0mQJIvMaHX1hSGiNLKlSho8K dTtSMZ/GwCrKJKzdCXJU6PV6MKisYsPXXiXPrcZ4fyMEcilFC/6xBKCKeifoBSqsreke +MWEpPhAXABn6JvSBs6/xAJ95sbokw2nPoqyqe8HU9juMaxy/A5le9LBpHMs/8w/Fj84 9Ngg== 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 r5si2753462qvn.116.2019.03.17.13.03.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2019 13:03:03 -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 9C4FF307D93E; Sun, 17 Mar 2019 20:03:00 +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 D192660FD9; Sun, 17 Mar 2019 20:02:58 +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 A2C9D41F3D; Sun, 17 Mar 2019 20:02:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2HK2qoM006279 for ; Sun, 17 Mar 2019 16:02:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id E319719C71; Sun, 17 Mar 2019 20:02:52 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-120-181.rdu2.redhat.com [10.10.120.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 597E419C68; Sun, 17 Mar 2019 20:02:49 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 17 Mar 2019 16:02:43 -0400 Message-Id: <7f55992124317d35929f20f99985da6b5d445524.1552852963.git.crobinso@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] Drop needless virtType validation 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.48]); Sun, 17 Mar 2019 20:03:02 +0000 (UTC) This code originates from: commit d0aa10fdd6c108ad442886e4451b2629a3dc8b86 Author: Daniel P. Berrange Date: Tue Mar 3 12:03:44 2009 +0000 QEMU security driver usage for sVirt support (James Morris, Dan Walsh, Daniel Berrange) Originally in the qemudDomainGetSecurityLabel function. It doesn't appear to have done anything useful back then either. The other two instances look like copy+paste Signed-off-by: Cole Robinson --- src/lxc/lxc_driver.c | 7 ------- src/qemu/qemu_driver.c | 14 -------------- 2 files changed, 21 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Ján Tomko diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 760f9f8bdf..e981f8e901 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1268,13 +1268,6 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!virDomainVirtTypeToString(vm->def->virtType)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown virt type in domain definition '%d'"), - vm->def->virtType); - goto cleanup; - } - /* * Theoretically, the pid can be replaced during this operation and * return the label of a different process. If atomicity is needed, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3615270650..a16eab5467 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6445,13 +6445,6 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!virDomainVirtTypeToString(vm->def->virtType)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown virt type in domain definition '%d'"), - vm->def->virtType); - goto cleanup; - } - /* * Theoretically, the pid can be replaced during this operation and * return the label of a different process. If atomicity is needed, @@ -6493,13 +6486,6 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom, if (virDomainGetSecurityLabelListEnsureACL(dom->conn, vm->def) < 0) goto cleanup; - if (!virDomainVirtTypeToString(vm->def->virtType)) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("unknown virt type in domain definition '%d'"), - vm->def->virtType); - goto cleanup; - } - /* * Check the comment in qemuDomainGetSecurityLabel function. */