From nobody Sat Feb 7 06:35:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1579076865; cv=none; d=zohomail.com; s=zohoarc; b=A8Srv3vKK6B5joAgexisb0o4PD3PYqKdlsnjN6gPjV/Kaua/pDiwdfa8K0HVAXBshHmo4XvltpfX6KFdn1HcYuvMOpKc5D/LReS25cBJeta2MGOy859MgqzLiRAo5ytdouqmraSNYO/JQmeMMHshRLCyRf1+3B7sa5WHHK+fvZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579076865; h=Content-Type:Content-Transfer-Encoding:Cc: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=om6yjO9u8u5TWMQT5kx9yAhanDM4qQ3ZIJ5Sr1EjcIo=; b=bU2m79qCOJmmlKR/D62HB+zpgPTkGWMddFGpPV5JedUIrxWlJT5IrnB8Izhxc/Lz2bQmnW07Xd0u1Ws1qnSY4jMm1FNDIN7dLGLrgVKPZZCRnPtsORvPxb0Tfnh5p24oQsIZE25OijHDFNTOKlKEAN+wamZZ5LwrwOjM/O6qxIw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1579076865470446.2335333209635; Wed, 15 Jan 2020 00:27:45 -0800 (PST) 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-38-ISIKK8KNMoCbe5c8Y5IIHA-1; Wed, 15 Jan 2020 03:27:42 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 18E49107ACC7; Wed, 15 Jan 2020 08:27:37 +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 E1DFF100E7E3; Wed, 15 Jan 2020 08:27:36 +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 82CBA18089CE; Wed, 15 Jan 2020 08:27:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00F8RYx7016814 for ; Wed, 15 Jan 2020 03:27:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id D7F0B5C541; Wed, 15 Jan 2020 08:27:34 +0000 (UTC) Received: from hansolo.redhat.com (ovpn-12-195.pek2.redhat.com [10.72.12.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id A86F25C296; Wed, 15 Jan 2020 08:27:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579076864; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=om6yjO9u8u5TWMQT5kx9yAhanDM4qQ3ZIJ5Sr1EjcIo=; b=i88HFZrH/XvRGJf2r4GhwzkwSRO3RmkL9FO5TldVRfn00g6ZA6L87my/Kwb6nWPCxfp+WP 2Hz/36JFmN7QQIE5k4KqqFZpNRrCge5A2yL86qM3eDEFEGBt5DUllKVVpwWXm+4QtPeVg+ ZsTZrWTRVoh1e5i+QgzPG3DGK8mQzug= From: Han Han To: libvir-list@redhat.com Date: Wed, 15 Jan 2020 16:24:57 +0800 Message-Id: <20200115082458.4926-4-hhan@redhat.com> In-Reply-To: <20200115082458.4926-1-hhan@redhat.com> References: <20200115082458.4926-1-hhan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Han Han , devel@ovirt.org Subject: [libvirt] [PATCH 3/4] qemu: Drop support of media update in live disk attach API 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.84 on 10.5.11.22 X-MC-Unique: ISIKK8KNMoCbe5c8Y5IIHA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" virDomainUpdateDeviceFlags has been introduced since v0.8.0. There is no reason to use virDomainAttachDevice* API to update media for cdrom or floopy device. https://bugzilla.redhat.com/show_bug.cgi?id=3D1788793 Signed-off-by: Han Han --- src/qemu/qemu_hotplug.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 31d455505b..db8cb0e696 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1076,7 +1076,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverP= tr driver, * @vm: domain object * @dev: device to attach (expected type is DISK) * - * Attach a new disk or in case of cdroms/floppies change the media in the= drive. + * Attach a new disk in the drive. * This function handles all the necessary steps to attach a new storage s= ource * to the VM. */ @@ -1088,17 +1088,13 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr dri= ver, virDomainDiskDefPtr disk =3D dev->data.disk; virDomainDiskDefPtr orig_disk =3D NULL; =20 - /* this API overloads media change semantics on disk hotplug - * for devices supporting media changes */ if ((disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_CDROM || disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY) && (orig_disk =3D virDomainDiskByTarget(vm->def, disk->dst))) { - if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, - disk->src, false) < 0) + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", + _("cdrom/floppy media update isn't supported. " + "Use virDomainUpdateDeviceFlags instead.")); return -1; - - disk->src =3D NULL; - return 0; } =20 return qemuDomainAttachDeviceDiskLiveInternal(driver, vm, dev); --=20 2.24.0.rc1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list