From nobody Thu May 15 18:12:38 2025 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150887936966487.19024307420636; Tue, 24 Oct 2017 14:09:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0139F37E8E; Tue, 24 Oct 2017 21:09:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C32835D9CB; Tue, 24 Oct 2017 21:09:27 +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 61FA11804485; Tue, 24 Oct 2017 21:09:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9OL9NHD023713 for ; Tue, 24 Oct 2017 17:09:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id BFA265D75A; Tue, 24 Oct 2017 21:09:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9BF15D6A2 for ; Tue, 24 Oct 2017 21:09:21 +0000 (UTC) Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3F6903D957 for ; Tue, 24 Oct 2017 21:09:20 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id f199so28084753qke.2 for ; Tue, 24 Oct 2017 14:09:20 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id e43sm901453qte.74.2017.10.24.14.09.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2017 14:09:18 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0139F37E8E Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0139F37E8E Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="scPiNb9d" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3F6903D957 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3F6903D957 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=IzI6kjdYwXIqbVxouIs6Iqk2CSbQ0BzEnzKdspo7u+o=; b=scPiNb9deXSBPb9ApiTEK0pbSMdsPkxFg4L09zONfy/MWNjmI16JBgQlcVePQybW1U bRyHw8UeAnHgRc4GoqLQQKvQPz2l0u0Pibt3f5TBQrP0rsQ+D1JD9FeEvu35GVC98trG ZxV9XhUHDl7BZ9dHx6ZQj0GeIQlTxlOy+xirW+mBe9n08wGdOHje0E9SQnwsnXuFjFeJ e7k1AVg+5cGIWSIzc979jHhZlrVqfOr/HazgBnu/8AYxDYet0Hqm9/knF27PwTIW5mT6 206A2Ckbz9oougbbqicinmSe7PHf1SAJgvxq4Mhs6tMqiWjxuahm+7CvVqhsXfVM3Peo nt4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=IzI6kjdYwXIqbVxouIs6Iqk2CSbQ0BzEnzKdspo7u+o=; b=A1Rj/eNBDFKWHxjBwjW/aZimvgDhejySodBMuZIu7k+x6pJvEaPvGe+CSbHq1kvuIk Nrsoa/tzgVj//2BWjXQgo9HFdUTtEtJMgYIw+IYeIGd9+/azcCSn+dcZU+TMPrv4MQ5R xZhjFnqCg0/9DwqyjXQOgYALpBesTTUngawwX0cO8YeTk1VJtptvQrdW0aVQOZ85to+S QgI1b6YoKHpkRIxiRa2+cR+3ZL+QLa4Wme44bO+8Mt8TI2Ap/LD+tCra21PMWlxWdgiB RVddn/vsXzTW5BSal0XR5S0qPj9cR32A2G2I24xDhasosgkrncCFdDWqtsVQcYCRVc5D iTLA== X-Gm-Message-State: AMCzsaXFNkvcDebiUREa7nS3BgwNcfmkaMDmO2k1NbtuqcLhreUWycVB iIMzb+4NbeKK5SCmlue5QCpE7in1U0M= X-Google-Smtp-Source: ABhQp+SQqveiwKjJzFQnIgsJPdY1tsIjgwdCHeqOQe+wBxK6etqFNp/Fjk7/MSkhF/jnCtqG62kLog== X-Received: by 10.55.198.209 with SMTP id s78mr23795033qkl.143.1508879359229; Tue, 24 Oct 2017 14:09:19 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 24 Oct 2017 17:09:15 -0400 Message-Id: <20171024210917.7728-2-dzamirski@datto.com> In-Reply-To: <20171024210917.7728-1-dzamirski@datto.com> References: <20171024210917.7728-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 24 Oct 2017 21:09:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 24 Oct 2017 21:09:20 +0000 (UTC) for IP:'209.85.220.196' DOMAIN:'mail-qk0-f196.google.com' HELO:'mail-qk0-f196.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.469 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.196 mail-qk0-f196.google.com 209.85.220.196 mail-qk0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/3] vbox: Remove old unflexible macros 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 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 24 Oct 2017 21:09:28 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The VBOX_SESSION_OPEN/CLOSE macros are only called in _vboxDomainSnapshotRestore and they are unflexible because: * assume the caller will have variable named "data" * can only create Write lock type As per above, it's not that hard to simply use the VBOX API directly. Reviewed-by: John Ferlan --- src/vbox/vbox_tmpl.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index dffeabde0..ce2ee9037 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -144,12 +144,6 @@ if (strUtf16) {\ (unsigned)(iid)->m3[7]);\ }\ =20 -#define VBOX_SESSION_OPEN(/* unused */ iid_value, /* in */ machine) \ - machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write) - -#define VBOX_SESSION_CLOSE() \ - data->vboxSession->vtbl->UnlockMachine(data->vboxSession) - #define VBOX_IID_INITIALIZER { NULL, true } =20 static void @@ -323,7 +317,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom, goto cleanup; } =20 - rc =3D VBOX_SESSION_OPEN(domiid.value, machine); + rc =3D machine->vtbl->LockMachine(machine, data->vboxSession, LockType= _Write); #if VBOX_API_VERSION < 5000000 if (NS_SUCCEEDED(rc)) rc =3D data->vboxSession->vtbl->GetConsole(data->vboxSession, &con= sole); @@ -368,7 +362,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom, #if VBOX_API_VERSION < 5000000 VBOX_RELEASE(console); #endif /*VBOX_API_VERSION < 5000000*/ - VBOX_SESSION_CLOSE(); + data->vboxSession->vtbl->UnlockMachine(data->vboxSession); vboxIIDUnalloc(&domiid); return ret; } --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list