<p dir="ltr">Wouldn't this cause issues with multiple systems attempting to control the same device simultaneously?</p>
<div class="gmail_quote">On Oct 25, 2014 12:07 PM, "Jasmin Jessich" <<a href="mailto:jasmin@anw.at">jasmin@anw.at</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Signed-off-by: Jasmin Jessich <<a href="mailto:jasmin@anw.at">jasmin@anw.at</a>><br>
---<br>
 PVE/API2/Qemu.pm  | 5 ++++-<br>
 PVE/QemuServer.pm | 8 ++++++++<br>
 2 files changed, 12 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm<br>
index a0fcd28..32ee6de 100644<br>
--- a/PVE/API2/Qemu.pm<br>
+++ b/PVE/API2/Qemu.pm<br>
@@ -71,6 +71,7 @@ my $check_storage_access_clone = sub {<br>
        my ($ds, $drive) = @_;<br>
<br>
        my $isCDROM = PVE::QemuServer::drive_is_cdrom($drive);<br>
+       my $isDEVICE = PVE::QemuServer::drive_is_device($drive);<br>
<br>
        my $volid = $drive->{file};<br>
<br>
@@ -86,7 +87,7 @@ my $check_storage_access_clone = sub {<br>
                $sharedvm = 0 if !$scfg->{shared};<br>
<br>
            }<br>
-       } else {<br>
+       } elsif (!$isDEVICE) {<br>
            my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);<br>
            my $scfg = PVE::Storage::storage_config($storecfg, $sid);<br>
            $sharedvm = 0 if !$scfg->{shared};<br>
@@ -2260,6 +2261,8 @@ __PACKAGE__->register_method({<br>
                    die "unable to parse drive options for '$opt'\n" if !$drive;<br>
                    if (PVE::QemuServer::drive_is_cdrom($drive)) {<br>
                        $newconf->{$opt} = $value; # simply copy configuration<br>
+                   } elsif (PVE::QemuServer::drive_is_device($drive)) {<br>
+                       $newconf->{$opt} = $value; # simply copy configuration<br>
                    } else {<br>
                        if ($param->{full}) {<br>
                            die "Full clone feature is not available"<br>
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm<br>
index 98264d1..49fbffa 100644<br>
--- a/PVE/QemuServer.pm<br>
+++ b/PVE/QemuServer.pm<br>
@@ -1272,6 +1272,14 @@ sub drive_is_cdrom {<br>
<br>
 }<br>
<br>
+sub drive_is_device {<br>
+    my ($drive) = @_;<br>
+<br>
+    my $volid = $drive->{file};<br>
+<br>
+    return $volid && $volid =~ m/^\/dev\//;<br>
+}<br>
+<br>
 sub parse_hostpci {<br>
     my ($value) = @_;<br>
<br>
--<br>
1.8.3.2<br>
<br>
_______________________________________________<br>
pve-devel mailing list<br>
<a href="mailto:pve-devel@pve.proxmox.com">pve-devel@pve.proxmox.com</a><br>
<a href="http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel" target="_blank">http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel</a><br>
</blockquote></div>