summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Mac-Vicar P <dmacvicar@suse.de>2016-03-20 02:01:50 +0100
committerDuncan Mac-Vicar P <dmacvicar@suse.de>2016-03-20 02:01:50 +0100
commit38a1146de055d346831f6f2214db9503a692c8fc (patch)
tree80c7e99749409882926e5717e1357a77e5fab3bb
parent5f42cff84c8fc05c9e6707a01933e2a6997e958e (diff)
downloadterraform-provider-libvirt-38a1146de055d346831f6f2214db9503a692c8fc.tar
terraform-provider-libvirt-38a1146de055d346831f6f2214db9503a692c8fc.tar.gz
if libvirt will not set permissions correctly, at least allow others read base images
-rw-r--r--libvirt/volume_def.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libvirt/volume_def.go b/libvirt/volume_def.go
index f234c685..cbc889c6 100644
--- a/libvirt/volume_def.go
+++ b/libvirt/volume_def.go
@@ -18,6 +18,10 @@ type defVolume struct {
Format struct {
Type string `xml:"type,attr"`
} `xml:"format"`
+ Permissions struct {
+ Mode int `xml:"mode,omitempty"`
+ } `xml:"permissions,omitempty"`
+
} `xml:"target"`
Allocation int `xml:"allocation"`
Capacity struct {
@@ -30,6 +34,7 @@ type defVolume struct {
func newDefVolume() defVolume {
volumeDef := defVolume{}
volumeDef.Target.Format.Type = "qcow2"
+ volumeDef.Target.Permissions.Mode = 644
volumeDef.Capacity.Unit = "bytes"
volumeDef.Capacity.Amount = 1
return volumeDef