summaryrefslogtreecommitdiff
path: root/libvirt/resource_libvirt_volume.go
diff options
context:
space:
mode:
Diffstat (limited to 'libvirt/resource_libvirt_volume.go')
-rw-r--r--libvirt/resource_libvirt_volume.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libvirt/resource_libvirt_volume.go b/libvirt/resource_libvirt_volume.go
index 918981e4..234772db 100644
--- a/libvirt/resource_libvirt_volume.go
+++ b/libvirt/resource_libvirt_volume.go
@@ -159,7 +159,7 @@ func resourceLibvirtVolumeCreate(d *schema.ResourceData, meta interface{}) error
} else {
log.Printf("Image %s image is: %d bytes", img, size)
volumeDef.Capacity.Unit = "B"
- volumeDef.Capacity.Amount = size
+ volumeDef.Capacity.Value = size
}
} else {
_, noSize := d.GetOk("size")
@@ -168,7 +168,7 @@ func resourceLibvirtVolumeCreate(d *schema.ResourceData, meta interface{}) error
if noSize && noBaseVol {
return fmt.Errorf("'size' needs to be specified if no 'source' or 'base_volume_id' is given.")
}
- volumeDef.Capacity.Amount = uint64(d.Get("size").(int))
+ volumeDef.Capacity.Value = uint64(d.Get("size").(int))
}
if baseVolumeId, ok := d.GetOk("base_volume_id"); ok {
@@ -250,7 +250,7 @@ func resourceLibvirtVolumeCreate(d *schema.ResourceData, meta interface{}) error
// upload source if present
if _, ok := d.GetOk("source"); ok {
- err = img.Import(newCopier(virConn, volume, volumeDef.Capacity.Amount), volumeDef)
+ err = img.Import(newCopier(virConn, volume, volumeDef.Capacity.Value), volumeDef)
if err != nil {
return fmt.Errorf("Error while uploading source %s: %s", img.String(), err)
}