From nobody Mon Feb 9 12:15:25 2026 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 1508873769607109.73361847326828; Tue, 24 Oct 2017 12:36:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3FD6C0587F6; Tue, 24 Oct 2017 19:36:07 +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 A980618994; Tue, 24 Oct 2017 19:36:07 +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 704FD6EF29; Tue, 24 Oct 2017 19:36:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9OJZjNQ009691 for ; Tue, 24 Oct 2017 15:35:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 39FD660A9D; Tue, 24 Oct 2017 19:35:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33E42614FB for ; Tue, 24 Oct 2017 19:35:45 +0000 (UTC) Received: from mail-qk0-f171.google.com (mail-qk0-f171.google.com [209.85.220.171]) (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 425B385363 for ; Tue, 24 Oct 2017 19:35:44 +0000 (UTC) Received: by mail-qk0-f171.google.com with SMTP id n5so27713225qke.11 for ; Tue, 24 Oct 2017 12:35:44 -0700 (PDT) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id f66sm683127qkc.25.2017.10.24.12.35.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Oct 2017 12:35:42 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E3FD6C0587F6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx08.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 E3FD6C0587F6 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="mkJ5v2g6" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 425B385363 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 425B385363 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=UUufJZ1fcXfVBWacdYqNTNfTQc4NIC4YXtU2DI3Bj6M=; b=mkJ5v2g6xF1ZyFpPloqXSTvDU9iYa/Gb2H/QgEoaOQZeB+0sM16Bo/1C9JAI4cCa5J qPIGRt2qMnpwABY1bOZmR1edIBx6wFbaI2ymu6MYo8cOnnKnbouBFdMQF0MHx0TUlpRU ppc1arjsAy3FejHHLDfPiMUMaXwrMHW81pMsckqPkmKlLqT5Vgi5cmgubOVkIGT9C9Y9 /ZT1hOnxVkvhCF28CqTmKfcIE08QnAubYEfKdEW3MbngUqNB3PRWEMDDc0Hqr2J+e3Cj CFL/PsnjD8uRREOFPuAYt8J5g7nYHOoEKKARs+vb80995zVrY4A2YoTGZDT4iEYZJm8Z LXDQ== 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=UUufJZ1fcXfVBWacdYqNTNfTQc4NIC4YXtU2DI3Bj6M=; b=aaa4LCqUy7Sd5zfOFzxU7Ye0UQYjdkoQqC8RVuqDaZDFKocmOirP9DK3Y+DABO5LKn 2kQyC3Olc03y1Xn6IPtevKdutYDzjhDYWD7iVUvOcG0g8Na265EKdtTWti9cTLE1oGf4 RpzhszmsbNprPSfCFAYf0sWnVKXyTSUQOXXQCX/hCAHeUMdsLmJtpFfacLdRBMZ1vdXn CNlNOyW+lR9kAn8ArV3KutsnZaccRKGIW1iDd9YFCFhu4nLIebZ/OX52W29oi3DVMdFI JDChbHruWOlIO2D6595c8Ukw5ynbuRXiNymOgKKlmyYx+udoaG+XzXVM1x7IUi/W49zy Hh7g== X-Gm-Message-State: AMCzsaXOEpANM0imhTb20ex8eRMWgIgrlS2StoH4bxVrURwLcVeoxwEo xISfV5Qen40+QdQBf+GToXCzT76Qw0M= X-Google-Smtp-Source: ABhQp+TTdHIlbMaFpU+dxQqtFeZbpTSQJ6mIA+utsXey8v4hlKb06NBbLXIRybDiAbUJHu5Kd50+wA== X-Received: by 10.55.212.70 with SMTP id l67mr25892685qki.140.1508873743186; Tue, 24 Oct 2017 12:35:43 -0700 (PDT) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 24 Oct 2017 15:35:31 -0400 Message-Id: <20171024193538.9078-9-dzamirski@datto.com> In-Reply-To: <20171024193538.9078-1-dzamirski@datto.com> References: <20171024193538.9078-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 24 Oct 2017 19:35:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 24 Oct 2017 19:35:44 +0000 (UTC) for IP:'209.85.220.171' DOMAIN:'mail-qk0-f171.google.com' HELO:'mail-qk0-f171.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: -2.311 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.220.171 mail-qk0-f171.google.com 209.85.220.171 mail-qk0-f171.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/15] vbox: Add more IStorageController API mappings 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 24 Oct 2017 19:36:08 +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" This patch exposes additional methods of the native VBOX API to the libvirt 'unified' vbox API to deal with IStorageController. The exposed methods are: * IStorageController->GetStorageControllerType() * IStorageController->SetStorageControllerType() * IMachine->GetStorageControllers() Reviewed-by: John Ferlan --- src/vbox/vbox_common.h | 13 +++++++++++++ src/vbox/vbox_tmpl.c | 20 ++++++++++++++++++++ src/vbox/vbox_uniformed_api.h | 3 +++ 3 files changed, 36 insertions(+) diff --git a/src/vbox/vbox_common.h b/src/vbox/vbox_common.h index c6da8929d..b08ad1e3e 100644 --- a/src/vbox/vbox_common.h +++ b/src/vbox/vbox_common.h @@ -235,6 +235,19 @@ enum StorageBus StorageBus_SAS =3D 5 }; =20 +enum StorageControllerType +{ + StorageControllerType_Null =3D 0, + StorageControllerType_LsiLogic =3D 1, + StorageControllerType_BusLogic =3D 2, + StorageControllerType_IntelAhci =3D 3, + StorageControllerType_PIIX3 =3D 4, + StorageControllerType_PIIX4 =3D 5, + StorageControllerType_ICH6 =3D 6, + StorageControllerType_I82078 =3D 7, + StorageControllerType_LsiLogicSas =3D 8 +}; + enum AccessMode { AccessMode_ReadOnly =3D 1, diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 2679b60f7..a25f14c09 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -550,6 +550,11 @@ static void* _handleUSBGetDeviceFilters(IUSBCommon *US= BCommon) return USBCommon->vtbl->GetDeviceFilters; } =20 +static void* _handleMachineGetStorageControllers(IMachine *machine) +{ + return machine->vtbl->GetStorageControllers; +} + static void* _handleMachineGetMediumAttachments(IMachine *machine) { return machine->vtbl->GetMediumAttachments; @@ -1916,6 +1921,18 @@ _storageControllerGetBus(IStorageController *storage= Controller, PRUint32 *bus) return storageController->vtbl->GetBus(storageController, bus); } =20 +static nsresult +_storageControllerGetControllerType(IStorageController *storageController,= PRUint32 *controllerType) +{ + return storageController->vtbl->GetControllerType(storageController, c= ontrollerType); +} + +static nsresult +_storageControllerSetControllerType(IStorageController *storageController,= PRUint32 controllerType) +{ + return storageController->vtbl->SetControllerType(storageController, c= ontrollerType); +} + static nsresult _sharedFolderGetHostPath(ISharedFolder *sharedFolder, PRUnichar **hostPath) { @@ -2265,6 +2282,7 @@ static vboxUniformedArray _UArray =3D { .handleGetMachines =3D _handleGetMachines, .handleGetHardDisks =3D _handleGetHardDisks, .handleUSBGetDeviceFilters =3D _handleUSBGetDeviceFilters, + .handleMachineGetStorageControllers =3D _handleMachineGetStorageContro= llers, .handleMachineGetMediumAttachments =3D _handleMachineGetMediumAttachme= nts, .handleMachineGetSharedFolders =3D _handleMachineGetSharedFolders, .handleSnapshotGetChildren =3D _handleSnapshotGetChildren, @@ -2496,6 +2514,8 @@ static vboxUniformedIMediumAttachment _UIMediumAttach= ment =3D { =20 static vboxUniformedIStorageController _UIStorageController =3D { .GetBus =3D _storageControllerGetBus, + .GetControllerType =3D _storageControllerGetControllerType, + .SetControllerType =3D _storageControllerSetControllerType, }; =20 static vboxUniformedISharedFolder _UISharedFolder =3D { diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index 2ccaf43e8..dc0b391b2 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -135,6 +135,7 @@ typedef struct { void* (*handleGetMachines)(IVirtualBox *vboxObj); void* (*handleGetHardDisks)(IVirtualBox *vboxObj); void* (*handleUSBGetDeviceFilters)(IUSBCommon *USBCommon); + void* (*handleMachineGetStorageControllers)(IMachine *machine); void* (*handleMachineGetMediumAttachments)(IMachine *machine); void* (*handleMachineGetSharedFolders)(IMachine *machine); void* (*handleSnapshotGetChildren)(ISnapshot *snapshot); @@ -410,6 +411,8 @@ typedef struct { /* Functions for IStorageController */ typedef struct { nsresult (*GetBus)(IStorageController *storageController, PRUint32 *bu= s); + nsresult (*SetControllerType)(IStorageController *storageController, P= RUint32 controllerType); + nsresult (*GetControllerType)(IStorageController *storageController, P= RUint32 *controllerType); } vboxUniformedIStorageController; =20 /* Functions for ISharedFolder */ --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list