From nobody Mon Feb 9 01:16:32 2026 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; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1616633731; cv=none; d=zohomail.com; s=zohoarc; b=S61voAzIldr6F7FQj8sLGmRTzOck596rUvlzk8wUh9TIgYfAFf162aCG3M6EiiPx7QAWd9swOA8kkENlEPdModW1+WKq7UH/wv5gU/4ABAsEUTbOXK2slAFoCAP9yEehugsuBnF9AWMU3pQJzaP5hnhO2i3WLFmExIMsRL3GnBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616633731; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iPxXFQ9xTUQG1Q+0/65wSnLtHYVZg+DspiQtZ1IRC3E=; b=TU5R2fSJgpMXpnQEhVClY4duBJkmSXANjorfotVmRVJNQmQYLE6jyAZccmypc3rMLHF9JDhBCNGNu2fr2EnxNxnJfuXCDLfhOJF5wN+reCy9ynne+0ateGJEf1ANFP8cjn/gHHOW+EdmPj6LjNPDq7xX+iI3H1H3d05N6C9fvV4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= 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 1616633731567455.1939111343454; Wed, 24 Mar 2021 17:55:31 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-ruCpp48UOHG-C1HWFe4Wmw-1; Wed, 24 Mar 2021 20:55:28 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F396101371E; Thu, 25 Mar 2021 00:55:23 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 346FC1045EBE; Thu, 25 Mar 2021 00:55:23 +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 DED8D18005B6; Thu, 25 Mar 2021 00:55:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12P0t3ed024573 for ; Wed, 24 Mar 2021 20:55:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFD0F101A806; Thu, 25 Mar 2021 00:55:03 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA77710F1CC4 for ; Thu, 25 Mar 2021 00:55:01 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7ED15811E9C for ; Thu, 25 Mar 2021 00:55:01 +0000 (UTC) Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-62-yfQA8zOKP7aBWY5MPVa3fA-1; Wed, 24 Mar 2021 20:54:59 -0400 Received: by mail-qv1-f49.google.com with SMTP id dc12so373636qvb.4 for ; Wed, 24 Mar 2021 17:54:59 -0700 (PDT) Received: from localhost (209-6-122-159.s2973.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [209.6.122.159]) by smtp.gmail.com with ESMTPSA id c5sm2991821qkl.21.2021.03.24.17.54.58 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Mar 2021 17:54:58 -0700 (PDT) X-MC-Unique: ruCpp48UOHG-C1HWFe4Wmw-1 X-MC-Unique: yfQA8zOKP7aBWY5MPVa3fA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iPxXFQ9xTUQG1Q+0/65wSnLtHYVZg+DspiQtZ1IRC3E=; b=UZ20ujJw9exwVZKhIsoEQZ16Saiev7AHPsLpe7c6cHuQsny39K98UpETRrdvyJb78v 12d/SyS3TjUJDtLPXGPgtkw2alDgb/YNa8wgo6hHH/htuyIaKqFUp0fMdRPjNjBA55K2 ArxYjjV/612BFWq/7/ZDHasTC5/eyQtdXMv2CujYlPSmbf8xtesh8nRFEocoCzobzlSp PQnoIJkdDTj5Hf9Jlh5bwK8OVJggjM1U8/DsX/hHKAm4NNUzxnOHk7CnGgunBFDskZ6X wz1QjNve8jr1Fn8fbmZWpym2nrPns1G8giiBiDvnG6ZIPHcq3urZaQ9segZV4mGU5YIX +Z6w== X-Gm-Message-State: AOAM533fj/poqTfWkkSFqQiNaRo4+Cmo3Bfi8H7hbIfALRqPznQJvmPP 6UpNNxEnmX0SaVjsaFHnH1AkHNMiJA== X-Google-Smtp-Source: ABdhPJx11YK1WcpW/sBtS4d2Cp71NFVh+O0YzBkNChuaDGscrKEhAQ3JJnZVuJa4Yyd83o8jqcXfkg== X-Received: by 2002:a0c:b5c6:: with SMTP id o6mr6038714qvf.27.1616633698979; Wed, 24 Mar 2021 17:54:58 -0700 (PDT) From: Masayoshi Mizuma To: libvir-list@redhat.com Subject: [PATCH 03/10] virsh: Add transient flag for disk hotplug Date: Wed, 24 Mar 2021 20:54:07 -0400 Message-Id: <20210325005414.275401-4-msys.mizuma@gmail.com> In-Reply-To: <20210325005414.275401-1-msys.mizuma@gmail.com> References: <20210325005414.275401-1-msys.mizuma@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Masayoshi Mizuma , Masayoshi Mizuma X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Masayoshi Mizuma Enable disk option for the xml to hotplug disks. And disk option is also available for the disk to share the disk with multiple guests. For example: # cat disk.xml # # virsh attach-device Guest1 disk.xml Device attached successfully # # virsh attach-device Guest2 disk.xml Device attached successfully # Signed-off-by: Masayoshi Mizuma --- tools/virsh-domain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index a778421b66..7246260673 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -486,6 +486,10 @@ static const vshCmdOptDef opts_attach_disk[] =3D { .type =3D VSH_OT_STRING, .help =3D N_("host socket for source of disk device") }, + {.name =3D "transient", + .type =3D VSH_OT_BOOL, + .help =3D N_("mark the disk as transient") + }, VIRSH_COMMON_OPT_DOMAIN_PERSISTENT, VIRSH_COMMON_OPT_DOMAIN_CONFIG, VIRSH_COMMON_OPT_DOMAIN_LIVE, @@ -593,6 +597,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) bool live =3D vshCommandOptBool(cmd, "live"); bool persistent =3D vshCommandOptBool(cmd, "persistent"); bool multifunction =3D vshCommandOptBool(cmd, "multifunction"); + bool transient =3D vshCommandOptBool(cmd, "transient"); =20 VSH_EXCLUSIVE_OPTIONS_VAR(persistent, current); =20 @@ -739,6 +744,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) cmdAttachDiskFormatAddress(ctl, &diskChildBuf, straddr, target, mu= ltifunction) < 0) return false; =20 + if (transient) + virBufferAddLit(&diskChildBuf, "\n"); + virXMLFormatElement(&buf, "disk", &diskAttrBuf, &diskChildBuf); =20 xml =3D virBufferContentAndReset(&buf); --=20 2.27.0