From nobody Sat May 18 21:45:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637346409; cv=none; d=zohomail.com; s=zohoarc; b=DOZwt9x+CcZC8d35ZpxlzCD1HUQFSwZ8N+R7DI2hWyle+bQGSN2JxNem6Hzo2gIgwSz0bNJQpnHAfiFDP/gkxQeaNQYSrfqrr/Gew8ug5rqVqGc8jqg4Gp4/kFa3PdVWvVQ8C13Yp0wirAW4NjgkvkXmMJkGN1rZbQNhV9L/whA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637346409; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=t/+69RMQMKVy9SWHWe9IbQWVPseIcaQ5vY4PE8uxTRA=; b=aIrgCLJA9XmMZKq+3tHasBn1Yqi4c2H8ycirHNxIP5f7GMfKf0ITK/iIxD0INACeB0OvzK33zKKbp0m04Zepha8Y9Ir/yVvEoQXI/moesXiSCu2l9ypPZIRa1mRVBuGf9W/Jvjhe6bIU7hx4Ghf115r7h2D+5BczECa6c/wB57k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16373464098058.56979385905197; Fri, 19 Nov 2021 10:26:49 -0800 (PST) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-405-BsYW2q1BPASjIDnQSzdcYA-1; Fri, 19 Nov 2021 13:26:47 -0500 Received: by mail-wm1-f69.google.com with SMTP id n41-20020a05600c502900b003335ab97f41so5161902wmr.3 for ; Fri, 19 Nov 2021 10:26:47 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id b10sm510248wrt.36.2021.11.19.10.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 10:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637346408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t/+69RMQMKVy9SWHWe9IbQWVPseIcaQ5vY4PE8uxTRA=; b=eobOZ062Zqt7SSadktVZnWwzP81AwjZi18hrTh+bc8pqooxJTMQPq2nzW79Mk+xiYsO4Xa TpDjVRAfPt1WZehePpyDvdv4Uzudmw9POniCLrVSZA1RzmWJcTmSrPHjglAGTpM6M+KfJR DFfC2Ny5+FLkrgaAGazbuzLeMfdBp4M= X-MC-Unique: BsYW2q1BPASjIDnQSzdcYA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=t/+69RMQMKVy9SWHWe9IbQWVPseIcaQ5vY4PE8uxTRA=; b=wQSEJG+RqPOJbaohADp8hxg4FCCJoO1hPEHYInyY3Jb/noR0zeKlfDp7+JfPRoLYof qnJAPY/vNu5nYtK0IpuLvCcNjacN5g9WY3Kc4bmEtLbnT1eojS/lQP6NX/ZFMOwTC16w F5BMWFfa6abPurOeaLHIvXXaQGdmiGKAatUvsImeNGGOKgRSY4fNlR/fpnL39n56KiNJ RUVVWiTXqPCs1UbSCZ5EUwTYKa4HvygqrN+pJXKNeWWBYWQ9wsiKr2kG+EHdATtmOLJJ aF3iEwOMQdO458X4+NyW8c/OrPGuW7vQRODNLrCWFfaekx8YiI1EGPZ6h9Wfh8dT8cIx DW+A== X-Gm-Message-State: AOAM533Ht7+PT5nVeBgIFkvTR57WnzUfgbEAhj5fJBTdC2AFd5toYEm2 NzWDV6XAQDiSyvFcyIwwE/NYRJKZfBOVrUiML8tlNjWy9mYwYcf5HL2VKxzDlhpM7AuY7q1flYO rumMbouNyyRaEdg== X-Received: by 2002:a1c:f005:: with SMTP id a5mr2200858wmb.19.1637346406133; Fri, 19 Nov 2021 10:26:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDM5yzNZtwt1ryIh4WXKoM6ikc3nfIEwR17SaCBev4PZWXTwgIYx3+yAkUJDZnCoobTx515Q== X-Received: by 2002:a1c:f005:: with SMTP id a5mr2200838wmb.19.1637346405972; Fri, 19 Nov 2021 10:26:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Markus Armbruster Subject: [RFC PATCH-for-6.2 v3] qdev-monitor: Only allow full --global .= option Date: Fri, 19 Nov 2021 19:26:44 +0100 Message-Id: <20211119182644.480115-1-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637346411949100001 When not all fields of the --global option are provided, QEMU might crash: $ qemu-system-x86_64 -global driver=3Disa-fdc qemu-system-x86_64: ../../devel/qemu/qapi/string-input-visitor.c:394: string_input_visitor_new: Assertion `str' failed. Aborted (core dumped) Fix by only allowing --global with all 3 fields: $ qemu-system-x86_64 -global driver=3Disa-fdc Invalid 'global' option format. It must be provided as: --global .=3D Reported-by: Thomas Huth Suggested-by: Markus Armbruster Resolves: https://gitlab.com/qemu-project/qemu/-/issues/604 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v3: Change qemu_global_option (Markus) Supersedes: <20211119122911.365036-1-philmd@redhat.com> --- softmmu/qdev-monitor.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c index 01f3834db57..558272b147c 100644 --- a/softmmu/qdev-monitor.c +++ b/softmmu/qdev-monitor.c @@ -1029,13 +1029,10 @@ int qemu_global_option(const char *str) qemu_opt_set(opts, "value", str + offset + 1, &error_abort); return 0; } + printf("Invalid 'global' option format. It must be provided as:\n"); + printf(" --global .=3D\n"); =20 - opts =3D qemu_opts_parse_noisily(&qemu_global_opts, str, false); - if (!opts) { - return -1; - } - - return 0; + return -1; } =20 bool qmp_command_available(const QmpCommand *cmd, Error **errp) --=20 2.31.1