From nobody Tue May 14 04:17:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524454123064224.36370692481944; Sun, 22 Apr 2018 20:28:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E5B8F3132589; Mon, 23 Apr 2018 03:28:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 88A0B5DD64; Mon, 23 Apr 2018 03:28:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 1870D4CAA0; Mon, 23 Apr 2018 03:28:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3N3SWGc012671 for ; Sun, 22 Apr 2018 23:28:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3B5969210; Mon, 23 Apr 2018 03:28:32 +0000 (UTC) Received: from mx1.redhat.com (ext-mx17.extmail.prod.ext.phx2.redhat.com [10.5.110.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC1CE69CB2 for ; Mon, 23 Apr 2018 03:28:30 +0000 (UTC) Received: from mail-qk0-f196.google.com (mail-qk0-f196.google.com [209.85.220.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F0EF3133E93 for ; Mon, 23 Apr 2018 03:28:19 +0000 (UTC) Received: by mail-qk0-f196.google.com with SMTP id d74so14805265qkg.4 for ; Sun, 22 Apr 2018 20:28:19 -0700 (PDT) Received: from localhost.localdomain ([187.39.60.14]) by smtp.gmail.com with ESMTPSA id o84sm6916506qkh.15.2018.04.22.20.28.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Apr 2018 20:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=nHJSxFPiP/grQV0L7ZuOBRaxk/BUxlP/5IgnGPfzgAk=; b=Tlr/UOOhUkdDW8K9ANtoPKDRQw7/BIoG/PDV7P8QrTP6Wu9j0xW3QC52DDqm8xlW5Q D0PKXj2cbdENmPx1oC1S8NjMt1+CG/ofx80YWetqAyRxihMEHDpqMqSuef4gztoIp60V H1kBZM17HFuFPs58SO8x8OwXFFOWSf0EnbMlGRUXhxLMXaqG0fwQ17N/eeJK/0JwoT/A 2SsHdUibA6PcQiV/Zj8DHw7YGMEvBzBMUO4YTCQ1ejSpBgfHrZPvQI8k3tJy25wrRVvp nzeU80JowU0fH2Isl4BEpEjlBPiYQ6mS62E/9iGAhWsuOZ3H+RV1qlggXLRejz8R4SiL VpJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=nHJSxFPiP/grQV0L7ZuOBRaxk/BUxlP/5IgnGPfzgAk=; b=mXKehc+A2oRVHXucBKocG2bcB/0NZ9I1tIwc7+Tk/BhSqyux5NQeZReeS8iczAjv9T 5XRF6UwEzOU7biynGsGe/kqbDDZpIKGKLABNJ/2bDzU03WcEp5YODq+iSjYhFZUJfmmO 3+Hh9/WLx+b59b9BfsbDXzUOGizlOFaaxQy/PinbKRkLY4cHhqSOX+DB+r7hTQ2/k8/g lQQEiRRK0ETp1mcp2AhhXyi1Du3pZVqWrc0/q9RcgtA19+unw6eWzNzuy5Y4xsBLk9Ik TEpuIwFy0bHsKDDSbtkz2FjXhu0WS/2npgxzZh6XhFyWrtbOmraKbDZGrt7d24HhupFd 4CeQ== X-Gm-Message-State: ALQs6tAPJLRRQQYBdRuIOL/X2nZGGtOpuhmdpVD6wGiry8rNjxMFkBF6 965ijVZa4KpoCYt4zNCPY1Zg6g== X-Google-Smtp-Source: AB8JxZryze6FgckxLxv50yMxvz3iXhWtiHyElyAHImtD/hVtJ0qe0dUsfaAi6mL2dI6eh4ewR7zHtQ== X-Received: by 10.55.27.136 with SMTP id m8mr21110586qkh.242.1524454098246; Sun, 22 Apr 2018 20:28:18 -0700 (PDT) From: Julio Faracco To: libvir-list@redhat.com Date: Mon, 23 Apr 2018 00:27:40 -0300 Message-Id: <20180423032740.31542-1-jcfaracco@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 23 Apr 2018 03:28:19 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 23 Apr 2018 03:28:19 +0000 (UTC) for IP:'209.85.220.196' DOMAIN:'mail-qk0-f196.google.com' HELO:'mail-qk0-f196.google.com' FROM:'jcfaracco@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.281 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS, T_DKIM_INVALID) 209.85.220.196 mail-qk0-f196.google.com 209.85.220.196 mail-qk0-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.46 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] qemu: avoid slash characters to the new domain name. X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Mon, 23 Apr 2018 03:28:41 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The 'domrename' command needs to check if the new domain name contains the slash character. This character is not accepted by libvirt XML definition because it is an invalid char (see Cole's commit b1fc6a7b7). This commit enhace the 'domrename' command adding this check. The method virDomainDefPostParse() was the other methods to check the domain are not accessible. Signed-off-by: Julio Faracco --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5673d9fd8..9b16bc9c9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20773,6 +20773,9 @@ qemuDomainRenameCallback(virDomainObjPtr vm, vm->def->name =3D new_dom_name; new_dom_name =3D NULL; =20 + if (virDomainDefPostParse(vm->def, driver->caps, 0, driver->xmlopt, NU= LL) < 0) + goto rollback; + if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0) goto rollback; =20 --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list