From nobody Sat Nov 23 01:47:14 2024 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=1682065563; cv=none; d=zohomail.com; s=zohoarc; b=m0BG1EhaBmWdYiBhSaFKEzl3FREtLBRM9rE5yq0dsQqMbZHJC7zhJ+261MtCwqv2pEbN+azHm+mU6hSvAoADs0TcPOEZXsnP8/iC1AYSONkhJUrwX5wSDA+iF1JYgPw2PnSzmgvSon/TZS3qXeyvSZ/NemC5iVcGq/3x39YpR6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065563; 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=h9UZ6muVEZD2zZd+Lf6elLzc2gtfDwlzeI7oHaGrXnw=; b=hjDSF+QiJK1E81kH2mlZzHz+Qm2PmCQgSk2YxAw8SaIBKl/7bN30dn5TmXKykOAenSyvrWkclYOpqL1b4uExK0qtHxEEqqgMtfEqPEJUJegUS7wzDOAteCyU8q+wfop+gWYV6oJ9O1dXJRhPT5wwbQR4vOxQNgyVeN3fW7GzUMk= 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 1682065563959191.57980610478614; Fri, 21 Apr 2023 01:26:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-659-pUMJ1sKRP7-0HC0_JnJktw-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4431101A552; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E39CF2029F9A; Fri, 21 Apr 2023 08:25:14 +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 E93E21946A54; Fri, 21 Apr 2023 08:25:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BD6E219466DF for ; Fri, 21 Apr 2023 08:25:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B13F918EC7; Fri, 21 Apr 2023 08:25:12 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 587575AB7A for ; Fri, 21 Apr 2023 08:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065563; 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=h9UZ6muVEZD2zZd+Lf6elLzc2gtfDwlzeI7oHaGrXnw=; b=FKmPm5Or9MjzlanHaiJxxxpCw2VN3y1NKGdxYIU23GrN7qpZewwE4n0aptD5qDBXPaNCg5 GpJw8pq3JeRV2oyqBKj3f4Zllv3F91jQVyBPvLCdziBz53FdPdu3OWaisej/8VLW+gKkoA 3TPb12S/x8GfdOUB5mTCrPsnA+ZT760= X-MC-Unique: pUMJ1sKRP7-0HC0_JnJktw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 01/11] qemu: Replace @dom argument with @driver in qemuDomainUpdateDeviceLive() Date: Fri, 21 Apr 2023 10:25:00 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.4 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: 1682065565574100003 Content-Type: text/plain; charset="utf-8"; x-default="true" The qemuDomainUpdateDeviceLive() accepts virDomainPtr as one of its arguments, but use it only to get QEMU driver out of it. Well, the only caller already done that and thus can pass it instead of virDomainPtr. This also makes it look like the rest of device hot(un-)plug functions: qemuDomainAttachDeviceLive() and qemuDomainUpdateDeviceLive(). Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_driver.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 523a83682c..48eb759531 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7070,10 +7070,9 @@ qemuDomainChangeMemoryLive(virQEMUDriver *driver G_G= NUC_UNUSED, static int qemuDomainUpdateDeviceLive(virDomainObj *vm, virDomainDeviceDef *dev, - virDomainPtr dom, + virQEMUDriver *driver, bool force) { - virQEMUDriver *driver =3D dom->conn->privateData; virDomainDeviceDef oldDev =3D { .type =3D dev->type }; int idx; =20 @@ -7939,7 +7938,7 @@ qemuDomainUpdateDeviceFlags(virDomainPtr dom, if (flags & VIR_DOMAIN_AFFECT_LIVE) { /* virDomainDefCompatibleDevice call is delayed until we know the * device we're going to update. */ - if ((ret =3D qemuDomainUpdateDeviceLive(vm, dev_live, dom, force))= < 0) + if ((ret =3D qemuDomainUpdateDeviceLive(vm, dev_live, driver, forc= e)) < 0) goto endjob; =20 qemuDomainSaveStatus(vm); --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065577; cv=none; d=zohomail.com; s=zohoarc; b=kaT+eAQIc1B6+thOKl4LDIubbYZx6Z7YadgMEM6glIZogKVCOXG7bsKTl63Npp7q1aFU7tTUrZ0liMzxVEzsTawCuUNRerr5+OxyBAIz8xY50vEghVZd+5CrcGoxwcCMpo5hwT+OICjfZW+v+2/HDN5w7dXQc1bd4ZulC/rPVL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065577; 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=4wOicE80t8TJqBk4hUTwlL/2iQdhfAKikAZUVe95JwQ=; b=QSN2brnXas7BGVDhLJNlUYKwmz5oXcckFO6LmLClwUPsbvs7UCCfS5AMiZORPiD9J24Ut/5H5rciDmF+4Gr8+Bmqry7gbDMdMt7Ho0SHmaXxYb/TSdARf4prqmU1eSP2xZ7OnFqDF8MAUo1gLn/NE7aflPchb953eLJEL7TN/KI= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065577867657.6337800495958; Fri, 21 Apr 2023 01:26:17 -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-574-ymW_a15mMZqoDeSj2YEn7Q-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A52723C0F391; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B56140C2064; Fri, 21 Apr 2023 08:25:15 +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 30A571946A47; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 827431946A48 for ; Fri, 21 Apr 2023 08:25:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 675AA5AB7A; Fri, 21 Apr 2023 08:25:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7B8618EC7 for ; Fri, 21 Apr 2023 08:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065576; 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=4wOicE80t8TJqBk4hUTwlL/2iQdhfAKikAZUVe95JwQ=; b=VFokDIz10TMZDM10Dpn/Tm9SS5Wspv7pJeMDKILdoAVtloZbqgBLpgvLrYHnw9XrWBxaxO 3wu7+NmndJDOZPwLQEkD1zOGSEodHaTk5vNqhndPXCxHWbly46u+1kSMH7LpEl0nEFsV/b I7B8ZkTh9eKI+50iZ1phf87Aed4gugU= X-MC-Unique: ymW_a15mMZqoDeSj2YEn7Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 02/11] qemu: Move qemuDomainAttachDeviceLive() into qemu_hotplug.c Date: Fri, 21 Apr 2023 10:25:01 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.1 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: 1682065580102100007 Content-Type: text/plain; charset="utf-8"; x-default="true" There is no good reason for qemuDomainAttachDeviceLive() to live in (ever growing) qemu_driver.c while we have qemu_hotplug.c which already contains the rest of hotplug code. Move the function to its new home. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_driver.c | 170 ---------------------------------------- src/qemu/qemu_hotplug.c | 170 ++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_hotplug.h | 4 + 3 files changed, 174 insertions(+), 170 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 48eb759531..fe1ddb5ade 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6671,176 +6671,6 @@ qemuDomainUndefine(virDomainPtr dom) return qemuDomainUndefineFlags(dom, 0); } =20 -static int -qemuDomainAttachDeviceLive(virDomainObj *vm, - virDomainDeviceDef *dev, - virQEMUDriver *driver) -{ - int ret =3D -1; - const char *alias =3D NULL; - g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); - struct qemuDomainPrepareChardevSourceData chardevBackendData =3D { .cf= g =3D cfg, - .hotp= lug =3D true }; - - if (qemuDomainDeviceBackendChardevForeachOne(dev, - qemuDomainPrepareChardevS= ourceOne, - &chardevBackendData) < 0) - return -1; - - switch ((virDomainDeviceType)dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); - ret =3D qemuDomainAttachDeviceDiskLive(driver, vm, dev); - if (!ret) { - alias =3D dev->data.disk->info.alias; - dev->data.disk =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_CONTROLLER: - ret =3D qemuDomainAttachControllerDevice(vm, dev->data.controller); - if (!ret) { - alias =3D dev->data.controller->info.alias; - dev->data.controller =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_LEASE: - ret =3D qemuDomainAttachLease(driver, vm, - dev->data.lease); - if (ret =3D=3D 0) - dev->data.lease =3D NULL; - break; - - case VIR_DOMAIN_DEVICE_NET: - qemuDomainObjCheckNetTaint(driver, vm, dev->data.net, NULL); - ret =3D qemuDomainAttachNetDevice(driver, vm, dev->data.net); - if (!ret) { - alias =3D dev->data.net->info.alias; - dev->data.net =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_HOSTDEV: - qemuDomainObjCheckHostdevTaint(driver, vm, dev->data.hostdev, NULL= ); - ret =3D qemuDomainAttachHostDevice(driver, vm, - dev->data.hostdev); - if (!ret) { - alias =3D dev->data.hostdev->info->alias; - dev->data.hostdev =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_REDIRDEV: - ret =3D qemuDomainAttachRedirdevDevice(driver, vm, - dev->data.redirdev); - if (!ret) { - alias =3D dev->data.redirdev->info.alias; - dev->data.redirdev =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_CHR: - ret =3D qemuDomainAttachChrDevice(driver, vm, dev); - if (!ret) { - alias =3D dev->data.chr->info.alias; - dev->data.chr =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_RNG: - ret =3D qemuDomainAttachRNGDevice(driver, vm, - dev->data.rng); - if (!ret) { - alias =3D dev->data.rng->info.alias; - dev->data.rng =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_MEMORY: - /* note that qemuDomainAttachMemory always consumes dev->data.memo= ry - * and dispatches DeviceAdded event on success */ - ret =3D qemuDomainAttachMemory(driver, vm, - dev->data.memory); - dev->data.memory =3D NULL; - break; - - case VIR_DOMAIN_DEVICE_SHMEM: - ret =3D qemuDomainAttachShmemDevice(vm, dev->data.shmem); - if (!ret) { - alias =3D dev->data.shmem->info.alias; - dev->data.shmem =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_WATCHDOG: - ret =3D qemuDomainAttachWatchdog(vm, dev->data.watchdog); - if (!ret) { - alias =3D dev->data.watchdog->info.alias; - dev->data.watchdog =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_INPUT: - ret =3D qemuDomainAttachInputDevice(vm, dev->data.input); - if (ret =3D=3D 0) { - alias =3D dev->data.input->info.alias; - dev->data.input =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_VSOCK: - ret =3D qemuDomainAttachVsockDevice(vm, dev->data.vsock); - if (ret =3D=3D 0) { - alias =3D dev->data.vsock->info.alias; - dev->data.vsock =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_FS: - ret =3D qemuDomainAttachFSDevice(driver, vm, dev->data.fs); - if (ret =3D=3D 0) { - alias =3D dev->data.fs->info.alias; - dev->data.fs =3D NULL; - } - break; - - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_GRAPHICS: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - case VIR_DOMAIN_DEVICE_LAST: - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("live attach of device '%1$s' is not supported"), - virDomainDeviceTypeToString(dev->type)); - break; - } - - if (alias) { - /* queue the event before the alias has a chance to get freed - * if the domain disappears while qemuDomainUpdateDeviceList - * is in monitor */ - virObjectEvent *event; - event =3D virDomainEventDeviceAddedNewFromObj(vm, alias); - virObjectEventStateQueue(driver->domainEventState, event); - } - - if (ret =3D=3D 0) - ret =3D qemuDomainUpdateDeviceList(vm, VIR_ASYNC_JOB_NONE); - - return ret; -} - - static int qemuDomainChangeDiskLive(virDomainObj *vm, virDomainDeviceDef *dev, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 53a0874556..bd126234fd 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3308,6 +3308,176 @@ qemuDomainAttachLease(virQEMUDriver *driver, } =20 =20 +int +qemuDomainAttachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver) +{ + int ret =3D -1; + const char *alias =3D NULL; + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + struct qemuDomainPrepareChardevSourceData chardevBackendData =3D { .cf= g =3D cfg, + .hotp= lug =3D true }; + + if (qemuDomainDeviceBackendChardevForeachOne(dev, + qemuDomainPrepareChardevS= ourceOne, + &chardevBackendData) < 0) + return -1; + + switch ((virDomainDeviceType)dev->type) { + case VIR_DOMAIN_DEVICE_DISK: + qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); + ret =3D qemuDomainAttachDeviceDiskLive(driver, vm, dev); + if (!ret) { + alias =3D dev->data.disk->info.alias; + dev->data.disk =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_CONTROLLER: + ret =3D qemuDomainAttachControllerDevice(vm, dev->data.controller); + if (!ret) { + alias =3D dev->data.controller->info.alias; + dev->data.controller =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_LEASE: + ret =3D qemuDomainAttachLease(driver, vm, + dev->data.lease); + if (ret =3D=3D 0) + dev->data.lease =3D NULL; + break; + + case VIR_DOMAIN_DEVICE_NET: + qemuDomainObjCheckNetTaint(driver, vm, dev->data.net, NULL); + ret =3D qemuDomainAttachNetDevice(driver, vm, dev->data.net); + if (!ret) { + alias =3D dev->data.net->info.alias; + dev->data.net =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_HOSTDEV: + qemuDomainObjCheckHostdevTaint(driver, vm, dev->data.hostdev, NULL= ); + ret =3D qemuDomainAttachHostDevice(driver, vm, + dev->data.hostdev); + if (!ret) { + alias =3D dev->data.hostdev->info->alias; + dev->data.hostdev =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_REDIRDEV: + ret =3D qemuDomainAttachRedirdevDevice(driver, vm, + dev->data.redirdev); + if (!ret) { + alias =3D dev->data.redirdev->info.alias; + dev->data.redirdev =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_CHR: + ret =3D qemuDomainAttachChrDevice(driver, vm, dev); + if (!ret) { + alias =3D dev->data.chr->info.alias; + dev->data.chr =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_RNG: + ret =3D qemuDomainAttachRNGDevice(driver, vm, + dev->data.rng); + if (!ret) { + alias =3D dev->data.rng->info.alias; + dev->data.rng =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_MEMORY: + /* note that qemuDomainAttachMemory always consumes dev->data.memo= ry + * and dispatches DeviceAdded event on success */ + ret =3D qemuDomainAttachMemory(driver, vm, + dev->data.memory); + dev->data.memory =3D NULL; + break; + + case VIR_DOMAIN_DEVICE_SHMEM: + ret =3D qemuDomainAttachShmemDevice(vm, dev->data.shmem); + if (!ret) { + alias =3D dev->data.shmem->info.alias; + dev->data.shmem =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_WATCHDOG: + ret =3D qemuDomainAttachWatchdog(vm, dev->data.watchdog); + if (!ret) { + alias =3D dev->data.watchdog->info.alias; + dev->data.watchdog =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_INPUT: + ret =3D qemuDomainAttachInputDevice(vm, dev->data.input); + if (ret =3D=3D 0) { + alias =3D dev->data.input->info.alias; + dev->data.input =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_VSOCK: + ret =3D qemuDomainAttachVsockDevice(vm, dev->data.vsock); + if (ret =3D=3D 0) { + alias =3D dev->data.vsock->info.alias; + dev->data.vsock =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_FS: + ret =3D qemuDomainAttachFSDevice(driver, vm, dev->data.fs); + if (ret =3D=3D 0) { + alias =3D dev->data.fs->info.alias; + dev->data.fs =3D NULL; + } + break; + + case VIR_DOMAIN_DEVICE_NONE: + case VIR_DOMAIN_DEVICE_SOUND: + case VIR_DOMAIN_DEVICE_VIDEO: + case VIR_DOMAIN_DEVICE_GRAPHICS: + case VIR_DOMAIN_DEVICE_HUB: + case VIR_DOMAIN_DEVICE_SMARTCARD: + case VIR_DOMAIN_DEVICE_MEMBALLOON: + case VIR_DOMAIN_DEVICE_NVRAM: + case VIR_DOMAIN_DEVICE_TPM: + case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_IOMMU: + case VIR_DOMAIN_DEVICE_AUDIO: + case VIR_DOMAIN_DEVICE_CRYPTO: + case VIR_DOMAIN_DEVICE_LAST: + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("live attach of device '%1$s' is not supported"), + virDomainDeviceTypeToString(dev->type)); + break; + } + + if (alias) { + /* queue the event before the alias has a chance to get freed + * if the domain disappears while qemuDomainUpdateDeviceList + * is in monitor */ + virObjectEvent *event; + event =3D virDomainEventDeviceAddedNewFromObj(vm, alias); + virObjectEventStateQueue(driver->domainEventState, event); + } + + if (ret =3D=3D 0) + ret =3D qemuDomainUpdateDeviceList(vm, VIR_ASYNC_JOB_NONE); + + return ret; +} + + static int qemuDomainChangeNetBridge(virDomainObj *vm, virDomainNetDef *olddev, diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index cec1423ee0..74fc3bbd65 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -111,6 +111,10 @@ int qemuDomainAttachRNGDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainRNGDef *rng); =20 +int qemuDomainAttachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver); + int qemuDomainDetachDeviceLive(virDomainObj *vm, virDomainDeviceDef *match, virQEMUDriver *driver, --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065577; cv=none; d=zohomail.com; s=zohoarc; b=AMZlOfFKCSoJQ6F8s4Fsti0NjZ7ekzaxkM2W+mRwTBWypBSJHf+VNWgJs07l4EJi/NG2SFrO3ZfAQpRGim+C5ZHI6+1q/0zzX9YscJ/CeNt/kQYZoJdK7R3Jw+B/jY0gQSKJ1DHTMMEfc9UZeDCqH+c3jrZkC++p5CMjmomHBgs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065577; 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=8c8JcQvKd3xwOH0uWgrR0/7ob/bURpjdF6wwNYPPtHE=; b=Fv7LpHmhAFHfHbIPAXTLKH+sIp2Kw9leecxY9o0voOO+Agp5iJnNF6ARl6Ss0dMfZ6rhhqKmrx8dDCvO6WKwUIQPvytTOpRDPcTofdCeUgPLeuHMfBap1dEvuhxsQ1XVyIQTsb7ZoJKP2hYPFd8alQLCce7N5d7y+7nZh5NTUR8= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065577504717.6325126028568; Fri, 21 Apr 2023 01:26:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-yBmvrgBsMA2kCx3EyaHV7w-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A6CAE85A5B1; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1C1FC164EF; Fri, 21 Apr 2023 08:25:15 +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 B22081946A48; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 290F91946A46 for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1E3AD63A51; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EDA15AB7A for ; Fri, 21 Apr 2023 08:25:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065576; 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=8c8JcQvKd3xwOH0uWgrR0/7ob/bURpjdF6wwNYPPtHE=; b=SWygJNRNBFAojEBnh0+GaATAi/47iCTJYvX5c9RV4ozHLJ2nJf2RbbL7+MZVbHVvJk2/9i klbxRgpDyWxjMDgPHLcykqyuug790ExxTi0W+9PyumDRQW8wgaALrEDDN9sdbK5NFBDsVT ziiDTZzacJsCoDSRFqHCDxEcyIwj7BY= X-MC-Unique: yBmvrgBsMA2kCx3EyaHV7w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 03/11] qemu: Move qemuDomainUpdateDeviceLive() into qemu_hotplug.c Date: Fri, 21 Apr 2023 10:25:02 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.8 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: 1682065579176100003 Content-Type: text/plain; charset="utf-8"; x-default="true" There is no good reason for qemuDomainUpdateDeviceLive() to live in (ever growing) qemu_driver.c while we have qemu_hotplug.c which already contains the rest of hotplug code. Move the function to its new home. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_driver.c | 299 ---------------------------------------- src/qemu/qemu_hotplug.c | 299 ++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_hotplug.h | 5 + 3 files changed, 304 insertions(+), 299 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index fe1ddb5ade..5ee15bab7a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6671,305 +6671,6 @@ qemuDomainUndefine(virDomainPtr dom) return qemuDomainUndefineFlags(dom, 0); } =20 -static int -qemuDomainChangeDiskLive(virDomainObj *vm, - virDomainDeviceDef *dev, - virQEMUDriver *driver, - bool force) -{ - virDomainDiskDef *disk =3D dev->data.disk; - virDomainDiskDef *orig_disk =3D NULL; - virDomainStartupPolicy origStartupPolicy; - virDomainDeviceDef oldDev =3D { .type =3D dev->type }; - - if (!(orig_disk =3D virDomainDiskByTarget(vm->def, disk->dst))) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("disk '%1$s' not found"), disk->dst); - return -1; - } - - oldDev.data.disk =3D orig_disk; - origStartupPolicy =3D orig_disk->startupPolicy; - if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, - VIR_DOMAIN_DEVICE_ACTION_UPDATE, - true) < 0) - return -1; - - if (!qemuDomainDiskChangeSupported(disk, orig_disk)) - return -1; - - if (!virStorageSourceIsSameLocation(disk->src, orig_disk->src)) { - /* Disk source can be changed only for removable devices */ - if (disk->device !=3D VIR_DOMAIN_DISK_DEVICE_CDROM && - disk->device !=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("disk source can be changed only in removable= " - "drives")); - return -1; - } - - /* update startup policy first before updating disk image */ - orig_disk->startupPolicy =3D dev->data.disk->startupPolicy; - - if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, - dev->data.disk->src, force) < 0= ) { - /* revert startup policy before failing */ - orig_disk->startupPolicy =3D origStartupPolicy; - return -1; - } - - dev->data.disk->src =3D NULL; - } - - /* in case when we aren't updating disk source we update startup polic= y here */ - orig_disk->startupPolicy =3D dev->data.disk->startupPolicy; - orig_disk->snapshot =3D dev->data.disk->snapshot; - - return 0; -} - - -static bool -qemuDomainChangeMemoryLiveValidateChange(const virDomainMemoryDef *oldDef, - const virDomainMemoryDef *newDef) -{ - /* The only thing that is allowed to change is 'requestedsize' for - * virtio-mem model. Check if user isn't trying to sneak in change for - * something else. */ - - switch (oldDef->model) { - case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM: - break; - - case VIR_DOMAIN_MEMORY_MODEL_NONE: - case VIR_DOMAIN_MEMORY_MODEL_DIMM: - case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: - case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM: - case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC: - case VIR_DOMAIN_MEMORY_MODEL_LAST: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory of model '%1$s'"), - virDomainMemoryModelTypeToString(oldDef->model)); - return false; - break; - } - - if (oldDef->model !=3D newDef->model) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory model from '%1$s' to '%2$s'= "), - virDomainMemoryModelTypeToString(oldDef->model), - virDomainMemoryModelTypeToString(newDef->model)); - return false; - } - - if (oldDef->access !=3D newDef->access) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory access from '%1$s' to '%2$s= '"), - virDomainMemoryAccessTypeToString(oldDef->access), - virDomainMemoryAccessTypeToString(newDef->access)); - return false; - } - - if (oldDef->discard !=3D newDef->discard) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory discard from '%1$s' to '%2$= s'"), - virTristateBoolTypeToString(oldDef->discard), - virTristateBoolTypeToString(newDef->discard)); - return false; - } - - if (!virBitmapEqual(oldDef->sourceNodes, - newDef->sourceNodes)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("cannot modify memory source nodes")); - return false; - } - - if (oldDef->pagesize !=3D newDef->pagesize) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory pagesize from '%1$llu' to '= %2$llu'"), - oldDef->pagesize, - newDef->pagesize); - return false; - } - - if (STRNEQ_NULLABLE(oldDef->nvdimmPath, newDef->nvdimmPath)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory path from '%1$s' to '%2$s'"= ), - NULLSTR(oldDef->nvdimmPath), - NULLSTR(newDef->nvdimmPath)); - return false; - } - - if (oldDef->alignsize !=3D newDef->alignsize) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory align size from '%1$llu' to= '%2$llu'"), - oldDef->alignsize, newDef->alignsize); - return false; - } - - if (oldDef->nvdimmPmem !=3D newDef->nvdimmPmem) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory pmem from '%1$d' to '%2$d'"= ), - oldDef->nvdimmPmem, newDef->nvdimmPmem); - return false; - } - - if (oldDef->targetNode !=3D newDef->targetNode) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory targetNode from '%1$d' to '= %2$d'"), - oldDef->targetNode, newDef->targetNode); - return false; - } - - if (oldDef->size !=3D newDef->size) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory size from '%1$llu' to '%2$l= lu'"), - oldDef->size, newDef->size); - return false; - } - - if (oldDef->labelsize !=3D newDef->labelsize) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory label size from '%1$llu' to= '%2$llu'"), - oldDef->labelsize, newDef->labelsize); - return false; - } - if (oldDef->blocksize !=3D newDef->blocksize) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot modify memory block size from '%1$llu' to= '%2$llu'"), - oldDef->blocksize, newDef->blocksize); - return false; - } - - /* requestedsize can change */ - - if (oldDef->readonly !=3D newDef->readonly) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("cannot modify memory pmem flag")); - return false; - } - - if ((oldDef->uuid || newDef->uuid) && - !(oldDef->uuid && newDef->uuid && - memcmp(oldDef->uuid, newDef->uuid, VIR_UUID_BUFLEN) =3D=3D 0)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("cannot modify memory UUID")); - return false; - } - - return true; -} - - -static int -qemuDomainChangeMemoryLive(virQEMUDriver *driver G_GNUC_UNUSED, - virDomainObj *vm, - virDomainDeviceDef *dev) -{ - virDomainDeviceDef oldDev =3D { .type =3D VIR_DOMAIN_DEVICE_MEMORY }; - virDomainMemoryDef *newDef =3D dev->data.memory; - virDomainMemoryDef *oldDef =3D NULL; - - oldDef =3D virDomainMemoryFindByDeviceInfo(vm->def, &dev->data.memory-= >info, NULL); - if (!oldDef) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("memory '%1$s' not found"), dev->data.memory->inf= o.alias); - return -1; - } - - oldDev.data.memory =3D oldDef; - - if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, - VIR_DOMAIN_DEVICE_ACTION_UPDATE, - true) < 0) - return -1; - - if (!qemuDomainChangeMemoryLiveValidateChange(oldDef, newDef)) - return -1; - - if (qemuDomainChangeMemoryRequestedSize(vm, newDef->info.alias, - newDef->requestedsize) < 0) - return -1; - - oldDef->requestedsize =3D newDef->requestedsize; - return 0; -} - - -static int -qemuDomainUpdateDeviceLive(virDomainObj *vm, - virDomainDeviceDef *dev, - virQEMUDriver *driver, - bool force) -{ - virDomainDeviceDef oldDev =3D { .type =3D dev->type }; - int idx; - - switch ((virDomainDeviceType)dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); - return qemuDomainChangeDiskLive(vm, dev, driver, force); - - case VIR_DOMAIN_DEVICE_GRAPHICS: - if ((idx =3D qemuDomainFindGraphicsIndex(vm->def, dev->data.graphi= cs)) >=3D 0) { - oldDev.data.graphics =3D vm->def->graphics[idx]; - if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, - VIR_DOMAIN_DEVICE_ACTION_UPDA= TE, - true) < 0) - return -1; - } - - return qemuDomainChangeGraphics(driver, vm, dev->data.graphics); - - case VIR_DOMAIN_DEVICE_NET: - if ((idx =3D virDomainNetFindIdx(vm->def, dev->data.net)) >=3D 0) { - oldDev.data.net =3D vm->def->nets[idx]; - if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, - VIR_DOMAIN_DEVICE_ACTION_UPDA= TE, - true) < 0) - return -1; - } - - return qemuDomainChangeNet(driver, vm, dev); - - case VIR_DOMAIN_DEVICE_MEMORY: - return qemuDomainChangeMemoryLive(driver, vm, dev); - - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_WATCHDOG: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_HOSTDEV: - case VIR_DOMAIN_DEVICE_CONTROLLER: - case VIR_DOMAIN_DEVICE_REDIRDEV: - case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_VSOCK: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - case VIR_DOMAIN_DEVICE_LAST: - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("live update of device '%1$s' is not supported"), - virDomainDeviceTypeToString(dev->type)); - return -1; - } - - return -1; -} - - static int qemuCheckDiskConfigAgainstDomain(const virDomainDef *def, const virDomainDiskDef *disk) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bd126234fd..f72bb7722d 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6910,3 +6910,302 @@ qemuDomainChangeMemoryRequestedSize(virDomainObj *v= m, =20 return rc; } + + +static int +qemuDomainChangeDiskLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver, + bool force) +{ + virDomainDiskDef *disk =3D dev->data.disk; + virDomainDiskDef *orig_disk =3D NULL; + virDomainStartupPolicy origStartupPolicy; + virDomainDeviceDef oldDev =3D { .type =3D dev->type }; + + if (!(orig_disk =3D virDomainDiskByTarget(vm->def, disk->dst))) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("disk '%1$s' not found"), disk->dst); + return -1; + } + + oldDev.data.disk =3D orig_disk; + origStartupPolicy =3D orig_disk->startupPolicy; + if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, + VIR_DOMAIN_DEVICE_ACTION_UPDATE, + true) < 0) + return -1; + + if (!qemuDomainDiskChangeSupported(disk, orig_disk)) + return -1; + + if (!virStorageSourceIsSameLocation(disk->src, orig_disk->src)) { + /* Disk source can be changed only for removable devices */ + if (disk->device !=3D VIR_DOMAIN_DISK_DEVICE_CDROM && + disk->device !=3D VIR_DOMAIN_DISK_DEVICE_FLOPPY) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("disk source can be changed only in removable= " + "drives")); + return -1; + } + + /* update startup policy first before updating disk image */ + orig_disk->startupPolicy =3D dev->data.disk->startupPolicy; + + if (qemuDomainChangeEjectableMedia(driver, vm, orig_disk, + dev->data.disk->src, force) < 0= ) { + /* revert startup policy before failing */ + orig_disk->startupPolicy =3D origStartupPolicy; + return -1; + } + + dev->data.disk->src =3D NULL; + } + + /* in case when we aren't updating disk source we update startup polic= y here */ + orig_disk->startupPolicy =3D dev->data.disk->startupPolicy; + orig_disk->snapshot =3D dev->data.disk->snapshot; + + return 0; +} + + +static bool +qemuDomainChangeMemoryLiveValidateChange(const virDomainMemoryDef *oldDef, + const virDomainMemoryDef *newDef) +{ + /* The only thing that is allowed to change is 'requestedsize' for + * virtio-mem model. Check if user isn't trying to sneak in change for + * something else. */ + + switch (oldDef->model) { + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_MEM: + break; + + case VIR_DOMAIN_MEMORY_MODEL_NONE: + case VIR_DOMAIN_MEMORY_MODEL_DIMM: + case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM: + case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC: + case VIR_DOMAIN_MEMORY_MODEL_LAST: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory of model '%1$s'"), + virDomainMemoryModelTypeToString(oldDef->model)); + return false; + break; + } + + if (oldDef->model !=3D newDef->model) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory model from '%1$s' to '%2$s'= "), + virDomainMemoryModelTypeToString(oldDef->model), + virDomainMemoryModelTypeToString(newDef->model)); + return false; + } + + if (oldDef->access !=3D newDef->access) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory access from '%1$s' to '%2$s= '"), + virDomainMemoryAccessTypeToString(oldDef->access), + virDomainMemoryAccessTypeToString(newDef->access)); + return false; + } + + if (oldDef->discard !=3D newDef->discard) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory discard from '%1$s' to '%2$= s'"), + virTristateBoolTypeToString(oldDef->discard), + virTristateBoolTypeToString(newDef->discard)); + return false; + } + + if (!virBitmapEqual(oldDef->sourceNodes, + newDef->sourceNodes)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("cannot modify memory source nodes")); + return false; + } + + if (oldDef->pagesize !=3D newDef->pagesize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory pagesize from '%1$llu' to '= %2$llu'"), + oldDef->pagesize, + newDef->pagesize); + return false; + } + + if (STRNEQ_NULLABLE(oldDef->nvdimmPath, newDef->nvdimmPath)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory path from '%1$s' to '%2$s'"= ), + NULLSTR(oldDef->nvdimmPath), + NULLSTR(newDef->nvdimmPath)); + return false; + } + + if (oldDef->alignsize !=3D newDef->alignsize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory align size from '%1$llu' to= '%2$llu'"), + oldDef->alignsize, newDef->alignsize); + return false; + } + + if (oldDef->nvdimmPmem !=3D newDef->nvdimmPmem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory pmem from '%1$d' to '%2$d'"= ), + oldDef->nvdimmPmem, newDef->nvdimmPmem); + return false; + } + + if (oldDef->targetNode !=3D newDef->targetNode) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory targetNode from '%1$d' to '= %2$d'"), + oldDef->targetNode, newDef->targetNode); + return false; + } + + if (oldDef->size !=3D newDef->size) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory size from '%1$llu' to '%2$l= lu'"), + oldDef->size, newDef->size); + return false; + } + + if (oldDef->labelsize !=3D newDef->labelsize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory label size from '%1$llu' to= '%2$llu'"), + oldDef->labelsize, newDef->labelsize); + return false; + } + if (oldDef->blocksize !=3D newDef->blocksize) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot modify memory block size from '%1$llu' to= '%2$llu'"), + oldDef->blocksize, newDef->blocksize); + return false; + } + + /* requestedsize can change */ + + if (oldDef->readonly !=3D newDef->readonly) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("cannot modify memory pmem flag")); + return false; + } + + if ((oldDef->uuid || newDef->uuid) && + !(oldDef->uuid && newDef->uuid && + memcmp(oldDef->uuid, newDef->uuid, VIR_UUID_BUFLEN) =3D=3D 0)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("cannot modify memory UUID")); + return false; + } + + return true; +} + + +static int +qemuDomainChangeMemoryLive(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *vm, + virDomainDeviceDef *dev) +{ + virDomainDeviceDef oldDev =3D { .type =3D VIR_DOMAIN_DEVICE_MEMORY }; + virDomainMemoryDef *newDef =3D dev->data.memory; + virDomainMemoryDef *oldDef =3D NULL; + + oldDef =3D virDomainMemoryFindByDeviceInfo(vm->def, &dev->data.memory-= >info, NULL); + if (!oldDef) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("memory '%1$s' not found"), dev->data.memory->inf= o.alias); + return -1; + } + + oldDev.data.memory =3D oldDef; + + if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, + VIR_DOMAIN_DEVICE_ACTION_UPDATE, + true) < 0) + return -1; + + if (!qemuDomainChangeMemoryLiveValidateChange(oldDef, newDef)) + return -1; + + if (qemuDomainChangeMemoryRequestedSize(vm, newDef->info.alias, + newDef->requestedsize) < 0) + return -1; + + oldDef->requestedsize =3D newDef->requestedsize; + return 0; +} + + +int +qemuDomainUpdateDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver, + bool force) +{ + virDomainDeviceDef oldDev =3D { .type =3D dev->type }; + int idx; + + switch ((virDomainDeviceType)dev->type) { + case VIR_DOMAIN_DEVICE_DISK: + qemuDomainObjCheckDiskTaint(driver, vm, dev->data.disk, NULL); + return qemuDomainChangeDiskLive(vm, dev, driver, force); + + case VIR_DOMAIN_DEVICE_GRAPHICS: + if ((idx =3D qemuDomainFindGraphicsIndex(vm->def, dev->data.graphi= cs)) >=3D 0) { + oldDev.data.graphics =3D vm->def->graphics[idx]; + if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, + VIR_DOMAIN_DEVICE_ACTION_UPDA= TE, + true) < 0) + return -1; + } + + return qemuDomainChangeGraphics(driver, vm, dev->data.graphics); + + case VIR_DOMAIN_DEVICE_NET: + if ((idx =3D virDomainNetFindIdx(vm->def, dev->data.net)) >=3D 0) { + oldDev.data.net =3D vm->def->nets[idx]; + if (virDomainDefCompatibleDevice(vm->def, dev, &oldDev, + VIR_DOMAIN_DEVICE_ACTION_UPDA= TE, + true) < 0) + return -1; + } + + return qemuDomainChangeNet(driver, vm, dev); + + case VIR_DOMAIN_DEVICE_MEMORY: + return qemuDomainChangeMemoryLive(driver, vm, dev); + + case VIR_DOMAIN_DEVICE_FS: + case VIR_DOMAIN_DEVICE_INPUT: + case VIR_DOMAIN_DEVICE_SOUND: + case VIR_DOMAIN_DEVICE_VIDEO: + case VIR_DOMAIN_DEVICE_WATCHDOG: + case VIR_DOMAIN_DEVICE_HUB: + case VIR_DOMAIN_DEVICE_SMARTCARD: + case VIR_DOMAIN_DEVICE_MEMBALLOON: + case VIR_DOMAIN_DEVICE_NVRAM: + case VIR_DOMAIN_DEVICE_RNG: + case VIR_DOMAIN_DEVICE_SHMEM: + case VIR_DOMAIN_DEVICE_LEASE: + case VIR_DOMAIN_DEVICE_HOSTDEV: + case VIR_DOMAIN_DEVICE_CONTROLLER: + case VIR_DOMAIN_DEVICE_REDIRDEV: + case VIR_DOMAIN_DEVICE_CHR: + case VIR_DOMAIN_DEVICE_NONE: + case VIR_DOMAIN_DEVICE_TPM: + case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_IOMMU: + case VIR_DOMAIN_DEVICE_VSOCK: + case VIR_DOMAIN_DEVICE_AUDIO: + case VIR_DOMAIN_DEVICE_CRYPTO: + case VIR_DOMAIN_DEVICE_LAST: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("live update of device '%1$s' is not supported"), + virDomainDeviceTypeToString(dev->type)); + return -1; + } + + return -1; +} diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index 74fc3bbd65..d9a5ac1164 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -120,6 +120,11 @@ int qemuDomainDetachDeviceLive(virDomainObj *vm, virQEMUDriver *driver, bool async); =20 +int qemuDomainUpdateDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver, + bool force); + void qemuDomainRemoveVcpuAlias(virDomainObj *vm, const char *alias); =20 --=20 2.39.2 From nobody Sat Nov 23 01:47:14 2024 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=1682065526; cv=none; d=zohomail.com; s=zohoarc; b=jP2+HCiI8+7tyb3AbYe379GX80z3Y5v9V0LINhiOcLcgEvEbn1IYniFi/hCQKp1QPhJTny7EdCur/4oExjvWa5GpgDoxpDEKO8JF6DUpcnNz7g867u2HsyPjc9TCgEWwLedfOybZ/em5+JU0DjZeMIxsUSB8KqpxQnkNlb6ZEIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065526; 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=T5n3jWYsciZLpQvHYhlDbWQF457iV60ms2XBOdUK7xo=; b=ErVzYNOr3Vj2ovnwper6VS3z5PkggPpABQsETnvNl8nS8Je9gC8xGiWQr1dOkd/ENCbF1PC7EQDbNRx0JKpILpcXvBH1J7peCcWXdCD0TwCk1n96xsN7r975lPoCLs89Q1qWaoPe2g5Q7eWKAeFFvJYlpTGhwONIm/2Q9R/ovno= 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 1682065526075202.3871976056514; Fri, 21 Apr 2023 01:25:26 -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-478-huvbOTOgMW2BKxyM4xwkfw-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 19FE53813F4A; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03F9E40C6EC4; Fri, 21 Apr 2023 08:25:17 +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 ED9171946A40; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA17F1946A46 for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AECE718EC7; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 552A75AB7A for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065525; 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=T5n3jWYsciZLpQvHYhlDbWQF457iV60ms2XBOdUK7xo=; b=YfsLneWlepGRZONmS1w0AZ1ncsLQ90aMpCLjnsuluZ0zWrBbrM1fu2YwnfopSEecNzopC4 TqXT6DUIjCYpMSYxczqDjU1nHWc2ojeycUNWnXE+0UNEiLhu64h6TQV2gOWiJtOotTanvi SV6wpK60+NVJOPcLDKyQvfSBNvoJn2c= X-MC-Unique: huvbOTOgMW2BKxyM4xwkfw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 04/11] qemuhotplugtest: Call qemuDomainDetachDeviceLive() directly Date: Fri, 21 Apr 2023 10:25:03 +0200 Message-Id: <747adc89a0530d357d41f96f75ec451ba88a75f2.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.2 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: 1682065526891100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The testQemuHotplugDetach() already does call qemuDomainDetachDeviceLive() but only for some device types. For the rest it reports an error (but only if running test verbosely). This makes no sense. Just call qemuDomainDetachDeviceLive() directly and drop testQemuHotplugDetach(). Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 49 +---------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 6aaccce55b..4f9d1bcb2a 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -169,53 +169,6 @@ testQemuHotplugAttach(virDomainObj *vm, return ret; } =20 -static int -testQemuHotplugDetach(virDomainObj *vm, - virDomainDeviceDef *dev, - bool async) -{ - int ret =3D -1; - - switch (dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_WATCHDOG: - case VIR_DOMAIN_DEVICE_HOSTDEV: - case VIR_DOMAIN_DEVICE_NET: - ret =3D qemuDomainDetachDeviceLive(vm, dev, &driver, async); - break; - - case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_CONTROLLER: - case VIR_DOMAIN_DEVICE_GRAPHICS: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_REDIRDEV: - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_MEMORY: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_VSOCK: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - VIR_TEST_VERBOSE("device type '%s' cannot be detached", - virDomainDeviceTypeToString(dev->type)); - break; - } - - return ret; -} - static int testQemuHotplugUpdate(virDomainObj *vm, virDomainDeviceDef *dev) @@ -394,7 +347,7 @@ testQemuHotplug(const void *data) break; =20 case DETACH: - ret =3D testQemuHotplugDetach(vm, dev, false); + ret =3D qemuDomainDetachDeviceLive(vm, dev, &driver, false); if (ret =3D=3D 0 || fail) ret =3D testQemuHotplugCheckResult(vm, domain_xml, domain_filename, fail); --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065577; cv=none; d=zohomail.com; s=zohoarc; b=JE/8WcrjSOQL7oCC7jS55p5p57XdYM9TLvGquoXMmA/EAZdH3+whNCfQC8Udf8W10DljOcggDK3Lo5bZFRC8qAsHgvyblshhNfDDPMO7UF7rQFzkjjxUmyPARE4GESNBtrx/nH0KReuxijirzVasfd3XIgiSEFxAZuSncqolkEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065577; 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=5Az9IEZhgK6RzTvJFO8hc+zQYXSPu7XCyqGr+cVbDlI=; b=bfJLBCkrLyZ6rzaaKOgPr7Q5p+mOQJsDXZGeXMBs/Rsc0AmQVzsz/9zCvzSUevUQVp85Htzg+ebELgIEWzDPREIuPfpHZLa1ICoc3rtTSHif7ASmQQsBPJVTEHpYJQrPDWuKTMvTd+goR0tWgorf/KM4wTZuyS17aYCOcnZIEtE= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065577404209.60064879318907; Fri, 21 Apr 2023 01:26:17 -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-251-O6nGahydMw6tpd5gMPijYA-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 72B013813F58; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A55B407D44E; Fri, 21 Apr 2023 08:25:17 +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 37EB11946A52; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 563481946A46 for ; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 48B4118EC7; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4B5763A51 for ; Fri, 21 Apr 2023 08:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065576; 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=5Az9IEZhgK6RzTvJFO8hc+zQYXSPu7XCyqGr+cVbDlI=; b=NkSMkBcKaZMUabt9a4unigeeFDLmDUkNCurxGAuIOMUgMcYF/UDJhNb3EcWTaAD2V7UwMD cq55nOY/r6WUW+Nc5Z7/a52/mEB/a1lQVKrevkkAvd1bc6B9CLeDMdkbgjbiFm+tb5y475 QVkBIZFfLX3L4OTfzVS79TfXRtgEW9w= X-MC-Unique: O6nGahydMw6tpd5gMPijYA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 05/11] qemuhotplugtest: Call qemuDomainAttachDeviceLive() directly Date: Fri, 21 Apr 2023 10:25:04 +0200 Message-Id: <841b30ff41f8336ee749827dac8879f96328ef26.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.2 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: 1682065578429100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no reason for qemuhotplugtest to reimplement which device attach function to call (testQemuHotplugAttach()) when qemuDomainAttachDeviceLive() already does that. Thus, drop testQemuHotplugAttach() and call qemuDomainAttachDeviceLive() directly. There's one small catch though, qemuDomainAttachDeviceLive() now calls one monitor command more (to list all aliases). We don't care really, because we're not testing that. Therefore, just provide a dummy reply. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- tests/qemuhotplugtest.c | 68 +++++------------------------------------ 1 file changed, 7 insertions(+), 61 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 4f9d1bcb2a..e3744964d5 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -109,66 +109,6 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, return 0; } =20 -static int -testQemuHotplugAttach(virDomainObj *vm, - virDomainDeviceDef *dev) -{ - int ret =3D -1; - - switch (dev->type) { - case VIR_DOMAIN_DEVICE_DISK: - /* conn in only used for storage pool and secrets lookup so as long - * as we don't use any of them, passing NULL should be safe - */ - ret =3D qemuDomainAttachDeviceDiskLive(&driver, vm, dev); - break; - case VIR_DOMAIN_DEVICE_CHR: - ret =3D qemuDomainAttachChrDevice(&driver, vm, dev); - break; - case VIR_DOMAIN_DEVICE_SHMEM: - ret =3D qemuDomainAttachShmemDevice(vm, dev->data.shmem); - break; - case VIR_DOMAIN_DEVICE_WATCHDOG: - ret =3D qemuDomainAttachWatchdog(vm, dev->data.watchdog); - break; - case VIR_DOMAIN_DEVICE_HOSTDEV: - ret =3D qemuDomainAttachHostDevice(&driver, vm, dev->data.hostdev); - break; - case VIR_DOMAIN_DEVICE_NET: - ret =3D qemuDomainAttachNetDevice(&driver, vm, dev->data.net); - break; - - case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_CONTROLLER: - case VIR_DOMAIN_DEVICE_GRAPHICS: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_REDIRDEV: - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_MEMORY: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_VSOCK: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - default: - VIR_TEST_VERBOSE("device type '%s' cannot be attached", - virDomainDeviceTypeToString(dev->type)); - break; - } - - return ret; -} - static int testQemuHotplugUpdate(virDomainObj *vm, virDomainDeviceDef *dev) @@ -325,6 +265,12 @@ testQemuHotplug(const void *data) goto cleanup; } =20 + /* After successful attach, we list all aliases. We don't care for tha= t in + * the test. Add a dummy reply. */ + if (test->action =3D=3D ATTACH && + qemuMonitorTestAddItem(test_mon, "qom-list", "{\"return\":[]}") < = 0) + goto cleanup; + priv =3D vm->privateData; priv->mon =3D qemuMonitorTestGetMonitor(test_mon); =20 @@ -335,7 +281,7 @@ testQemuHotplug(const void *data) =20 switch (test->action) { case ATTACH: - ret =3D testQemuHotplugAttach(vm, dev); + ret =3D qemuDomainAttachDeviceLive(vm, dev, &driver); if (ret =3D=3D 0) { /* vm->def stolen dev->data.* so we just need to free the dev * envelope */ --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065530; cv=none; d=zohomail.com; s=zohoarc; b=UKtoWi5a4Pb7G4o/DvA4KJgMRwMepyaIqePl1ZQTeQcPGwtJMKB8WobMEwt3y1XKWheEr011npqn7fr8qEs0zb4Q26GauSB+i5gOj7GLHueNzjWwzGyw8tr1P9nzn8yw4Epg/Ymp8P+cPoW/6IXYOhn91Wneplaj0qUdoaqpRPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065530; 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=S74bVJMr0flcqN5PFjOFlyYUYNQuF2kUrCHcMNc/BlM=; b=JqYQlrVnuaqyp/NPyqJMODlY+5uiAG4Q/gSBJv0Xba0ou9wNZki/UW/YS+DVu4CXzJ3fBwW4Xp12JoGm+s2PILbCFIItBmLarShYyaAblgH4AYajg2eUFQtTPXgTY3FkQ51BDcNW3QNKcQg08QBz3NmFJGum4DM266QOm3mzkEQ= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065530858331.9637772276019; Fri, 21 Apr 2023 01:25:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-Td_RN7pwMOmCFCxBlkO80g-1; Fri, 21 Apr 2023 04:25:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C5E585A588; Fri, 21 Apr 2023 08:25:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69B68C16024; Fri, 21 Apr 2023 08:25:26 +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 560231946A47; Fri, 21 Apr 2023 08:25:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E279E1946A66 for ; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D84A963A51; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FBBF63A5D for ; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065529; 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=S74bVJMr0flcqN5PFjOFlyYUYNQuF2kUrCHcMNc/BlM=; b=gSLf1F+1c3+yWQMY6QhQK4xf7M7Ocs6ar1D6GDsQXCm0p/83+oPvcdJDg7DHN4bQp0vbER XLjt4KVUnMVHhOFR4IfKN8wWZBI7nzqwFHU2E7Ncb0i4c+4YeYbpp6T6IeK2oUHftDAOWe 6If5ebW4pXg2TQDSQIoqTb3WG8ez8NA= X-MC-Unique: Td_RN7pwMOmCFCxBlkO80g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 06/11] qemuhotplugtest: Call qemuDomainUpdateDeviceLive() directly Date: Fri, 21 Apr 2023 10:25:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.8 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: 1682065532921100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There's no reason for qemuhotplugtest to reimplement which device update function to call (testQemuHotplugUpdate()) when qemuDomainUpdateDeviceLive() already does that. Thus, drop testQemuHotplugUpdate() and call qemuDomainUpdateDeviceLive() directly. BTW: this also shows why reimplementing qemuDomainUpdateDeviceLive() is bad idea: The "disk-cdrom-nochange" test is succeeding only because testQemuHotplugUpdate() supports graphics and returns an (expected) error for every other devtype. NB, there's still missing check that the resulting XML is the expected one (just like we do for attach and detach), but that's pre-existing and will be fixed later. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- tests/qemuhotplugtest.c | 57 +++-------------------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index e3744964d5..b4c03d5374 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -109,57 +109,6 @@ qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, return 0; } =20 -static int -testQemuHotplugUpdate(virDomainObj *vm, - virDomainDeviceDef *dev) -{ - int ret =3D -1; - - /* XXX Ideally, we would call qemuDomainUpdateDeviceLive here. But th= at - * would require us to provide virConnectPtr and virDomainPtr (they're= used - * in case of updating a disk device. So for now, we will proceed with - * breaking the function into pieces. If we ever learn how to fake tho= se - * required object, we can replace this code then. */ - switch (dev->type) { - case VIR_DOMAIN_DEVICE_GRAPHICS: - ret =3D qemuDomainChangeGraphics(&driver, vm, dev->data.graphics); - break; - - case VIR_DOMAIN_DEVICE_DISK: - case VIR_DOMAIN_DEVICE_LEASE: - case VIR_DOMAIN_DEVICE_FS: - case VIR_DOMAIN_DEVICE_NET: - case VIR_DOMAIN_DEVICE_INPUT: - case VIR_DOMAIN_DEVICE_SOUND: - case VIR_DOMAIN_DEVICE_VIDEO: - case VIR_DOMAIN_DEVICE_HOSTDEV: - case VIR_DOMAIN_DEVICE_WATCHDOG: - case VIR_DOMAIN_DEVICE_CONTROLLER: - case VIR_DOMAIN_DEVICE_HUB: - case VIR_DOMAIN_DEVICE_REDIRDEV: - case VIR_DOMAIN_DEVICE_NONE: - case VIR_DOMAIN_DEVICE_SMARTCARD: - case VIR_DOMAIN_DEVICE_CHR: - case VIR_DOMAIN_DEVICE_MEMBALLOON: - case VIR_DOMAIN_DEVICE_NVRAM: - case VIR_DOMAIN_DEVICE_LAST: - case VIR_DOMAIN_DEVICE_RNG: - case VIR_DOMAIN_DEVICE_TPM: - case VIR_DOMAIN_DEVICE_PANIC: - case VIR_DOMAIN_DEVICE_SHMEM: - case VIR_DOMAIN_DEVICE_MEMORY: - case VIR_DOMAIN_DEVICE_IOMMU: - case VIR_DOMAIN_DEVICE_VSOCK: - case VIR_DOMAIN_DEVICE_AUDIO: - case VIR_DOMAIN_DEVICE_CRYPTO: - VIR_TEST_VERBOSE("device type '%s' cannot be updated", - virDomainDeviceTypeToString(dev->type)); - break; - } - - return ret; -} - static int testQemuHotplugCheckResult(virDomainObj *vm, const char *expected, @@ -300,7 +249,7 @@ testQemuHotplug(const void *data) break; =20 case UPDATE: - ret =3D testQemuHotplugUpdate(vm, dev); + ret =3D qemuDomainUpdateDeviceLive(vm, dev, &driver, false); } =20 virObjectLock(priv->mon); @@ -632,8 +581,8 @@ mymain(void) DO_TEST_UPDATE("x86_64", "graphics-spice-listen-network", "graphics-sp= ice-listen-network-password", false, false, "set_password", QMP_OK, "expire_password", QMP_OK); cfg->spiceTLS =3D false; - /* Strange huh? Currently, only graphics can be updated :-P */ - DO_TEST_UPDATE("x86_64", "disk-cdrom", "disk-cdrom-nochange", true, fa= lse, NULL); + + DO_TEST_UPDATE("x86_64", "disk-cdrom", "disk-cdrom-nochange", false, f= alse, NULL); =20 DO_TEST_ATTACH("x86_64", "console-compat-2-live", "console-virtio", fa= lse, true, "chardev-add", "{\"return\": {\"pty\": \"/dev/pts/26\"}= }", --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065623; cv=none; d=zohomail.com; s=zohoarc; b=n+IO2y4LBSizHYmfuzPRL4mGhSC1WXnRrBvoLp+KSaLVjPdwtKs2ViPSW5wwxQPlFbYKxAkE/R7BTMi6roZFO8X3ARxYdCjaYqLglJT4FGZ0ANMkgfk74RPLsKiEdwJKe5hSfxRjJDC0WFrsmQtQaRySzh0NK/KWMPfglMx9sw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065623; 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=TJ0uldsIBdCGnmgxmqTndC1YjjcziZ2S4+NSp3EnXlo=; b=UgOdkVgAigV2Vrbms1Nxf5E9ac2+c+sRIBoyvbH9Ym4n3HcSOK4RwadLSkEl4Pt1SuPrQYM3YJdTIP1XH0zBsAxIEklhh0HCzRtWglSFbEu2kUfkq5SE3q4gkoMc5Kd1QZvQGqhvAs8jnPirRtM076O+MeEHEdAyhsmlnhbfsA8= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065623017745.2285411735505; Fri, 21 Apr 2023 01:27:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-PpYdw1vyMtCwM5Y6clQ0Ag-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E47DA101470E; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D16DD492C13; Fri, 21 Apr 2023 08:25:17 +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 7BA6E1946A68; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8F2A619466DF for ; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 75ACE63A51; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A6D518EC7 for ; Fri, 21 Apr 2023 08:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065622; 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=TJ0uldsIBdCGnmgxmqTndC1YjjcziZ2S4+NSp3EnXlo=; b=Fsxc1aQDuPRf5IDpEGqJY+WZ/d0ZTDnnw9Pezkpw6+ZkgHbjRuXBykMe6rLkK+nKhWMDCb gNuRv3Wf+Nhj/7JPveZ7OWkRMS5Du0iztEukPpRh+jp0Ih/gDs6QA7+w9AswiL/SxK/LVL LDnKLgBhPuWixRerpEnZJOIMcOCMYIc= X-MC-Unique: PpYdw1vyMtCwM5Y6clQ0Ag-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 07/11] qemu_hotplug.h: Expose less functions Date: Fri, 21 Apr 2023 10:25:06 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.9 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: 1682065623413100001 Content-Type: text/plain; charset="utf-8"; x-default="true" After previous cleanups a lot of functions from qemu_hotplug.c are called only within the file. Make them static and drop their declaration from the header file. Signed-off-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 56 +++++++++++++++++++++---------------- src/qemu/qemu_hotplug.h | 61 ----------------------------------------- 2 files changed, 32 insertions(+), 85 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index f72bb7722d..13b1872ea3 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -75,6 +75,11 @@ VIR_LOG_INIT("qemu.qemu_hotplug"); static void qemuDomainResetDeviceRemoval(virDomainObj *vm); =20 +static int +qemuDomainAttachHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev); + /** * qemuDomainDeleteDevice: * @vm: domain object @@ -546,7 +551,7 @@ qemuDomainChangeMediaBlockdev(virDomainObj *vm, * * Returns 0 on success, -1 on error and reports libvirt error */ -int +static int qemuDomainChangeEjectableMedia(virQEMUDriver *driver, virDomainObj *vm, virDomainDiskDef *disk, @@ -754,8 +759,9 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, } =20 =20 -int qemuDomainAttachControllerDevice(virDomainObj *vm, - virDomainControllerDef *controller) +static int +qemuDomainAttachControllerDevice(virDomainObj *vm, + virDomainControllerDef *controller) { int ret =3D -1; const char* type =3D virDomainControllerTypeToString(controller->type); @@ -1033,7 +1039,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver = *driver, * This function handles all the necessary steps to attach a new storage s= ource * to the VM. */ -int +static int qemuDomainAttachDeviceDiskLive(virQEMUDriver *driver, virDomainObj *vm, virDomainDeviceDef *dev) @@ -1077,7 +1083,7 @@ qemuDomainNetDeviceVportRemove(virDomainNetDef *net) } =20 =20 -int +static int qemuDomainAttachNetDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainNetDef *net) @@ -1768,9 +1774,10 @@ qemuDomainDelChardevTLSObjects(virQEMUDriver *driver, } =20 =20 -int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainRedirdevDef *redirdev) +static int +qemuDomainAttachRedirdevDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRedirdevDef *redirdev) { int ret =3D -1; qemuDomainObjPrivate *priv =3D vm->privateData; @@ -1995,7 +2002,7 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObj *vm, } =20 =20 -int +static int qemuDomainAttachChrDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainDeviceDef *dev) @@ -2125,7 +2132,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver, } =20 =20 -int +static int qemuDomainAttachRNGDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainRNGDef *rng) @@ -2240,7 +2247,7 @@ qemuDomainAttachRNGDevice(virQEMUDriver *driver, * * Returns 0 on success -1 on error. */ -int +static int qemuDomainAttachMemory(virQEMUDriver *driver, virDomainObj *vm, virDomainMemoryDef *mem) @@ -2757,7 +2764,7 @@ qemuDomainAttachMediatedDevice(virQEMUDriver *driver, } =20 =20 -int +static int qemuDomainAttachHostDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainHostdevDef *hostdev) @@ -2808,7 +2815,7 @@ qemuDomainAttachHostDevice(virQEMUDriver *driver, } =20 =20 -int +static int qemuDomainAttachShmemDevice(virDomainObj *vm, virDomainShmemDef *shmem) { @@ -2914,7 +2921,7 @@ qemuDomainAttachShmemDevice(virDomainObj *vm, } =20 =20 -int +static int qemuDomainAttachWatchdog(virDomainObj *vm, virDomainWatchdogDef *watchdog) { @@ -3017,7 +3024,7 @@ qemuDomainAttachWatchdog(virDomainObj *vm, } =20 =20 -int +static int qemuDomainAttachInputDevice(virDomainObj *vm, virDomainInputDef *input) { @@ -3118,7 +3125,7 @@ qemuDomainAttachInputDevice(virDomainObj *vm, } =20 =20 -int +static int qemuDomainAttachVsockDevice(virDomainObj *vm, virDomainVsockDef *vsock) { @@ -3195,7 +3202,7 @@ qemuDomainAttachVsockDevice(virDomainObj *vm, } =20 =20 -int +static int qemuDomainAttachFSDevice(virQEMUDriver *driver, virDomainObj *vm, virDomainFSDef *fs) @@ -3288,7 +3295,7 @@ qemuDomainAttachFSDevice(virQEMUDriver *driver, } =20 =20 -int +static int qemuDomainAttachLease(virQEMUDriver *driver, virDomainObj *vm, virDomainLeaseDef *lease) @@ -3596,9 +3603,10 @@ qemuDomainChangeNetFilter(virDomainObj *vm, return 0; } =20 -int qemuDomainChangeNetLinkState(virDomainObj *vm, - virDomainNetDef *dev, - int linkstate) +static int +qemuDomainChangeNetLinkState(virDomainObj *vm, + virDomainNetDef *dev, + int linkstate) { int ret =3D -1; qemuDomainObjPrivate *priv =3D vm->privateData; @@ -3626,7 +3634,7 @@ int qemuDomainChangeNetLinkState(virDomainObj *vm, return ret; } =20 -int +static int qemuDomainChangeNet(virQEMUDriver *driver, virDomainObj *vm, virDomainDeviceDef *dev) @@ -4232,7 +4240,7 @@ qemuDomainChangeGraphicsPasswords(virDomainObj *vm, } =20 =20 -int +static int qemuDomainChangeGraphics(virQEMUDriver *driver, virDomainObj *vm, virDomainGraphicsDef *dev) @@ -6896,7 +6904,7 @@ qemuDomainSetVcpuInternal(virQEMUDriver *driver, } =20 =20 -int +static int qemuDomainChangeMemoryRequestedSize(virDomainObj *vm, const char *alias, unsigned long long requestedsize) diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index d9a5ac1164..4fe7f4923e 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -24,12 +24,6 @@ #include "qemu_conf.h" #include "qemu_domain.h" =20 -int qemuDomainChangeEjectableMedia(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDiskDef *disk, - virStorageSource *newsrc, - bool force); - void qemuDomainDelTLSObjects(virDomainObj *vm, virDomainAsyncJob asyncJob, const char *secAlias, @@ -48,68 +42,17 @@ int qemuDomainGetTLSObjects(qemuDomainSecretInfo *secin= fo, virJSONValue **tlsProps, virJSONValue **secProps); =20 -int qemuDomainAttachControllerDevice(virDomainObj *vm, - virDomainControllerDef *controller); -int qemuDomainAttachDeviceDiskLive(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDeviceDef *dev); - int qemuDomainAttachDiskGeneric(virDomainObj *vm, virDomainDiskDef *disk, virDomainAsyncJob asyncJob); =20 -int qemuDomainAttachNetDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainNetDef *net); -int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainRedirdevDef *hostdev); -int qemuDomainAttachHostDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainHostdevDef *hostdev); -int qemuDomainAttachShmemDevice(virDomainObj *vm, - virDomainShmemDef *shmem); -int qemuDomainAttachWatchdog(virDomainObj *vm, - virDomainWatchdogDef *watchdog); int qemuDomainFindGraphicsIndex(virDomainDef *def, virDomainGraphicsDef *dev); -int qemuDomainAttachMemory(virQEMUDriver *driver, - virDomainObj *vm, - virDomainMemoryDef *mem); -int qemuDomainChangeGraphics(virQEMUDriver *driver, - virDomainObj *vm, - virDomainGraphicsDef *dev); int qemuDomainChangeGraphicsPasswords(virDomainObj *vm, int type, virDomainGraphicsAuthDef *auth, const char *defaultPasswd, int asyncJob); -int qemuDomainChangeNet(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDeviceDef *dev); -int qemuDomainChangeNetLinkState(virDomainObj *vm, - virDomainNetDef *dev, - int linkstate); - -int qemuDomainAttachInputDevice(virDomainObj *vm, - virDomainInputDef *input); - -int qemuDomainAttachVsockDevice(virDomainObj *vm, - virDomainVsockDef *vsock); -int -qemuDomainAttachFSDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainFSDef *fs); - -int qemuDomainAttachLease(virQEMUDriver *driver, - virDomainObj *vm, - virDomainLeaseDef *lease); -int qemuDomainAttachChrDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDeviceDef *dev); -int qemuDomainAttachRNGDevice(virQEMUDriver *driver, - virDomainObj *vm, - virDomainRNGDef *rng); =20 int qemuDomainAttachDeviceLive(virDomainObj *vm, virDomainDeviceDef *dev, @@ -165,7 +108,3 @@ int qemuHotplugAttachDBusVMState(virQEMUDriver *driver, =20 int qemuHotplugRemoveDBusVMState(virDomainObj *vm, virDomainAsyncJob asyncJob); - -int qemuDomainChangeMemoryRequestedSize(virDomainObj *vm, - const char *alias, - unsigned long long requestedsize); --=20 2.39.2 From nobody Sat Nov 23 01:47:14 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=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.129.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=1682065570; cv=none; d=zohomail.com; s=zohoarc; b=Ts477iqnpjUGNo+HQTnRXzlY7K8tzyjMfEyJNpazcnqtjDG3xxNRLkFB19Rmuufsl9oByO/oQRYL1AYBDtbKip/p+R0NKI739RqLyxvy/Q0tAMXjsmp4MiGNbwx/vsmK1YLTKPYkc0Z7RrbS57zwEifJOc5kU5MCJkutgiCeF7U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065570; 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=43zo+7ToIlGVFnmG1Fay8tOPHLHREeNEUsQ8tV6Cmn4=; b=QfGFXjXaorLdx/VV79+aezoPmUZSN1ozO1wdgoP4K04LLdfwFISvRn3J5JqKHJMhng3lO4WYUaGIZfsU0f86PfX5848/zIeVRvBKuqLLf/lyQa8i5QfYHrr8PF1hLOCJSmvwxH2NSs1Fy8s7F9LwG0ezDDoQ8dOsGcpdlLzapko= 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=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.129.124]) by mx.zohomail.com with SMTPS id 1682065570413958.3342904395892; Fri, 21 Apr 2023 01:26:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-kegQ7VFkMUyRu9-HNY5HSg-1; Fri, 21 Apr 2023 04:25:22 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5264D10146E7; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38B6240C2027; Fri, 21 Apr 2023 08:25:18 +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 C08B01946A52; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2B8071946A50 for ; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1137B18EC7; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC4705AB7A for ; Fri, 21 Apr 2023 08:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065569; 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=43zo+7ToIlGVFnmG1Fay8tOPHLHREeNEUsQ8tV6Cmn4=; b=NQ0g+AS2cngCSdz2KBgNSI9Y3ygoOhUtpiHKnur1croC0hAHuNbqR72h7nLa6gPAffpQ6b a0KmqPOgIJGMT8UPvC6qaFMEsFuvUFXKwkOXVPhane4EJCVUNvh3ZClcaRJC5I1FwxZUj2 40r4V9yJnmyS1aq2ehfcOWipTUbU5VM= X-MC-Unique: kegQ7VFkMUyRu9-HNY5HSg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 08/11] qemuhotplugtest: Fix misleading comment on monitor unlock Date: Fri, 21 Apr 2023 10:25:07 +0200 Message-Id: <3ac33b0d82d6f1ec44e3d08c098b7ce427c0dba3.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.1 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: 1682065571956100003 Content-Type: text/plain; charset="utf-8"; x-default="true" There's a comment in testQemuHotplug() trying to explain why we need to unlock the monitor object. Well, while it might have been correct when being introduced, it's no long factually correct as just any function (attach/detach/update) might talk to the monitor and it expects the monitor to be unlocked (as it calls qemuDomainObjEnterMonitor() + qemuDomainObjExitMonitor()). Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index b4c03d5374..9a1cf8ab2f 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -223,9 +223,8 @@ testQemuHotplug(const void *data) priv =3D vm->privateData; priv->mon =3D qemuMonitorTestGetMonitor(test_mon); =20 - /* XXX We need to unlock the monitor here, as - * qemuDomainObjEnterMonitorInternal (called from qemuDomainChangeGrap= hics) - * tries to lock it again */ + /* We need to unlock the monitor here, as any function below talks + * (transitively) on the monitor. */ virObjectUnlock(priv->mon); =20 switch (test->action) { --=20 2.39.2 From nobody Sat Nov 23 01:47:14 2024 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=1682065528; cv=none; d=zohomail.com; s=zohoarc; b=SEXwsX9jxLgmThQTFBbhHcYbR5UCYGeLooHRZbk4rnW9Osipm2rH4OIwT1OecOZO5455bQG6aSAuoLVGFVuK36aWy6EXT8oks8qZQVDMFhUG/s8Usz8FJuB70HaSI7mI/QK6k8Kcr1W+ZYBU+UuvRWU8Zy43BIy0yI67aruSKj8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065528; 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=D1wLP8hL1DP5DKsEvIk4N0Fcyk0WTROvKw9JyeFQPMU=; b=V8AFUk93k6KsOMZObnKLYfq7j/2bONXYBcvuBm+kPgnZxpGTar1a8QQKqo+OLTdIxXJh09y60Lq3nQ5wD+64csi/udyv1cRFinrI1Gmqz2OxV8ADuXB8NmbTbmreDuklVhfbx58cASe1om6TkdqoLy9oXsI0I4Ra8UjaZkWNwHY= 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 168206552851219.939847295082927; Fri, 21 Apr 2023 01:25:28 -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-626-SV43hB47P02SduaOYDsykQ-1; Fri, 21 Apr 2023 04:25:23 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4A0D83815F8A; Fri, 21 Apr 2023 08:25:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37F2DC164E7; Fri, 21 Apr 2023 08:25:20 +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 198491946A40; Fri, 21 Apr 2023 08:25:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AB3B41946A5A for ; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A0E6263ABA; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 471BF63A51 for ; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065527; 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=D1wLP8hL1DP5DKsEvIk4N0Fcyk0WTROvKw9JyeFQPMU=; b=aWgwlgk38Y7TjTjX2ZkpvyJDA2koCImi8E/EtfGhHbE+5E32PW00YMKDE800zh2fCH60Nh zMsEsr7SJ3I3ssVA49mRCIgZKI7I9cX3M0NbMUpAdhrKjbPJlhGv+Sz7Je348R5t0IZH9Y Ii1Hh8+C7/qzucxpVBv5/CcHkhKhlNY= X-MC-Unique: SV43hB47P02SduaOYDsykQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 09/11] qemuhotplugtest: Don't overwrite vm->def->id in testQemuHotplugCheckResult() Date: Fri, 21 Apr 2023 10:25:08 +0200 Message-Id: <4389d4a2911542ae79eb7ca1ab63bd8bdfc68729.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.8 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: 1682065530204100003 Content-Type: text/plain; charset="utf-8"; x-default="true" This is a leftover from v2.0.0-rc1~300. In v1.2.12-rc1~43 we've introduced a code that explicitly sets vm->def->id to -1 to force generation of inactive XML. But this was removed in the later commit, which forgot to remove the restoration of the original dom ID. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- tests/qemuhotplugtest.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9a1cf8ab2f..d5ceb1373b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -122,7 +122,6 @@ testQemuHotplugCheckResult(virDomainObj *vm, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!actual) return -1; - vm->def->id =3D QEMU_HOTPLUG_TEST_DOMAIN_ID; =20 if (STREQ(expected, actual)) { if (fail) --=20 2.39.2 From nobody Sat Nov 23 01:47:14 2024 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=1682065563; cv=none; d=zohomail.com; s=zohoarc; b=dF+LUA4Jh12GE1e415Yh8qPGqfV6BuOqdMdQ78mabQeJCQLUcUYNtCK/mDsAaxeG1RI1OBTZ4BU32Ff6lCiXeCjbmJ+QHtMbcGknK3xe52QkbDzZaX03/FvWvANp1ECHbFSNpueZMEOxgvJyWaQY5RXkkEIHzedNT/BdRqFXmNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065563; 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=/jgFnU0GkIbi8DSEck3yBLLz82B7QFSADL00SAedCXQ=; b=YrhH+2qI379dYIe5uk0zOyGr8PXUuww71d0QNYPiUNWA1DcH6VHn99pll18WxhhKzvqmItS7vKloLUNoV0B5DNrv8wvHKJ/qNWNKx2UPpD+lu7j3KPysKfbTsuX6Be7BPjlyxT1ZqOVclXpzebjllBUiqF7c+YB8Dlffr2Owb9Q= 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 1682065563772646.8768189623092; Fri, 21 Apr 2023 01:26:03 -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-664-KylYdp9INbisJ7_dhLJUqg-1; Fri, 21 Apr 2023 04:25:23 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A032C2999B2A; Fri, 21 Apr 2023 08:25:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BA21492C13; Fri, 21 Apr 2023 08:25:19 +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 71A6D1946A40; Fri, 21 Apr 2023 08:25:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 43DBC19466DF for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3A18163A51; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D63CD63A68 for ; Fri, 21 Apr 2023 08:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065562; 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=/jgFnU0GkIbi8DSEck3yBLLz82B7QFSADL00SAedCXQ=; b=DmZZUJm4xigIwlf5HkymqVViFBlwvZZ33c04fpo3jbVCeidunM/TCnEwSMwntDLGbBWy43 dAGcQ/X6onpAGaGxTTKh6JCUiI0ffuxBbwyiQ1dFZXFe9m0/P6GBsp/9LwfakSBqw481/T BxVqRLW55kWJX72yvMaqlxRnmEsmOSM= X-MC-Unique: KylYdp9INbisJ7_dhLJUqg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 10/11] qemuhotplugtest: use g_autoptr(virDomainDeviceDef) Date: Fri, 21 Apr 2023 10:25:09 +0200 Message-Id: <55f25c6b9f560538b7a4830626caee4314b33150.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.9 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: 1682065565036100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This brings us one step closer to the caller of qemuDomainAttachDeviceLive() (qemuDomainAttachDeviceLiveAndConfig()). Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- tests/qemuhotplugtest.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d5ceb1373b..fffb4a3410 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -154,7 +154,7 @@ testQemuHotplug(const void *data) bool keep =3D test->keep; unsigned int device_parse_flags =3D 0; virDomainObj *vm =3D NULL; - virDomainDeviceDef *dev =3D NULL; + g_autoptr(virDomainDeviceDef) dev =3D NULL; g_autoptr(qemuMonitorTest) test_mon =3D NULL; qemuDomainObjPrivate *priv =3D NULL; =20 @@ -229,11 +229,6 @@ testQemuHotplug(const void *data) switch (test->action) { case ATTACH: ret =3D qemuDomainAttachDeviceLive(vm, dev, &driver); - if (ret =3D=3D 0) { - /* vm->def stolen dev->data.* so we just need to free the dev - * envelope */ - VIR_FREE(dev); - } if (ret =3D=3D 0 || fail) ret =3D testQemuHotplugCheckResult(vm, result_xml, result_filename, fail); @@ -262,7 +257,6 @@ testQemuHotplug(const void *data) virObjectUnref(vm); test->vm =3D NULL; } - virDomainDeviceDefFree(dev); return ((ret < 0 && fail) || (!ret && !fail)) ? 0 : -1; } =20 --=20 2.39.2 From nobody Sat Nov 23 01:47:14 2024 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=1682065577; cv=none; d=zohomail.com; s=zohoarc; b=Ar+vyehdIPUtK+9lXhgmAp4JygOZId1C6GcddzvIxgl+LWIoSEZvqYcfU9erQhbXYY1qoG5+WfHgSOcKdS454lsTMNNKWZdIZSRO6c4KkIAsxrDgCSdu/Ke9HPUJoKw5/HJN4JnQVmy1m8NlFwpQJh0nnCxMRFUWed5+ERty5xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065577; 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=YinFwsyj1vRCYv/LX2CflxLcLRSPflQj4UIPwM7JLdU=; b=A9vufSebzS9enJZyU3f9ivsVbcK2RE3u4v4lsb5ePIlDdrXy53KM7nCsjoXb7wl/Q3LXghcP/25O0d7l6mIzViTlsMiq8tjdE/CecQg7uggDCQ/wzfeXp2lR/qI0ajTavcplbGuuIkkST9I7mw2N8CmUg8rLFYcxyEzb7sDa7Vo= 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 16820655777101003.205461161657; Fri, 21 Apr 2023 01:26:17 -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-115-GNYZQzWtOXCGDI1So1C5Zw-1; Fri, 21 Apr 2023 04:25:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 201F62999B4F; Fri, 21 Apr 2023 08:25:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA7DC2166B33; Fri, 21 Apr 2023 08:25:22 +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 AA2191946A40; Fri, 21 Apr 2023 08:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D72E619466DF for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CA3545AB7A; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71D7663ABE for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065576; 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=YinFwsyj1vRCYv/LX2CflxLcLRSPflQj4UIPwM7JLdU=; b=XKWJxCivX4NsLSNv2O9sbiR83Z0JpEXR6BmGUlv/GwmAIsSXCN+bJ0eEtQkgA2E98ybIll QfMCRxBJIs6X23VH/GXhZtXrFxOJ1zBdN6x0AHgA7ORziEB1Fds48xlg4Mvg2ftpLBrjfc XZ2wtmeRykI3k1kmkI8eS/LcQfBzL5g= X-MC-Unique: GNYZQzWtOXCGDI1So1C5Zw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 11/11] qemuhotplugtest: Verify domain XML on UPDATE Date: Fri, 21 Apr 2023 10:25:10 +0200 Message-Id: <4e6a5c8ef2e29b506bc5e79f971443b6cd8c8ef6.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 3.1 on 10.11.54.6 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: 1682065579220100004 Content-Type: text/plain; charset="utf-8"; x-default="true" Just like we check the resulting domain XML after ATTACH and DETACH, we should do the same after UPDATE action. This is as simple as calling testQemuHotplugCheckResult() and providing missing XMLs. For those test cases where no change is done, we can just make the expected XML a symlink to the input XML. Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 9 +- ...hotplug-disk-cdrom+disk-cdrom-nochange.xml | 1 + .../qemuhotplug-disk-cdrom.xml | 30 ++++- ...graphics-spice+graphics-spice-nochange.xml | 1 + ...graphics-spice-listen-network-password.xml | 71 +++++++++++ ...imeout+graphics-spice-timeout-nochange.xml | 1 + ...imeout+graphics-spice-timeout-password.xml | 117 ++++++++++++++++++ .../qemuhotplug-graphics-spice-timeout.xml | 50 ++++++-- .../qemuhotplug-graphics-spice.xml | 41 ++++-- 9 files changed, 295 insertions(+), 26 deletions(-) create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+dis= k-cdrom-nochange.xml create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= +graphics-spice-nochange.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -listen-network+graphics-spice-listen-network-password.xml create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -timeout+graphics-spice-timeout-nochange.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -timeout+graphics-spice-timeout-password.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index fffb4a3410..091fcc4d49 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -123,7 +123,7 @@ testQemuHotplugCheckResult(virDomainObj *vm, if (!actual) return -1; =20 - if (STREQ(expected, actual)) { + if (STREQ_NULLABLE(expected, actual)) { if (fail) VIR_TEST_VERBOSE("domain XML should not match the expected res= ult"); ret =3D 0; @@ -170,7 +170,9 @@ testQemuHotplug(const void *data) virTestLoadFile(device_filename, &device_xml) < 0) goto cleanup; =20 - if (test->action =3D=3D ATTACH && + if (!fail && + (test->action =3D=3D ATTACH || + test->action =3D=3D UPDATE) && virTestLoadFile(result_filename, &result_xml) < 0) goto cleanup; =20 @@ -243,6 +245,9 @@ testQemuHotplug(const void *data) =20 case UPDATE: ret =3D qemuDomainUpdateDeviceLive(vm, dev, &driver, false); + if (ret =3D=3D 0 || fail) + ret =3D testQemuHotplugCheckResult(vm, result_xml, + result_filename, fail); } =20 virObjectLock(priv->mon); diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom= -nochange.xml b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cd= rom-nochange.xml new file mode 120000 index 0000000000..e07b01b301 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochan= ge.xml @@ -0,0 +1 @@ +qemuhotplug-disk-cdrom.xml \ No newline at end of file diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml b/test= s/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml index 3acf55ab17..bcf4cf9bf8 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml @@ -1,4 +1,4 @@ - + QEMUGuest1 c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 @@ -8,6 +8,9 @@ hvm + + qemu64 + destroy restart @@ -18,6 +21,7 @@ +
@@ -25,13 +29,27 @@ +
- - - - - + + +
+ + + +
+ + + + + + + + + + +