From nobody Fri Apr 26 15:27:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15528529838801011.7770660577708; Sun, 17 Mar 2019 13:03:03 -0700 (PDT) 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) 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: , Content-Transfer-Encoding: quoted-printable 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) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: J=C3=A1n Tomko --- src/lxc/lxc_driver.c | 7 ------- src/qemu/qemu_driver.c | 14 -------------- 2 files changed, 21 deletions(-) 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 do= m, virSecurityLabelPtr secla if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - 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 d= om, virSecurityLabelPtr secl if (virDomainGetSecurityLabelEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - 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(virDomainP= tr dom, if (virDomainGetSecurityLabelListEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - 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. */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list