]> git.proxmox.com Git - qemu-server.git/commitdiff
correcctly check if option is a drive
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 14 Oct 2013 05:35:04 +0000 (07:35 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 14 Oct 2013 05:35:04 +0000 (07:35 +0200)
PVE/API2/Qemu.pm

index a2d033ebfa77a3b3a96f6f3b9d024456a7e63932..c8a2738db3e3190b8b686ceba8ae728a752ca950 100644 (file)
@@ -2188,7 +2188,9 @@ __PACKAGE__->register_method({
                    my $net = PVE::QemuServer::parse_net($value);
                    $net->{macaddr} =  PVE::Tools::random_ether_addr();
                    $newconf->{$opt} = PVE::QemuServer::print_net($net);
-               } elsif (my $drive = PVE::QemuServer::parse_drive($opt, $value)) {
+               } elsif (PVE::QemuServer::valid_drivename($opt)) {
+                   my $drive = PVE::QemuServer::parse_drive($opt, $value);
+                   die "unable to parse drive options for '$opt'\n" if !$drive;
                    if (PVE::QemuServer::drive_is_cdrom($drive)) {
                        $newconf->{$opt} = $value; # simply copy configuration
                    } else {