Re: [pve-devel] [PATCH qemu-server] implement is_shared_only check

2016-12-01 Thread Dietmar Maurer
Your implementation also ignores snapshots (which can contain
further local disks).

We already have some code to detect if a VM only uses
shared resources in PVE::QemuMigrate::sync_disks().

And please note that a shared storage may not be available 
on all nodes, see PVE::QemuServer::check_storage_availability().

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


Re: [pve-devel] [PATCH qemu-server] implement is_shared_only check

2016-12-01 Thread Dietmar Maurer
>  
> +sub is_shared_only {
> +my ($class, $conf, $scfg) = @_;
> +
> +my $issharedonly = 1;
> +PVE::QemuServer::foreach_drive($conf, sub {
> + my ($ds, $drive) = @_;
> +
> + # exit early
> + return if !$issharedonly;
> +
> + return if $drive->{file} eq 'none'; # cdrom with no file
> + my $sid = PVE::Storage::parse_volume_id($drive->{file});

I guess this does not work for absolute paths (e.g. /dev/sda5)

> + my $storage = PVE::Storage::storage_config($scfg, $sid);

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