fix #3728: handle machine without type
libguestfs starts their helper VMs with `-machine accel=..` without a
machine type, and our pve version suffix handling would segfault in that
case. there might be other scripted use cases that are affected as well.
this regression was introduced with the rebase of our patch set on top
of 6.1.0
Fixes: f376b2b9e2
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
50999525c6
commit
7cf6b60926
@ -93,7 +93,7 @@ index d87cf6e103..e5010236f3 100644
|
||||
g_slist_free(machines);
|
||||
if (local_err) {
|
||||
error_append_hint(&local_err, "Use -machine help to list supported machines\n");
|
||||
@@ -3312,12 +3318,29 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
@@ -3312,12 +3318,31 @@ void qemu_init(int argc, char **argv, char **envp)
|
||||
case QEMU_OPTION_machine:
|
||||
{
|
||||
bool help;
|
||||
@ -109,6 +109,7 @@ index d87cf6e103..e5010236f3 100644
|
||||
+
|
||||
+ // PVE version is specified with '+' as seperator, e.g. pc-i440fx+pvever
|
||||
+ name = qdict_get_try_str(machine_opts_dict, "type");
|
||||
+ if (name != NULL) {
|
||||
+ name_len = strlen(name);
|
||||
+ pvever_index = strcspn(name, "+");
|
||||
+ if (pvever_index < name_len) {
|
||||
@ -119,6 +120,7 @@ index d87cf6e103..e5010236f3 100644
|
||||
+ g_free(name_clean);
|
||||
+ g_free(pvever);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user