From nobody Sun Feb 8 23:42:29 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 1510080600153561.6939789707365; Tue, 7 Nov 2017 10:50:00 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBE5A356E3; Tue, 7 Nov 2017 18:49:58 +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 A518B5C1A1; Tue, 7 Nov 2017 18:49: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 69C101800FC5; Tue, 7 Nov 2017 18:49:58 +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 vA7Infcb024872 for ; Tue, 7 Nov 2017 13:49:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5AAAE60BEF; Tue, 7 Nov 2017 18:49:41 +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 53EF11B429 for ; Tue, 7 Nov 2017 18:49:41 +0000 (UTC) Received: from mail-qt0-f171.google.com (mail-qt0-f171.google.com [209.85.216.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 2892381DFB for ; Tue, 7 Nov 2017 18:49:40 +0000 (UTC) Received: by mail-qt0-f171.google.com with SMTP id z19so266594qtg.11 for ; Tue, 07 Nov 2017 10:49:40 -0800 (PST) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id t34sm1313175qtb.79.2017.11.07.10.49.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:49:38 -0800 (PST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CBE5A356E3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.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 CBE5A356E3 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="GhM5BAtD" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2892381DFB 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 2892381DFB 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=D8hGlPpQKYBnUJG3mzNcmFtmdDiEcNOwKB2/tGN0oxw=; b=GhM5BAtD98iiNaCUqywYMXFrsy117H1CqeEc4JQX+pe/EiC5/5uQcstebSl4CIshxk ok9q0OnIE4gBtz3EY0p6T3jCG4VJSiCIqM3LkxQIAukEodX+7elw18fv7CX/wVo05B0g BTLZ3Aj7uxp0MNBq/fSM0c3DTzlRAIcgg6s4315txyXaCcFNXNfkcUlINRXRr7VkdHJ6 Ic+XjS2Zih0hslkQlYVbuaji1nmh4GoCCo5A0W/lsjkm49hKVfq6Y+q+ku4gGwmizsQa FYjaTGsJIBjBamhFLN2QP4Yvj2ZNBDShNoeH7g55Knb33Xy+JUCgzqLfJ3wKqIclrJox WbUQ== 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=D8hGlPpQKYBnUJG3mzNcmFtmdDiEcNOwKB2/tGN0oxw=; b=BS7xet6+8jut9MyVrp0YUO1mvJQ9r821KMCgtyKzB+xZGYCEkDZB9/oDhxrN4Uyagt B0VI03zU7nFnirMBMpXwlIfMLMpz8rOp4HYigGXiRVKTeCMNrhKvNEEiAin8WY0tWulS 3Kc1/9QC8En5OBmuaHR7NGTekfE0LM/LoAxfGss2d6goo40WVOo6r6xJb1KbVskf4AKU 4ozpM7hrn+D3YN0+XYGzFTeGm4w/uTTF4cO+3l2N26VZ7aoL0sX87XT6bDNhmVzMTYCi ce9OoQ7mdylAtJ+Fd0TPb+CSaNVdr3fChLz9Xvg2GScBT14goFDNzJsADCpvQh5r6F5N ocEA== X-Gm-Message-State: AMCzsaWEKyFhDjwmcme2+W0EDJQWNhmwj4kFC2ZqrkoKVutCHfCyUJNt MewST2Roke0XZ66gm+WbCH+LeofuggA= X-Google-Smtp-Source: ABhQp+SKDkeFoBDXYYRhEPgSfvpw+NU+gYgrZ3mFR9D9NKFRgIYKfXrShNC1FK/oK95soW4KzOoVfA== X-Received: by 10.237.63.202 with SMTP id w10mr29407196qth.56.1510080578846; Tue, 07 Nov 2017 10:49:38 -0800 (PST) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 7 Nov 2017 13:49:25 -0500 Message-Id: <20171107184930.12769-9-dzamirski@datto.com> In-Reply-To: <20171107184930.12769-1-dzamirski@datto.com> References: <20171107184930.12769-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, 07 Nov 2017 18:49:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 07 Nov 2017 18:49:40 +0000 (UTC) for IP:'209.85.216.171' DOMAIN:'mail-qt0-f171.google.com' HELO:'mail-qt0-f171.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.216.171 mail-qt0-f171.google.com 209.85.216.171 mail-qt0-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 v3 08/13] vbox: Correctly generate drive name in dumpxml 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 07 Nov 2017 18:49:59 +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" If a VBOX VM has e.g. a SATA and SCSI disk attached, the XML generated by dumpxml used to produce "sda" for both of those disks. This is an invalid domain XML as libvirt does not allow duplicate device names. To address this, keep the running total of disks that will use "sd" prefix for device name and pass it to the vboxGenerateMediumName which no longer tries to "compute" the value based only on current and max port and slot values. After this the vboxGetMaxPortSlotValues is not needed and was deleted. --- src/vbox/vbox_common.c | 192 ++++++++++++++-------------------------------= ---- 1 file changed, 52 insertions(+), 140 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 4d39beb1e..57b0fd515 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -290,61 +290,6 @@ static int openSessionForMachine(vboxDriverPtr data, c= onst unsigned char *dom_uu return 0; } =20 -/** - * function to get the values for max port per - * instance and max slots per port for the devices - * - * @returns true on Success, false on failure. - * @param vbox Input IVirtualBox pointer - * @param maxPortPerInst Output array of max port per instance - * @param maxSlotPerPort Output array of max slot per port - * - */ - -static bool vboxGetMaxPortSlotValues(IVirtualBox *vbox, - PRUint32 *maxPortPerInst, - PRUint32 *maxSlotPerPort) -{ - ISystemProperties *sysProps =3D NULL; - - if (!vbox) - return false; - - gVBoxAPI.UIVirtualBox.GetSystemProperties(vbox, &sysProps); - - if (!sysProps) - return false; - - gVBoxAPI.UISystemProperties.GetMaxPortCountForStorageBus(sysProps, - StorageBus_ID= E, - &maxPortPerIn= st[StorageBus_IDE]); - gVBoxAPI.UISystemProperties.GetMaxPortCountForStorageBus(sysProps, - StorageBus_SA= TA, - &maxPortPerIn= st[StorageBus_SATA]); - gVBoxAPI.UISystemProperties.GetMaxPortCountForStorageBus(sysProps, - StorageBus_SC= SI, - &maxPortPerIn= st[StorageBus_SCSI]); - gVBoxAPI.UISystemProperties.GetMaxPortCountForStorageBus(sysProps, - StorageBus_Fl= oppy, - &maxPortPerIn= st[StorageBus_Floppy]); - - gVBoxAPI.UISystemProperties.GetMaxDevicesPerPortForStorageBus(sysProps, - StorageB= us_IDE, - &maxSlot= PerPort[StorageBus_IDE]); - gVBoxAPI.UISystemProperties.GetMaxDevicesPerPortForStorageBus(sysProps, - StorageB= us_SATA, - &maxSlot= PerPort[StorageBus_SATA]); - gVBoxAPI.UISystemProperties.GetMaxDevicesPerPortForStorageBus(sysProps, - StorageB= us_SCSI, - &maxSlot= PerPort[StorageBus_SCSI]); - gVBoxAPI.UISystemProperties.GetMaxDevicesPerPortForStorageBus(sysProps, - StorageB= us_Floppy, - &maxSlot= PerPort[StorageBus_Floppy]); - - VBOX_RELEASE(sysProps); - - return true; -} =20 /** * function to generate the name for medium, @@ -352,57 +297,39 @@ static bool vboxGetMaxPortSlotValues(IVirtualBox *vbo= x, * * @returns null terminated string with device name or NULL * for failures - * @param conn Input Connection Pointer * @param storageBus Input storage bus type - * @param deviceInst Input device instance number * @param devicePort Input port number * @param deviceSlot Input slot number - * @param aMaxPortPerInst Input array of max port per device instance - * @param aMaxSlotPerPort Input array of max slot per device port - * + * @param sdCount Running total of disk devices with "sd" pr= efix */ -static char *vboxGenerateMediumName(PRUint32 storageBus, - PRInt32 deviceInst, - PRInt32 devicePort, - PRInt32 deviceSlot, - PRUint32 *aMaxPortPerInst, - PRUint32 *aMaxSlotPerPort) +static char * +vboxGenerateMediumName(PRUint32 storageBus, + PRInt32 devicePort, + PRInt32 deviceSlot, + size_t sdCount) { const char *prefix =3D NULL; char *name =3D NULL; int total =3D 0; - PRUint32 maxPortPerInst =3D 0; - PRUint32 maxSlotPerPort =3D 0; - - if (!aMaxPortPerInst || - !aMaxSlotPerPort) - return NULL; =20 if ((storageBus < StorageBus_IDE) || (storageBus > StorageBus_Floppy)) return NULL; =20 - maxPortPerInst =3D aMaxPortPerInst[storageBus]; - maxSlotPerPort =3D aMaxSlotPerPort[storageBus]; - total =3D (deviceInst * maxPortPerInst * maxSlotPerPort) - + (devicePort * maxSlotPerPort) - + deviceSlot; - if (storageBus =3D=3D StorageBus_IDE) { prefix =3D "hd"; + total =3D devicePort * 2 + deviceSlot; } else if ((storageBus =3D=3D StorageBus_SATA) || (storageBus =3D=3D StorageBus_SCSI)) { prefix =3D "sd"; + total =3D sdCount; } else if (storageBus =3D=3D StorageBus_Floppy) { + total =3D deviceSlot; prefix =3D "fd"; } =20 name =3D virIndexToDiskName(total, prefix); =20 - VIR_DEBUG("name=3D%s, total=3D%d, storageBus=3D%u, deviceInst=3D%d, " - "devicePort=3D%d deviceSlot=3D%d, maxPortPerInst=3D%u maxSlotPer= Port=3D%u", - NULLSTR(name), total, storageBus, deviceInst, devicePort, - deviceSlot, maxPortPerInst, maxSlotPerPort); return name; } =20 @@ -3259,9 +3186,7 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data= , IMachine *machine) { vboxArray mediumAttachments =3D VBOX_ARRAY_INITIALIZER; int ret =3D -1, diskCount =3D 0; - size_t i; - PRUint32 maxPortPerInst[StorageBus_Floppy + 1] =3D {}; - PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] =3D {}; + size_t sdCount =3D 0, i; =20 def->ndisks =3D 0; gVBoxAPI.UArray.vboxArrayGet(&mediumAttachments, machine, @@ -3293,9 +3218,6 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data= , IMachine *machine) def->disks[i] =3D disk; } =20 - if (!vboxGetMaxPortSlotValues(data->vboxObj, maxPortPerInst, maxSlotPe= rPort)) - goto cleanup; - /* get the attachment details here */ for (i =3D 0; i < mediumAttachments.count && diskCount < def->ndisks; = i++) { IMediumAttachment *imediumattach =3D mediumAttachments.items[i]; @@ -3307,7 +3229,6 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data= , IMachine *machine) IMedium *medium =3D NULL; PRUnichar *mediumLocUtf16 =3D NULL; char *mediumLocUtf8 =3D NULL; - PRUint32 deviceInst =3D 0; PRInt32 devicePort =3D 0; PRInt32 deviceSlot =3D 0; =20 @@ -3348,11 +3269,30 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr da= ta, IMachine *machine) } =20 gVBoxAPI.UIStorageController.GetBus(storageController, &storageBus= ); + gVBoxAPI.UIMediumAttachment.GetPort(imediumattach, &devicePort); + gVBoxAPI.UIMediumAttachment.GetDevice(imediumattach, &deviceSlot); + + def->disks[diskCount]->dst =3D vboxGenerateMediumName(storageBus, + devicePort, + deviceSlot, + sdCount); + if (!def->disks[diskCount]->dst) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not generate medium name for the disk " + "at: port:%d, slot:%d"), devicePort, deviceSl= ot); + VBOX_RELEASE(medium); + VBOX_RELEASE(storageController); + + goto cleanup; + } + if (storageBus =3D=3D StorageBus_IDE) { def->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_IDE; } else if (storageBus =3D=3D StorageBus_SATA) { + sdCount++; def->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_SATA; } else if (storageBus =3D=3D StorageBus_SCSI) { + sdCount++; def->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_SCSI; } else if (storageBus =3D=3D StorageBus_Floppy) { def->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_FDC; @@ -3366,24 +3306,6 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr dat= a, IMachine *machine) else if (deviceType =3D=3D DeviceType_DVD) def->disks[diskCount]->device =3D VIR_DOMAIN_DISK_DEVICE_CDROM; =20 - gVBoxAPI.UIMediumAttachment.GetPort(imediumattach, &devicePort); - gVBoxAPI.UIMediumAttachment.GetDevice(imediumattach, &deviceSlot); - def->disks[diskCount]->dst =3D vboxGenerateMediumName(storageBus, - deviceInst, - devicePort, - deviceSlot, - maxPortPerInst, - maxSlotPerPort= ); - if (!def->disks[diskCount]->dst) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not generate medium name for the disk " - "at: controller instance:%u, port:%d, slot:%d= "), - deviceInst, devicePort, deviceSlot); - VBOX_RELEASE(medium); - VBOX_RELEASE(storageController); - - goto cleanup; - } =20 gVBoxAPI.UIMedium.GetReadOnly(medium, &readOnly); if (readOnly =3D=3D PR_TRUE) @@ -5664,9 +5586,7 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr= def, ISnapshot *snap =3D NULL; IMachine *snapMachine =3D NULL; vboxArray mediumAttachments =3D VBOX_ARRAY_INITIALIZER; - PRUint32 maxPortPerInst[StorageBus_Floppy + 1] =3D {}; - PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] =3D {}; - int diskCount =3D 0; + size_t diskCount =3D 0, sdCount =3D 0; nsresult rc; vboxIID snapIid; char *snapshotUuidStr =3D NULL; @@ -5735,9 +5655,6 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr= def, goto cleanup; } =20 - if (!vboxGetMaxPortSlotValues(data->vboxObj, maxPortPerInst, maxSlotPe= rPort)) - goto cleanup; - /* get the attachment details here */ for (i =3D 0; i < mediumAttachments.count && diskCount < def->ndisks; = i++) { IStorageController *storageController =3D NULL; @@ -5747,7 +5664,6 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr= def, IMedium *disk =3D NULL; PRUnichar *childLocUtf16 =3D NULL; char *childLocUtf8 =3D NULL; - PRUint32 deviceInst =3D 0; PRInt32 devicePort =3D 0; PRInt32 deviceSlot =3D 0; vboxArray children =3D VBOX_ARRAY_INITIALIZER; @@ -5865,11 +5781,9 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPt= r def, =20 def->disks[diskCount].src->type =3D VIR_STORAGE_TYPE_F= ILE; def->disks[diskCount].name =3D vboxGenerateMediumName(= storageBus, - de= viceInst, de= vicePort, de= viceSlot, - ma= xPortPerInst, - ma= xSlotPerPort); + sd= Count); } VBOX_UTF8_FREE(diskSnapIdStr); } @@ -5877,6 +5791,9 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr= def, VBOX_RELEASE(storageController); VBOX_RELEASE(disk); diskCount++; + + if (storageBus =3D=3D StorageBus_SATA || storageBus =3D=3D Storage= Bus_SCSI) + sdCount++; } gVBoxAPI.UArray.vboxArrayRelease(&mediumAttachments); =20 @@ -5902,10 +5819,7 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr= def, IMedium *disk =3D NULL; nsresult rc; vboxArray mediumAttachments =3D VBOX_ARRAY_INITIALIZER; - size_t i =3D 0; - PRUint32 maxPortPerInst[StorageBus_Floppy + 1] =3D {}; - PRUint32 maxSlotPerPort[StorageBus_Floppy + 1] =3D {}; - int diskCount =3D 0; + size_t i =3D 0, diskCount =3D 0, sdCount =3D 0; int ret =3D -1; =20 if (!data->vboxObj) @@ -5968,9 +5882,6 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr = def, goto cleanup; } =20 - if (!vboxGetMaxPortSlotValues(data->vboxObj, maxPortPerInst, maxSlotPe= rPort)) - goto cleanup; - /* get the attachment details here */ for (i =3D 0; i < mediumAttachments.count && diskCount < def->dom->ndi= sks; i++) { PRUnichar *storageControllerName =3D NULL; @@ -5979,7 +5890,6 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr = def, PRBool readOnly =3D PR_FALSE; PRUnichar *mediumLocUtf16 =3D NULL; char *mediumLocUtf8 =3D NULL; - PRUint32 deviceInst =3D 0; PRInt32 devicePort =3D 0; PRInt32 deviceSlot =3D 0; IMediumAttachment *imediumattach =3D mediumAttachments.items[i]; @@ -6054,11 +5964,26 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPt= r def, _("Cannot get read only attribute")); goto cleanup; } + + def->dom->disks[diskCount]->dst =3D vboxGenerateMediumName(storage= Bus, + devicePor= t, + deviceSlo= t, + sdCount); + if (!def->dom->disks[diskCount]->dst) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Could not generate medium name for the disk " + "at: port:%d, slot:%d"), devicePort, deviceSl= ot); + ret =3D -1; + goto cleanup; + } + if (storageBus =3D=3D StorageBus_IDE) { def->dom->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_IDE; } else if (storageBus =3D=3D StorageBus_SATA) { + sdCount++; def->dom->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_SATA; } else if (storageBus =3D=3D StorageBus_SCSI) { + sdCount++; def->dom->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_SCSI; } else if (storageBus =3D=3D StorageBus_Floppy) { def->dom->disks[diskCount]->bus =3D VIR_DOMAIN_DISK_BUS_FDC; @@ -6080,21 +6005,8 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr= def, if (readOnly =3D=3D PR_TRUE) def->dom->disks[diskCount]->src->readonly =3D true; def->dom->disks[diskCount]->src->type =3D VIR_STORAGE_TYPE_FILE; - def->dom->disks[diskCount]->dst =3D vboxGenerateMediumName(storage= Bus, - deviceIns= t, - devicePor= t, - deviceSlo= t, - maxPortPe= rInst, - maxSlotPe= rPort); - if (!def->dom->disks[diskCount]->dst) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not generate medium name for the disk " - "at: controller instance:%u, port:%d, slot:%d= "), - deviceInst, devicePort, deviceSlot); - ret =3D -1; - goto cleanup; - } - diskCount ++; + + diskCount++; } =20 ret =3D 0; --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list