Skip to content

Commit

Permalink
handle storage pool permissions
Browse files Browse the repository at this point in the history
- add permission block to XML

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
  • Loading branch information
miurahr committed Dec 8, 2013
1 parent 5813af1 commit 5bd991d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/vagrant-kvm/driver/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,20 @@ def init_storage_directory(pool_path, pool_name)
pool = @conn.lookup_storage_pool_by_name(pool_name)
@logger.info("Init storage pool #{pool_name}")
rescue Libvirt::RetrieveError
owner = Process.uid
group = Process.gid
storage_pool_xml = <<-EOF
<pool type="dir">
<name>#{pool_name}</name>
<target>
<path>#{pool_path}</path>
</target>
</pool>
<pool type="dir">
<name>#{pool_name}</name>
<target>
<path>#{pool_path}</path>
<permissions>
<owner>#{owner}</owner>
<group>#{group}</group>
<mode>774</mode>
</permissions>
</target>
</pool>
EOF
pool = @conn.define_storage_pool_xml(storage_pool_xml)
pool.build
Expand Down

0 comments on commit 5bd991d

Please sign in to comment.