You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VirtualDeviceList.AssignController should generate a negative random device key so that it will not collide with existing devices' keys. However, it sometimes generates positive key.
To Reproduce
run code below
// key has not been set to disk yet (disk.Key == 0)disk:=&types.VirtualDisk{
VirtualDevice: types.VirtualDevice{},
}
l:= object.VirtualDeviceList{disk}
c, _:=l.CreateIDEController()
// AssignContoller gives a new random key to device if it does not have a key yetl.AssignController(disk, c.(types.BaseVirtualController))
fmt.Printf("disk device key: %d\n", disk.Key)
Expected behavior
A clear and concise description of what you expected to happen.
AssignController always gives negative keys to the device.
Affected version
Please provide details on the version used, e.g. release tag, commit, module version, etc.
govmomi v0.28.0
Screenshots/Debug Output
AssignController sometimes gives a positive key to the device.
// key is positive
disk device key: 1697971134
Additional context
Add any other context about the problem here.
This is same issue as #2536, CreateEthernetCard sometimes generated a positive device key.
Generated key is expected to be negative (#2156), but type convertion from uint32 to int32 may change the key's sign.
The text was updated successfully, but these errors were encountered:
Describe the bug
VirtualDeviceList.AssignController
should generate a negative random device key so that it will not collide with existing devices' keys. However, it sometimes generates positive key.To Reproduce
Expected behavior
A clear and concise description of what you expected to happen.
AssignController
always gives negative keys to the device.Affected version
Please provide details on the version used, e.g. release tag, commit, module version, etc.
Screenshots/Debug Output
AssignController
sometimes gives a positive key to the device.Additional context
Add any other context about the problem here.
This is same issue as #2536,
CreateEthernetCard
sometimes generated a positive device key.Generated key is expected to be negative (#2156), but type convertion from
uint32
toint32
may change the key's sign.The text was updated successfully, but these errors were encountered: