public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server 06/22] drive: remove geometry options gone since QEMU 3.1
Date: Thu, 12 Jun 2025 16:02:37 +0200	[thread overview]
Message-ID: <20250612140253.106555-7-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250612140253.106555-1-f.ebner@proxmox.com>

It was not possible to start a QEMU instance with these options set
since QEMU version 3.1, QEMU commit b24ec3c462 ("block: Remove
deprecated -drive geometry options") and thus also not to take a
backup. It is still possible to restore an ancient backup with these
options set and they will be automatically dropped.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/QemuServer.pm       |  2 +-
 PVE/QemuServer/Drive.pm | 30 +++++-------------------------
 2 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 5408ba8a..3803e64e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1457,7 +1457,7 @@ sub print_drive_commandline_full {
     my $is_rbd = $path =~ m/^rbd:/;
 
     my $opts = '';
-    my @qemu_drive_options = qw(heads secs cyls trans media cache rerror werror aio discard);
+    my @qemu_drive_options = qw(media cache rerror werror aio discard);
     foreach my $o (@qemu_drive_options) {
 	$opts .= ",$o=$drive->{$o}" if defined($drive->{$o});
     }
diff --git a/PVE/QemuServer/Drive.pm b/PVE/QemuServer/Drive.pm
index 297f6bef..c7fd29e3 100644
--- a/PVE/QemuServer/Drive.pm
+++ b/PVE/QemuServer/Drive.pm
@@ -170,27 +170,6 @@ my %drivedesc_base = (
 	default => 'disk',
 	optional => 1
     },
-    cyls => {
-	type => 'integer',
-	description => "Force the drive's physical geometry to have a specific cylinder count.",
-	optional => 1
-    },
-    heads => {
-	type => 'integer',
-	description => "Force the drive's physical geometry to have a specific head count.",
-	optional => 1
-    },
-    secs => {
-	type => 'integer',
-	description => "Force the drive's physical geometry to have a specific sector count.",
-	optional => 1
-    },
-    trans => {
-	type => 'string',
-	enum => [qw(none lba auto)],
-	description => "Force disk geometry bios translation mode.",
-	optional => 1,
-    },
     snapshot => {
 	type => 'boolean',
 	description => "Controls qemu's snapshot mode feature."
@@ -700,7 +679,7 @@ sub drive_is_read_only {
     return $drive->{interface} ne 'sata' && $drive->{interface} ne 'ide';
 }
 
-# ideX = [volume=]volume-id[,media=d][,cyls=c,heads=h,secs=s[,trans=t]]
+# ideX = [volume=]volume-id[,media=d]
 #        [,snapshot=on|off][,cache=on|off][,format=f][,backup=yes|no]
 #        [,rerror=ignore|report|stop][,werror=enospc|ignore|report|stop]
 #        [,aio=native|threads][,discard=ignore|on][,detect_zeroes=on|off]
@@ -777,8 +756,7 @@ sub parse_drive {
     return if $res->{iops_wr} && $res->{iops};
 
     if ($res->{media} && ($res->{media} eq 'cdrom')) {
-	return if $res->{snapshot} || $res->{trans} || $res->{format};
-	return if $res->{heads} || $res->{secs} || $res->{cyls};
+	return if $res->{snapshot} || $res->{format};
 	return if $res->{interface} eq 'virtio';
     }
 
@@ -791,7 +769,9 @@ sub parse_drive {
 
 sub print_drive {
     my ($drive, $with_alloc) = @_;
-    my $skip = [ 'index', 'interface' ];
+    # clys, heads, secs and trans were removed in QEMU 3.1, but they could still appear in old
+    # backups, so skip them for restore
+    my $skip = [ 'index', 'interface', 'cyls', 'heads', 'secs', 'trans' ];
     my $fmt = $with_alloc ? $alldrive_fmt_with_alloc : $alldrive_fmt;
     return PVE::JSONSchema::print_property_string($drive, $fmt, $skip);
 }
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-06-12 14:05 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12 14:02 [pve-devel] [PATCH-SERIES qemu-server 00/22] preparation for switch to blockdev Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 01/22] drive: code cleanup: drop unused $vmid parameter from get_path_and_format() Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 02/22] cfg2cmd: require at least QEMU binary version 6.0 Fiona Ebner
2025-06-13  9:18   ` Fabian Grünbichler
2025-06-16  8:47     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 03/22] drive: parse: use hash argument for optional parameters Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 04/22] drive: parse drive: support parsing with additional properties Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 05/22] restore: parse drive " Fiona Ebner
2025-06-13  9:30   ` Fabian Grünbichler
2025-06-16  8:51     ` Fiona Ebner
2025-06-12 14:02 ` Fiona Ebner [this message]
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 07/22] clone disk: io uring check: fix call to determine cache direct Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 08/22] drive: move storage_allows_io_uring_default() and drive_uses_cache_direct() helpers to drive module Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 09/22] drive: introduce aio_cmdline_option() helper Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 10/22] drive: introduce detect_zeroes_cmdline_option() helper Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 11/22] introduce StateFile module for state file related helpers Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 12/22] vm start: move state file handling to dedicated module Fiona Ebner
2025-06-13 10:00   ` Fabian Grünbichler
2025-06-16 10:34     ` Fiona Ebner
2025-06-16 10:54       ` Fabian Grünbichler
2025-06-16 10:57         ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 13/22] vm start: move config_to_command() call further down Fiona Ebner
2025-06-13 10:05   ` Fabian Grünbichler
2025-06-16 10:54     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 14/22] vm start/commandline: also clean up pci reservation when config_to_command() fails Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 15/22] vm start/commandline: activate volumes before config_to_command() Fiona Ebner
2025-06-13 10:16   ` Fabian Grünbichler
2025-06-17  7:46     ` Fiona Ebner
2025-06-13 10:25   ` Fabian Grünbichler
2025-06-16 11:31   ` DERUMIER, Alexandre via pve-devel
2025-06-16 11:51     ` Fiona Ebner
2025-06-16 12:46       ` Fabian Grünbichler
2025-06-16 12:57         ` Fiona Ebner
2025-06-16 13:15           ` Fabian Grünbichler
2025-06-16 13:27             ` Fiona Ebner
     [not found]   ` <409e12ad0b53d1b51c30717e6b9df3d370112df4.camel@groupe-cyllene.com>
2025-06-17  6:04     ` DERUMIER, Alexandre via pve-devel
2025-06-17  7:35       ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 16/22] print drive device: explicitly set write-cache starting with machine version 10.0 Fiona Ebner
2025-06-13 10:28   ` Fabian Grünbichler
2025-06-17  7:47     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 17/22] print drive device: set {r, w}error front-end properties " Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 18/22] print drive device: don't reference any drive for 'none' " Fiona Ebner
2025-06-13 11:14   ` Fabian Grünbichler
2025-06-17  7:54     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 19/22] drive: create a throttle group for each drive " Fiona Ebner
2025-06-13 11:23   ` Fabian Grünbichler
2025-06-17  7:58     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [PATCH qemu-server 20/22] blockdev: add helpers to generate blockdev commandline Fiona Ebner
2025-06-13 11:35   ` Fabian Grünbichler
2025-06-17  9:37     ` Fiona Ebner
2025-06-17  9:58       ` Fabian Grünbichler
2025-06-16 11:07   ` DERUMIER, Alexandre via pve-devel
2025-06-17 10:02     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [RFC qemu-server 21/22] blockdev: add support for NBD paths Fiona Ebner
2025-06-16 10:46   ` DERUMIER, Alexandre via pve-devel
2025-06-17 10:11     ` Fiona Ebner
2025-06-12 14:02 ` [pve-devel] [RFC qemu-server 22/22] command line: switch to blockdev starting with machine version 10.0 Fiona Ebner
2025-06-16 10:40   ` DERUMIER, Alexandre via pve-devel
2025-06-18 11:39     ` Fiona Ebner
2025-06-18 12:04       ` DERUMIER, Alexandre via pve-devel
2025-06-16  6:22 ` [pve-devel] [PATCH-SERIES qemu-server 00/22] preparation for switch to blockdev DERUMIER, Alexandre via pve-devel
2025-06-16  8:44   ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250612140253.106555-7-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal