From nobody Mon Dec 15 23:38:58 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1658846409; cv=none; d=zohomail.com; s=zohoarc; b=cfUwkHUon5+xy6cxVdXUrbUb4N3zSGktM7FFu4MjJIN0zLzg7sVtfFdbFtnMqMVOLNFRFZhnLjlsjlPf6yS9Xd3xxaMw3ryFdioLY1gYpJmGzu6D8JmmFlN4FA34lgfeofrk/HXz4mn2P022DzOEGlvQGYJALV8zkiyVrC7HD5Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658846409; 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=S2/suk2P8zaXHqe5cOa5xlsDnSJhhJunVlFHOFNt2jY=; b=SXm/or6ORqeI+to+fOTw04I2EUNujGdZizFlIjKMCmJEjZ2DbRZcukWSjlpx5I2iAlWAaNPZ2uGhYqwYeoeiD7HkxcMdD3TG6Ib2ptWsg7YI/aIi8gNbB4tq8F3fvh2HFHgsUzT49Pkh1nvjG2LSuggqq9l+0/eN16XEKGN/zNs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1658846409345457.93271522465557; Tue, 26 Jul 2022 07:40:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-436-tt5O6VkeNpGkLChnMR0x4A-1; Tue, 26 Jul 2022 10:39:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 31B793C0F37A; Tue, 26 Jul 2022 14:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D5641415123; Tue, 26 Jul 2022 14:38:56 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 448FA1947B8F; Tue, 26 Jul 2022 14:38:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0AA33194706B for ; Tue, 26 Jul 2022 14:38:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D4F36400DFD7; Tue, 26 Jul 2022 14:38:49 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E64B40466AA for ; Tue, 26 Jul 2022 14:38:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658846408; 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=S2/suk2P8zaXHqe5cOa5xlsDnSJhhJunVlFHOFNt2jY=; b=PLEea5+by2KRUsbanNCeA6zua0cGbV6HABn/PN9j+r2SqiKTuMbX/+tYHVsyIodxKR+XYd LJm4mYxekeqiLIOJKoxSiMhZ8VakB5zu093QD+QEHvs0CHZ3scj/TaWV00gcVHrTsRsJwl 0MZVQFv+e2fsSnR9iorBwLTK0GW3Few= X-MC-Unique: tt5O6VkeNpGkLChnMR0x4A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 50/80] qemu: command: Remove pre-blockdev floppy setup Date: Tue, 26 Jul 2022 16:37:28 +0200 Message-Id: <52f0e871e3e9a775f06c70ec820adc9914ba5b70.1658843187.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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: 1658846410569100001 Content-Type: text/plain; charset="utf-8" With new qemu versions we setup floppies via -device. Some legacy output tests were not modernized yet so the expected output needs to be adjusted. Signed-off-by: Peter Krempa Reviewed-by: Pavel Hrdina --- src/qemu/qemu_command.c | 50 +++-------------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e0c5e15a63..5c90138c73 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -2361,25 +2361,13 @@ qemuCommandAddExtDevice(virCommand *cmd, static void qemuBuildFloppyCommandLineControllerOptionsImplicit(virCommand *cmd, unsigned int bootindex= A, - unsigned int bootindex= B, - const char *backendA, - const char *backendB) + unsigned int bootindex= B) { - if (backendA) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "isa-fdc.driveA=3D%s", backendA); - } - if (bootindexA > 0) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "isa-fdc.bootindexA=3D%u", bootindexA); } - if (backendB) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "isa-fdc.driveB=3D%s", backendB); - } - if (bootindexB > 0) { virCommandAddArg(cmd, "-global"); virCommandAddArgFormat(cmd, "isa-fdc.bootindexB=3D%u", bootindexB); @@ -2391,8 +2379,6 @@ static int qemuBuildFloppyCommandLineControllerOptionsExplicit(virCommand *cmd, unsigned int bootindex= A, unsigned int bootindex= B, - const char *backendA, - const char *backendB, const virDomainDef *de= f, virQEMUCaps *qemuCaps) { @@ -2400,9 +2386,7 @@ qemuBuildFloppyCommandLineControllerOptionsExplicit(v= irCommand *cmd, if (virJSONValueObjectAdd(&props, "s:driver", "isa-fdc", - "S:driveA", backendA, "p:bootindexA", bootindexA, - "S:driveB", backendB, "p:bootindexB", bootindexB, NULL) < 0) return -1; @@ -2421,13 +2405,10 @@ qemuBuildFloppyCommandLineControllerOptions(virComm= and *cmd, { unsigned int bootindexA =3D 0; unsigned int bootindexB =3D 0; - g_autofree char *backendA =3D NULL; - g_autofree char *backendB =3D NULL; bool hasfloppy =3D false; size_t i; for (i =3D 0; i < def->ndisks; i++) { - g_autofree char *backendAlias =3D NULL; virDomainDiskDef *disk =3D def->disks[i]; if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_FDC) @@ -2435,17 +2416,10 @@ qemuBuildFloppyCommandLineControllerOptions(virComm= and *cmd, hasfloppy =3D true; - /* with -blockdev we setup the floppy device and it's backend with= -device */ - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV) && - qemuDomainDiskGetBackendAlias(disk, qemuCaps, &backendAlias) <= 0) - return -1; - if (disk->info.addr.drive.unit) { bootindexB =3D disk->info.effectiveBootIndex; - backendB =3D g_steal_pointer(&backendAlias); } else { bootindexA =3D disk->info.effectiveBootIndex; - backendA =3D g_steal_pointer(&backendAlias); } } @@ -2456,17 +2430,13 @@ qemuBuildFloppyCommandLineControllerOptions(virComm= and *cmd, if (qemuBuildFloppyCommandLineControllerOptionsExplicit(cmd, bootindexA, bootindexB, - backendA, - backendB, def, qemuCaps) = < 0) return -1; } else { qemuBuildFloppyCommandLineControllerOptionsImplicit(cmd, bootindexA, - bootindexB, - backendA, - backendB); + bootindexB); } return 0; @@ -2602,12 +2572,6 @@ qemuBuildDiskCommandLine(virCommand *cmd, if (qemuDiskBusIsSD(disk->bus)) return 0; - /* floppy devices are instantiated via -drive ...,if=3Dnone and bound = to the - * controller via -global isa-fdc.driveA/B options in the pre-blockdev= era */ - if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_FDC && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) - return 0; - if (qemuCommandAddExtDevice(cmd, &disk->info, def, qemuCaps) < 0) return -1; @@ -2627,12 +2591,8 @@ qemuBuildDisksCommandLine(virCommand *cmd, virQEMUCaps *qemuCaps) { size_t i; - bool blockdev =3D virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV); - /* If we want to express the floppy drives via -device, the controller= needs - * to be instantiated prior to that */ - if (blockdev && - qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps) < = 0) + if (qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps) < = 0) return -1; for (i =3D 0; i < def->ndisks; i++) { @@ -2648,10 +2608,6 @@ qemuBuildDisksCommandLine(virCommand *cmd, return -1; } - if (!blockdev && - qemuBuildFloppyCommandLineControllerOptions(cmd, def, qemuCaps) < = 0) - return -1; - return 0; } --=20 2.36.1