Re: [pve-devel] [PATCH] zfs: fix wait by alloc_image

2015-01-28 Thread Dietmar Maurer

 diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
 index 10da7f7..ed10484 100644
 --- a/PVE/Storage/ZFSPoolPlugin.pm
 +++ b/PVE/Storage/ZFSPoolPlugin.pm
 @@ -185,6 +185,13 @@ sub alloc_image {
  
  $class-zfs_create_zvol($scfg, $name, $size);
  
 +run_command (udevadm trigger --subsystem-match block);
 +run_command (udevadm settle --timeout 5);

Oh, we cannot do that, because ZFSPluging is also using this method:

sub alloc_image {
my ($class, $storeid, $scfg, $vmid, $fmt, $name, $size) = @_;

my $volname = $class-SUPER::alloc_image($storeid, $scfg, $vmid, $fmt,
$name, $size);
 

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH] zfs: fix wait by alloc_image

2015-01-28 Thread Wolfgang Link

Signed-off-by: Wolfgang Link w.l...@proxmox.com
---
 PVE/Storage/ZFSPoolPlugin.pm |7 +++
 1 file changed, 7 insertions(+)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 10da7f7..ed10484 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -185,6 +185,13 @@ sub alloc_image {
 
 $class-zfs_create_zvol($scfg, $name, $size);
 
+run_command (udevadm trigger --subsystem-match block);
+run_command (udevadm settle --timeout 5);
+
+for (1..4) {
+   Time::HiRes::usleep(100);
+}
+
 return $name;
 }
 
-- 
1.7.10.4


___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH] zfs: fix wait by alloc_image

2015-01-28 Thread Dietmar Maurer
 +run_command (udevadm trigger --subsystem-match block);
 +run_command (udevadm settle --timeout 5);
 

reasonable

 +for (1..4) {
 +   Time::HiRes::usleep(100);
 +}

but I do not understand this one?

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel