the ephemeral flag helps support migration with PCI-passthrough.
An ephemeral hostdev is automatically unplugged before migration
and replugged (if one is available on the destination) after
migration.

Signed-off-by: Chen Fan <chen.fan.f...@cn.fujitsu.com>
---
 docs/schemas/domaincommon.rng                      | 10 ++++++++++
 docs/schemas/network.rng                           |  5 +++++
 src/conf/domain_conf.c                             | 14 +++++++++++++-
 src/conf/domain_conf.h                             |  1 +
 src/conf/network_conf.c                            | 13 +++++++++++++
 src/conf/network_conf.h                            |  1 +
 src/network/bridge_driver.c                        |  1 +
 src/qemu/qemu_command.c                            |  1 +
 tests/networkxml2xmlin/hostdev-pf.xml              |  2 +-
 tests/networkxml2xmlin/hostdev.xml                 |  2 +-
 tests/networkxml2xmlout/hostdev-pf.xml             |  2 +-
 tests/networkxml2xmlout/hostdev.xml                |  2 +-
 .../qemuxml2argv-controller-order.xml              |  2 +-
 .../qemuxml2argv-hostdev-pci-address-device.xml    |  2 +-
 .../qemuxml2argv-hostdev-pci-address.xml           |  2 +-
 .../qemuxml2argv-hostdev-scsi-autogen-address.xml  | 22 +++++++++++-----------
 .../qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml   |  4 ++--
 .../qemuxml2argv-hostdev-scsi-lsi-iscsi.xml        |  4 ++--
 .../qemuxml2argv-hostdev-scsi-lsi.xml              |  2 +-
 .../qemuxml2argv-hostdev-scsi-rawio.xml            |  2 +-
 .../qemuxml2argv-hostdev-scsi-readonly.xml         |  2 +-
 .../qemuxml2argv-hostdev-scsi-sgio.xml             |  2 +-
 .../qemuxml2argv-hostdev-scsi-shareable.xml        |  2 +-
 ...qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml |  4 ++--
 .../qemuxml2argv-hostdev-scsi-virtio-iscsi.xml     |  4 ++--
 .../qemuxml2argv-hostdev-scsi-virtio-scsi.xml      |  2 +-
 ...emuxml2argv-hostdev-usb-address-device-boot.xml |  2 +-
 .../qemuxml2argv-hostdev-usb-address-device.xml    |  2 +-
 .../qemuxml2argv-hostdev-usb-address.xml           |  2 +-
 .../qemuxml2argv-hostdev-vfio-multidomain.xml      |  2 +-
 .../qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml |  2 +-
 .../qemuxml2argv-net-hostdev-multidomain.xml       |  2 +-
 .../qemuxml2argv-net-hostdev-vfio-multidomain.xml  |  2 +-
 .../qemuxml2argv-net-hostdev-vfio.xml              |  2 +-
 .../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml  |  2 +-
 tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml    |  4 ++--
 ...qemuxml2xmlout-hostdev-scsi-autogen-address.xml | 22 +++++++++++-----------
 37 files changed, 99 insertions(+), 55 deletions(-)

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index b1d883f..6f4551c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -2261,6 +2261,11 @@
               <ref name="virYesNo"/>
             </attribute>
           </optional>
+          <optional>
+            <attribute name="ephemeral">
+              <ref name="virYesNo"/>
+            </attribute>
+          </optional>
           <interleave>
             <element name="source">
               <optional>
@@ -3717,6 +3722,11 @@
         <ref name="virYesNo"/>
       </attribute>
     </optional>
+    <optional>
+      <attribute name="ephemeral">
+        <ref name="virYesNo"/>
+      </attribute>
+    </optional>
     <choice>
       <ref name="hostdevsubsyspci"/>
       <ref name="hostdevsubsysusb"/>
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 4edb6eb..d63b066 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -115,6 +115,11 @@
                 <ref name="virYesNo"/>
               </attribute>
             </optional>
+            <optional>
+              <attribute name="ephemeral">
+                <ref name="virYesNo"/>
+              </attribute>
+            </optional>
             <interleave>
               <choice>
                 <group>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3d05844..a1a0602 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4823,6 +4823,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
 {
     xmlNodePtr sourcenode;
     char *managed = NULL;
+    char *ephemeral = NULL;
     char *sgio = NULL;
     char *rawio = NULL;
     char *backendStr = NULL;
@@ -4841,6 +4842,11 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
             def->managed = true;
     }
 
+    if ((ephemeral = virXMLPropString(node, "ephemeral")) != NULL) {
+        if (STREQ(ephemeral, "yes"))
+            def->ephemeral = true;
+    }
+
     sgio = virXMLPropString(node, "sgio");
     rawio = virXMLPropString(node, "rawio");
 
@@ -18064,8 +18070,10 @@ virDomainActualNetDefFormat(virBufferPtr buf,
     virBufferAsprintf(buf, "<actual type='%s'", typeStr);
     if (type == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
         virDomainHostdevDefPtr hostdef = virDomainNetGetActualHostdev(def);
-        if  (hostdef && hostdef->managed)
+        if (hostdef && hostdef->managed)
             virBufferAddLit(buf, " managed='yes'");
+        if (hostdef && hostdef->ephemeral)
+            virBufferAddLit(buf, " ephemeral='yes'");
     }
     if (def->trustGuestRxFilters)
         virBufferAsprintf(buf, " trustGuestRxFilters='%s'",
@@ -18236,6 +18244,8 @@ virDomainNetDefFormat(virBufferPtr buf,
     virBufferAsprintf(buf, "<interface type='%s'", typeStr);
     if (hostdef && hostdef->managed)
         virBufferAddLit(buf, " managed='yes'");
+    if (hostdef && hostdef->ephemeral)
+        virBufferAddLit(buf, " ephemeral='yes'");
     if (def->trustGuestRxFilters)
         virBufferAsprintf(buf, " trustGuestRxFilters='%s'",
                           
virTristateBoolTypeToString(def->trustGuestRxFilters));
@@ -19562,6 +19572,8 @@ virDomainHostdevDefFormat(virBufferPtr buf,
     if (def->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
         virBufferAsprintf(buf, " managed='%s'",
                           def->managed ? "yes" : "no");
+        virBufferAsprintf(buf, " ephemeral='%s'",
+                          def->ephemeral ? "yes" : "no");
 
         if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI &&
             scsisrc->sgio)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index f36315b..0d64add 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -519,6 +519,7 @@ struct _virDomainHostdevDef {
     bool missing;
     bool readonly;
     bool shareable;
+    bool ephemeral;
     union {
         virDomainHostdevSubsys subsys;
         virDomainHostdevCaps caps;
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index d7c5dec..7107bb5 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1710,6 +1710,7 @@ virNetworkForwardDefParseXML(const char *networkName,
     int nForwardIfs, nForwardAddrs, nForwardPfs, nForwardNats;
     char *forwardDev = NULL;
     char *forwardManaged = NULL;
+    char *forwardEphemeral = NULL;
     char *forwardDriverName = NULL;
     char *type = NULL;
     xmlNodePtr save = ctxt->node;
@@ -1733,6 +1734,12 @@ virNetworkForwardDefParseXML(const char *networkName,
         def->managed = true;
     }
 
+    forwardEphemeral = virXPathString("string(./@ephemeral)", ctxt);
+    if (forwardEphemeral != NULL &&
+        STRCASEEQ(forwardEphemeral, "yes")) {
+        def->ephemeral = true;
+    }
+
     forwardDriverName = virXPathString("string(./driver/@name)", ctxt);
     if (forwardDriverName) {
         int driverName
@@ -2631,6 +2638,12 @@ virNetworkDefFormatBuf(virBufferPtr buf,
             else
                 virBufferAddLit(buf, " managed='no'");
         }
+        if (def->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) {
+            if (def->forward.ephemeral)
+                virBufferAddLit(buf, " ephemeral='yes'");
+            else
+                virBufferAddLit(buf, " ephemeral='no'");
+        }
         shortforward = !(def->forward.nifs || def->forward.npfs
                          || VIR_SOCKET_ADDR_VALID(&def->forward.addr.start)
                          || VIR_SOCKET_ADDR_VALID(&def->forward.addr.end)
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 3e926f7..29aa4f6 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -188,6 +188,7 @@ typedef virNetworkForwardDef *virNetworkForwardDefPtr;
 struct _virNetworkForwardDef {
     int type;     /* One of virNetworkForwardType constants */
     bool managed;  /* managed attribute for hostdev mode */
+    bool ephemeral; /* ephemeral attribute for hostdev mode */
     int driverName; /* enum virNetworkForwardDriverNameType */
 
     /* If there are multiple forward devices (i.e. a pool of
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 13e1717..eb4838f 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3903,6 +3903,7 @@ networkAllocateActualDevice(virDomainDefPtr dom,
         iface->data.network.actual->data.hostdev.def.info = &iface->info;
         iface->data.network.actual->data.hostdev.def.mode = 
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
         iface->data.network.actual->data.hostdev.def.managed = 
netdef->forward.managed ? 1 : 0;
+        iface->data.network.actual->data.hostdev.def.ephemeral = 
netdef->forward.ephemeral ? 1 : 0;
         iface->data.network.actual->data.hostdev.def.source.subsys.type = 
dev->type;
         iface->data.network.actual->data.hostdev.def.source.subsys.u.pci.addr 
= dev->device.pci;
 
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5303de5..fc81214 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -11493,6 +11493,7 @@ qemuParseCommandLinePCI(const char *val)
 
     def->mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
     def->managed = true;
+    def->ephemeral = true;
     def->source.subsys.type = VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI;
     def->source.subsys.u.pci.addr.bus = bus;
     def->source.subsys.u.pci.addr.slot = slot;
diff --git a/tests/networkxml2xmlin/hostdev-pf.xml 
b/tests/networkxml2xmlin/hostdev-pf.xml
index 5b8f598..cfb0f7c 100644
--- a/tests/networkxml2xmlin/hostdev-pf.xml
+++ b/tests/networkxml2xmlin/hostdev-pf.xml
@@ -1,7 +1,7 @@
 <network>
   <name>hostdev</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
-  <forward mode='hostdev' managed='yes'>
+  <forward mode='hostdev' managed='yes' ephemeral='yes'>
     <driver name='vfio'/>
     <pf dev='eth2'/>
   </forward>
diff --git a/tests/networkxml2xmlin/hostdev.xml 
b/tests/networkxml2xmlin/hostdev.xml
index 03f1411..406c2df 100644
--- a/tests/networkxml2xmlin/hostdev.xml
+++ b/tests/networkxml2xmlin/hostdev.xml
@@ -1,7 +1,7 @@
 <network>
   <name>hostdev</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
-  <forward mode='hostdev' managed='yes'>
+  <forward mode='hostdev' managed='yes' ephemeral='yes'>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x2'/>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x3'/>
diff --git a/tests/networkxml2xmlout/hostdev-pf.xml 
b/tests/networkxml2xmlout/hostdev-pf.xml
index 5b8f598..cfb0f7c 100644
--- a/tests/networkxml2xmlout/hostdev-pf.xml
+++ b/tests/networkxml2xmlout/hostdev-pf.xml
@@ -1,7 +1,7 @@
 <network>
   <name>hostdev</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
-  <forward mode='hostdev' managed='yes'>
+  <forward mode='hostdev' managed='yes' ephemeral='yes'>
     <driver name='vfio'/>
     <pf dev='eth2'/>
   </forward>
diff --git a/tests/networkxml2xmlout/hostdev.xml 
b/tests/networkxml2xmlout/hostdev.xml
index 03f1411..406c2df 100644
--- a/tests/networkxml2xmlout/hostdev.xml
+++ b/tests/networkxml2xmlout/hostdev.xml
@@ -1,7 +1,7 @@
 <network>
   <name>hostdev</name>
   <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9b</uuid>
-  <forward mode='hostdev' managed='yes'>
+  <forward mode='hostdev' managed='yes' ephemeral='yes'>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x2'/>
     <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x3'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml
index 07db77e..b492d9e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml
@@ -76,7 +76,7 @@
       <model type='cirrus' vram='16384' heads='1'/>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
     </video>
-    <hostdev mode='subsystem' type='usb' managed='yes'>
+    <hostdev mode='subsystem' type='usb' managed='yes' ephemeral='no'>
       <source>
         <address bus='14' device='6'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.xml
index b29ef58..98b2ced 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.xml
@@ -18,7 +18,7 @@
       <source dev='/dev/HostVG/QEMUGuest2'/>
       <target dev='hda' bus='ide'/>
     </disk>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='yes'>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
index b9b5c14..2b9d722 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='yes'>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
       </source>
diff --git 
a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-autogen-address.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-autogen-address.xml
index 21f112b..cd2c2ca 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-autogen-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-autogen-address.xml
@@ -23,68 +23,68 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host1'/>
         <address bus='0' target='0' unit='1'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host2'/>
         <address bus='0' target='0' unit='2'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host3'/>
         <address bus='0' target='0' unit='3'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host4'/>
         <address bus='0' target='0' unit='4'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host5'/>
         <address bus='0' target='0' unit='5'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host6'/>
         <address bus='0' target='0' unit='6'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host7'/>
         <address bus='0' target='0' unit='7'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host8'/>
         <address bus='0' target='0' unit='8'/>
       </source>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host9'/>
         <address bus='0' target='0' unit='9'/>
       </source>
       <address type='drive' controller='1' bus='0' target='0' unit='5'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host10'/>
         <address bus='0' target='0' unit='10'/>
diff --git 
a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
index 3bfded4..0d9126e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example'>
         <host name='example.org' port='3260'/>
         <auth username='myname'>
@@ -32,7 +32,7 @@
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='4'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
         <host name='example.org' port='3260'/>
         <auth username='myname'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.xml
index 8a05099..1de1796 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi-iscsi.xml
@@ -23,13 +23,13 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example'>
         <host name='example.org' port='3260'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='4'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
         <host name='example.org' port='3260'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.xml
index 98c469c..d5b03f6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
index 69fdde3..40efa63 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-rawio.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered' 
rawio='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no' 
sgio='unfiltered' rawio='yes'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.xml
index 359bb95..ab56fb9 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
index 21404ee..cfacc6e 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes' sgio='unfiltered'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no' 
sgio='unfiltered'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
index f9ce8af..bff49ba 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git 
a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
index d4dba4a..e5bc3d2 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example'>
         <host name='example.org' port='3260'/>
         <auth username='myname'>
@@ -32,7 +32,7 @@
       </source>
       <address type='drive' controller='0' bus='0' target='2' unit='4'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
         <host name='example.org' port='3260'/>
         <auth username='myname'>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.xml
index 13c0930..c1c3581 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-iscsi.xml
@@ -23,13 +23,13 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example'>
         <host name='example.org' port='3260'/>
       </source>
       <address type='drive' controller='0' bus='0' target='2' unit='4'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source protocol='iscsi' name='iqn.1992-01.com.example/1'>
         <host name='example.org' port='3260'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.xml
index 5a263e7..a8a1dbd 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
diff --git 
a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.xml
index c11a963..ce393df 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device-boot.xml
@@ -17,7 +17,7 @@
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='hda' bus='ide'/>
     </disk>
-    <hostdev mode='subsystem' type='usb' managed='no'>
+    <hostdev mode='subsystem' type='usb' managed='no' ephemeral='no'>
       <source>
         <address bus='14' device='6'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.xml
index c5992ef..f3319cc 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.xml
@@ -18,7 +18,7 @@
       <source dev='/dev/HostVG/QEMUGuest1'/>
       <target dev='hda' bus='ide'/>
     </disk>
-    <hostdev mode='subsystem' type='usb' managed='no'>
+    <hostdev mode='subsystem' type='usb' managed='no' ephemeral='no'>
       <source>
         <address bus='14' device='6'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
index 5807eff..c48a977 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address.xml
@@ -23,7 +23,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='usb' managed='no'>
+    <hostdev mode='subsystem' type='usb' managed='no' ephemeral='no'>
       <source>
         <address bus='14' device='6'/>
       </source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.xml
index efbff38..1b29ded 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio-multidomain.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='yes'>
       <driver name='vfio'/>
       <source>
         <address domain='0x55aa' bus='32' slot='15' function='3'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml
index 8daa53a..7e6748b 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hostdev-vfio.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='yes'>
       <driver name='vfio'/>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.xml
index 14b9515..fa07462 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-multidomain.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <interface type='hostdev' managed='yes'>
+    <interface type='hostdev' managed='yes' ephemeral='yes'>
       <mac address='00:11:22:33:44:55'/>
       <source>
         <address type='pci' domain='0x2424' bus='0x21' slot='0x1c' 
function='0x6'/>
diff --git 
a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.xml
index 5e834ad..fe71993 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio-multidomain.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <interface type='hostdev' managed='yes'>
+    <interface type='hostdev' managed='yes' ephemeral='yes'>
       <mac address='00:11:22:33:44:55'/>
       <driver name='vfio'/>
       <source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.xml
index b4f5e72..e0ff4a6 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev-vfio.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <interface type='hostdev' managed='yes'>
+    <interface type='hostdev' managed='yes' ephemeral='yes'>
       <mac address='00:11:22:33:44:55'/>
       <driver name='vfio'/>
       <source>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
index f88eefc..b851944 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-net-hostdev.xml
@@ -22,7 +22,7 @@
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
-    <interface type='hostdev' managed='yes'>
+    <interface type='hostdev' managed='yes' ephemeral='yes'>
       <mac address='00:11:22:33:44:55'/>
       <source>
         <address type='pci' domain='0x0000' bus='0x03' slot='0x07' 
function='0x1'/>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
index a5e59b2..f0de8fb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-rom.xml
@@ -32,13 +32,13 @@
       <model type='virtio'/>
       <rom file='/etc/fake/bootrom.bin'/>
     </interface>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='no'>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x5'/>
       </source>
       <rom bar='off'/>
     </hostdev>
-    <hostdev mode='subsystem' type='pci' managed='yes'>
+    <hostdev mode='subsystem' type='pci' managed='yes' ephemeral='no'>
       <source>
         <address domain='0x0000' bus='0x06' slot='0x12' function='0x6'/>
       </source>
diff --git 
a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml 
b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml
index e416654..a11eb2e 100644
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-scsi-autogen-address.xml
@@ -24,77 +24,77 @@
     <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
     <controller type='scsi' index='1'/>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host0'/>
         <address bus='0' target='0' unit='0'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host1'/>
         <address bus='0' target='0' unit='1'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host2'/>
         <address bus='0' target='0' unit='2'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='2'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host3'/>
         <address bus='0' target='0' unit='3'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='3'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host4'/>
         <address bus='0' target='0' unit='4'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='4'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host5'/>
         <address bus='0' target='0' unit='5'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='5'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host6'/>
         <address bus='0' target='0' unit='6'/>
       </source>
       <address type='drive' controller='0' bus='0' target='0' unit='6'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host7'/>
         <address bus='0' target='0' unit='7'/>
       </source>
       <address type='drive' controller='1' bus='0' target='0' unit='0'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host8'/>
         <address bus='0' target='0' unit='8'/>
       </source>
       <address type='drive' controller='1' bus='0' target='0' unit='1'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host9'/>
         <address bus='0' target='0' unit='9'/>
       </source>
       <address type='drive' controller='1' bus='0' target='0' unit='5'/>
     </hostdev>
-    <hostdev mode='subsystem' type='scsi' managed='yes'>
+    <hostdev mode='subsystem' type='scsi' managed='yes' ephemeral='no'>
       <source>
         <adapter name='scsi_host10'/>
         <address bus='0' target='0' unit='10'/>
-- 
1.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to