From nobody Sun Feb 8 23:06:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1634037260; cv=none; d=zohomail.com; s=zohoarc; b=GG/UWmBDIkIRrQH+G2lkckmMDqxJ1kO2iDepkqc5iIiDGoPJwV8NOcFrkrw4QDWb+ysn4gbr6MCfL+uWSQDwp8bUdHiVtqw96oZE0TgQh2/4qR8ZvFfRL7Ipah9cx7VuC+kTpeeHQ/Eb/wlZMg57nBskXRTI1Hqs65nePyQZUW8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1634037260; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xnb/L1Jvn3py941NZfNDXllQb++JLl5VN5leq/9TeNs=; b=dKvQz5KEcgUCVhsSyZ8EPnINz41X/FxOlag0kvaJlEQgC0Ntxag9HMc2yyCgpe+RuxmBIpwJWBp83SilzRw9OANCA360eEb9O+SlZ2OlnvWBnrbdeY0YWqiLQQ8p9fu/mSIJRKoarYdNhU3pSEK0uLhIYIeOT2PrLG1J7+ukLK0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1634037260610578.823684426537; Tue, 12 Oct 2021 04:14:20 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-505-gZk1RrfMMUSNyET11RdfVw-1; Tue, 12 Oct 2021 07:14:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32D5D814249; Tue, 12 Oct 2021 11:14:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14FA769FA0; Tue, 12 Oct 2021 11:14:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D2385180598A; Tue, 12 Oct 2021 11:14:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19CBECv1008922 for ; Tue, 12 Oct 2021 07:14:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id DAC645D9F0; Tue, 12 Oct 2021 11:14:11 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4918F5D9D5 for ; Tue, 12 Oct 2021 11:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634037259; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Xnb/L1Jvn3py941NZfNDXllQb++JLl5VN5leq/9TeNs=; b=CzyyYzfXwfOk9Uzvvynystv9OX7hFQSJO4UvbjOXs0WhDUZ0dotwceS4P1yOuJQXobcdoa DWufaf9J+j3++5aF+VxUJVARfGZSrXrTF86ghE0uCucWzktXDzb+8g0G6pRB3+PfSpzzcZ dIEP4Ei94J0sYWvFdqwtkIlP0Y84cCI= X-MC-Unique: gZk1RrfMMUSNyET11RdfVw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/14] qemuBuildFloppyCommandLineControllerOptionsExplicit: Generate via JSON Date: Tue, 12 Oct 2021 13:12:20 +0200 Message-Id: <1bbc0b9e52323f78b36f809396e35d3e1292adf9.1634037046.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1634037262854100002 Content-Type: text/plain; charset="utf-8" QEMU declares the bootindex types as: bootindexA=3D bootindexB=3D The driveA/driveB parameters were deprecated and removed in qemu-6.0. We'll keep them for compatibility, but they are not used with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 45 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 665cd739ec..3b2f88bcb9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2183,32 +2183,29 @@ qemuBuildFloppyCommandLineControllerOptionsImplicit= (virCommand *cmd, } -static void +static int qemuBuildFloppyCommandLineControllerOptionsExplicit(virCommand *cmd, unsigned int bootindex= A, unsigned int bootindex= B, const char *backendA, - const char *backendB) + const char *backendB, + virQEMUCaps *qemuCaps) { - g_auto(virBuffer) fdc_opts =3D VIR_BUFFER_INITIALIZER; - - virBufferAddLit(&fdc_opts, "isa-fdc,"); - - if (backendA) - virBufferAsprintf(&fdc_opts, "driveA=3D%s,", backendA); - - if (bootindexA > 0) - virBufferAsprintf(&fdc_opts, "bootindexA=3D%u,", bootindexA); + g_autoptr(virJSONValue) props =3D NULL; - if (backendB) - virBufferAsprintf(&fdc_opts, "driveB=3D%s,", backendB); + if (virJSONValueObjectCreate(&props, + "s:driver", "isa-fdc", + "S:driveA", backendA, + "p:bootindexA", bootindexA, + "S:driveB", backendB, + "p:bootindexB", bootindexB, + NULL) < 0) + return -1; - if (bootindexB > 0) - virBufferAsprintf(&fdc_opts, "bootindexB=3D%u,", bootindexB); + if (qemuBuildDeviceCommandlineFromJSON(cmd, props, qemuCaps) < 0) + return -1; - virBufferTrim(&fdc_opts, ","); - virCommandAddArg(cmd, "-device"); - virCommandAddArgBuffer(cmd, &fdc_opts); + return 0; } @@ -2251,11 +2248,13 @@ qemuBuildFloppyCommandLineControllerOptions(virComm= and *cmd, return 0; if (qemuDomainNeedsFDC(def)) { - qemuBuildFloppyCommandLineControllerOptionsExplicit(cmd, - bootindexA, - bootindexB, - backendA, - backendB); + if (qemuBuildFloppyCommandLineControllerOptionsExplicit(cmd, + bootindexA, + bootindexB, + backendA, + backendB, + qemuCaps) = < 0) + return -1; } else { qemuBuildFloppyCommandLineControllerOptionsImplicit(cmd, bootindexA, --=20 2.31.1