[libvirt] [PATCH] replace 'if' type conditions with 'switch' for VIR_NETWORK_FORWARD_*

2018-07-19 Thread Shi Lei
Hi, everyone!
For VIR_NETWORK_FORWARD_*, I try to replace 'if' type conditions
with typed 'switch()'.
It might be more clear.

Signed-off-by: Shi Lei 

---
 src/conf/domain_conf.c   |  46 +-
 src/conf/network_conf.c  |  49 ++-
 src/conf/virnetworkobj.c |  15 ++--
 src/esx/esx_network_driver.c |   8 +-
 src/network/bridge_driver.c  | 203 +++
 5 files changed, 178 insertions(+), 143 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 178c6d2..c02543f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -29975,40 +29975,44 @@ virDomainNetResolveActualType(virDomainNetDefPtr 
iface)
 if (!(def = virNetworkDefParseString(xml)))
 goto cleanup;
 
-if ((def->forward.type == VIR_NETWORK_FORWARD_NONE) ||
-(def->forward.type == VIR_NETWORK_FORWARD_NAT) ||
-(def->forward.type == VIR_NETWORK_FORWARD_ROUTE) ||
-(def->forward.type == VIR_NETWORK_FORWARD_OPEN)) {
+switch (def->forward.type) {
+case VIR_NETWORK_FORWARD_NONE:
+case VIR_NETWORK_FORWARD_NAT:
+case VIR_NETWORK_FORWARD_ROUTE:
+case VIR_NETWORK_FORWARD_OPEN:
 /* for these forward types, the actual net type really *is*
  * NETWORK; we just keep the info from the portgroup in
  * iface->data.network.actual
  */
 ret = VIR_DOMAIN_NET_TYPE_NETWORK;
+break;
 
-} else if ((def->forward.type == VIR_NETWORK_FORWARD_BRIDGE) &&
-   def->bridge) {
-
-/*  
- * is VIR_DOMAIN_NET_TYPE_BRIDGE
- */
-
-ret = VIR_DOMAIN_NET_TYPE_BRIDGE;
-
-} else if (def->forward.type == VIR_NETWORK_FORWARD_HOSTDEV) {
-
+case VIR_NETWORK_FORWARD_HOSTDEV:
 ret = VIR_DOMAIN_NET_TYPE_HOSTDEV;
+break;
+
+case VIR_NETWORK_FORWARD_BRIDGE:
+if (def->bridge) {
+/*  
+ * is VIR_DOMAIN_NET_TYPE_BRIDGE
+ */
+ret = VIR_DOMAIN_NET_TYPE_BRIDGE;
+break;
+}
 
-} else if ((def->forward.type == VIR_NETWORK_FORWARD_BRIDGE) ||
-   (def->forward.type == VIR_NETWORK_FORWARD_PRIVATE) ||
-   (def->forward.type == VIR_NETWORK_FORWARD_VEPA) ||
-   (def->forward.type == VIR_NETWORK_FORWARD_PASSTHROUGH)) {
+/* intentionally fall through to the direct case for
+ * VIR_NETWORK_FORWARD_BRIDGE with no bridge device defined
+ */
+ATTRIBUTE_FALLTHROUGH;
 
+case VIR_NETWORK_FORWARD_PRIVATE:
+case VIR_NETWORK_FORWARD_VEPA:
+case VIR_NETWORK_FORWARD_PASSTHROUGH:
 /*  are all
  * VIR_DOMAIN_NET_TYPE_DIRECT.
  */
-
 ret = VIR_DOMAIN_NET_TYPE_DIRECT;
-
+break;
 }
 
  cleanup:
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 630a87f..bafc1d3 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1959,17 +1959,22 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
 
 VIR_FREE(stp);
 
-if (def->mtu &&
-(def->forward.type != VIR_NETWORK_FORWARD_NONE &&
- def->forward.type != VIR_NETWORK_FORWARD_NAT &&
- def->forward.type != VIR_NETWORK_FORWARD_ROUTE &&
- def->forward.type != VIR_NETWORK_FORWARD_OPEN)) {
-virReportError(VIR_ERR_XML_ERROR,
-   _("mtu size only allowed in open, route, nat, "
- "and isolated mode, not in %s (network '%s')"),
-   virNetworkForwardTypeToString(def->forward.type),
-   def->name);
-goto error;
+if (def->mtu) {
+switch (def->forward.type) {
+case VIR_NETWORK_FORWARD_NONE:
+case VIR_NETWORK_FORWARD_NAT:
+case VIR_NETWORK_FORWARD_ROUTE:
+case VIR_NETWORK_FORWARD_OPEN:
+break;
+
+default:
+virReportError(VIR_ERR_XML_ERROR,
+   _("mtu size only allowed in open, route, nat, "
+ "and isolated mode, not in %s (network '%s')"),
+   virNetworkForwardTypeToString(def->forward.type),
+   def->name);
+goto error;
+}
 }
 
 /* Extract custom metadata */
@@ -2349,6 +2354,7 @@ virNetworkDefFormatBuf(virBufferPtr buf,
 char uuidstr[VIR_UUID_STRING_BUFLEN];
 size_t i;
 bool shortforward;
+bool hasbridge = false;
 
 virBufferAddLit(buf, "connections > 0))
@@ -2469,22 +2475,21 @@ virNetworkDefFormatBuf(virBufferPtr buf,
 virBufferAddLit(buf, "\n");
 }
 
+switch (def->forward.type) {
+case VIR_NETWORK_FORWARD_NONE:
+case VIR_NETWORK_FORWARD_NAT:
+case VIR_NETWORK_FORWARD_ROUTE:
+case VIR_NETWORK_FORWARD_OPEN:
+hasbridge = true;
+break;
+}
 
-if (def->forward.type == VIR_NETWORK_FORWARD_NONE ||
-def->forward.type == VIR_NETWORK_FORWARD_NAT ||
-def->forward.type == 

[libvirt] [PATCH v2 0/4] New mdev type handling for aggregated resources

2018-07-19 Thread Zhenyu Wang
Current mdev device create interface depends on fixed mdev type, which get uuid
from user to create instance of mdev device. If user wants to use customized
number of resource for mdev device, then only can create new mdev type for that
which may not be flexible. This requirement comes not only from to be able to
allocate flexible resources for KVMGT, but also from Intel scalable IO
virtualization which would use vfio/mdev to be able to allocate arbitrary
resources on mdev instance. More info on [1] [2] [3].

To allow to create user defined resources for mdev, it trys to extend mdev
create interface by adding new "instances=xxx" parameter following uuid, for
target mdev type if aggregation is supported, it can create new mdev device
which contains resources combined by number of instances, e.g

echo ",instances=10" > create

VM manager e.g libvirt can check mdev type with "aggregation" attribute which
can support this setting. If no "aggregation" attribute found for mdev type,
previous behavior is still kept for one instance allocation. And new sysfs
attribute "instances" is created for each mdev device to show allocated number.

This trys to create new KVMGT type with minimal vGPU resources which can be
combined with "instances=x" setting to allocate for user wanted resources.

References:
[1] 
https://software.intel.com/en-us/download/intel-virtualization-technology-for-directed-io-architecture-specification
[2] 
https://software.intel.com/en-us/download/intel-scalable-io-virtualization-technical-specification
[3] https://schd.ws/hosted_files/lc32018/00/LC3-SIOV-final.pdf  

v2:
  - Add new create_with_instances driver hook
  - Update doc for new attributes

Zhenyu Wang (4):
  vfio/mdev: Add new instances parameter for mdev create
  vfio/mdev: Add mdev device instances attribute
  drm/i915/gvt: Add new aggregation type support
  Documentation/vfio-mediated-device.txt: update for aggregation
attribute

 Documentation/vfio-mediated-device.txt | 39 +++---
 drivers/gpu/drm/i915/gvt/gvt.c | 26 +---
 drivers/gpu/drm/i915/gvt/gvt.h | 14 ---
 drivers/gpu/drm/i915/gvt/kvmgt.c   | 30 +++---
 drivers/gpu/drm/i915/gvt/vgpu.c| 56 ++
 drivers/vfio/mdev/mdev_core.c  | 19 +++--
 drivers/vfio/mdev/mdev_private.h   |  6 ++-
 drivers/vfio/mdev/mdev_sysfs.c | 42 ---
 include/linux/mdev.h   | 10 +
 9 files changed, 203 insertions(+), 39 deletions(-)

-- 
2.18.0

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


[libvirt] [PATCH v2 2/4] vfio/mdev: Add mdev device instances attribute

2018-07-19 Thread Zhenyu Wang
For mdev device, create new sysfs attribute "instances" to show
number of instances allocated for possible aggregation type.
For compatibility default or without aggregated allocation, the
number is 1.

Cc: Kirti Wankhede 
Cc: Alex Williamson 
Cc: Kevin Tian 
Signed-off-by: Zhenyu Wang 
---
 drivers/vfio/mdev/mdev_core.c| 1 +
 drivers/vfio/mdev/mdev_private.h | 1 +
 drivers/vfio/mdev/mdev_sysfs.c   | 8 
 3 files changed, 10 insertions(+)

diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
index e69db302a4f2..f0478fc372d8 100644
--- a/drivers/vfio/mdev/mdev_core.c
+++ b/drivers/vfio/mdev/mdev_core.c
@@ -326,6 +326,7 @@ int mdev_device_create(struct kobject *kobj, struct device 
*dev, uuid_le uuid,
mdev->dev.bus = _bus_type;
mdev->dev.release = mdev_device_release;
dev_set_name(>dev, "%pUl", uuid.b);
+   mdev->type_instances = instances;
 
ret = device_register(>dev);
if (ret) {
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h
index c9d3fe04e273..aa0b4b64c503 100644
--- a/drivers/vfio/mdev/mdev_private.h
+++ b/drivers/vfio/mdev/mdev_private.h
@@ -33,6 +33,7 @@ struct mdev_device {
struct kref ref;
struct list_head next;
struct kobject *type_kobj;
+   unsigned int type_instances;
bool active;
 };
 
diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
index a06e5b7c69d3..5a417a20e774 100644
--- a/drivers/vfio/mdev/mdev_sysfs.c
+++ b/drivers/vfio/mdev/mdev_sysfs.c
@@ -268,10 +268,18 @@ static ssize_t remove_store(struct device *dev, struct 
device_attribute *attr,
return count;
 }
 
+static ssize_t instances_show(struct device *dev, struct device_attribute 
*attr, char *buf)
+{
+   struct mdev_device *mdev = to_mdev_device(dev);
+   return sprintf(buf, "%u\n", mdev->type_instances);
+}
+
 static DEVICE_ATTR_WO(remove);
+static DEVICE_ATTR_RO(instances);
 
 static const struct attribute *mdev_device_attrs[] = {
_attr_remove.attr,
+   _attr_instances.attr,
NULL,
 };
 
-- 
2.18.0

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


[libvirt] [PATCH v2 3/4] drm/i915/gvt: Add new aggregation type support

2018-07-19 Thread Zhenyu Wang
New aggregation type is created for KVMGT which can be used
with new mdev create "instances=xxx" parameter to combine
minimal resource number for target instances, which can create
user defined number of resources. For KVMGT, aggregated resource
is determined by memory and fence resource allocation for target
number of instances.

Cc: Kirti Wankhede 
Cc: Alex Williamson 
Cc: Kevin Tian 
Signed-off-by: Zhenyu Wang 
---
 drivers/gpu/drm/i915/gvt/gvt.c   | 26 ---
 drivers/gpu/drm/i915/gvt/gvt.h   | 14 +---
 drivers/gpu/drm/i915/gvt/kvmgt.c | 30 ++---
 drivers/gpu/drm/i915/gvt/vgpu.c  | 56 
 4 files changed, 104 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
index 712f9d14e720..21600447b029 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.c
+++ b/drivers/gpu/drm/i915/gvt/gvt.c
@@ -57,7 +57,7 @@ static struct intel_vgpu_type 
*intel_gvt_find_vgpu_type(struct intel_gvt *gvt,
for (i = 0; i < gvt->num_types; i++) {
t = >types[i];
if (!strncmp(t->name, name + strlen(driver_name) + 1,
-   sizeof(t->name)))
+   strlen(t->name)))
return t;
}
 
@@ -105,9 +105,16 @@ static ssize_t description_show(struct kobject *kobj, 
struct device *dev,
   type->weight);
 }
 
+static ssize_t aggregation_show(struct kobject *kobj, struct device *dev,
+   char *buf)
+{
+   return sprintf(buf, "%s\n", "true");
+}
+
 static MDEV_TYPE_ATTR_RO(available_instances);
 static MDEV_TYPE_ATTR_RO(device_api);
 static MDEV_TYPE_ATTR_RO(description);
+static MDEV_TYPE_ATTR_RO(aggregation);
 
 static struct attribute *gvt_type_attrs[] = {
_type_attr_available_instances.attr,
@@ -116,14 +123,20 @@ static struct attribute *gvt_type_attrs[] = {
NULL,
 };
 
+static struct attribute *gvt_type_aggregate_attrs[] = {
+   _type_attr_available_instances.attr,
+   _type_attr_device_api.attr,
+   _type_attr_description.attr,
+   _type_attr_aggregation.attr,
+   NULL,
+};
+
 static struct attribute_group *gvt_vgpu_type_groups[] = {
[0 ... NR_MAX_INTEL_VGPU_TYPES - 1] = NULL,
 };
 
-static bool intel_get_gvt_attrs(struct attribute ***type_attrs,
-   struct attribute_group ***intel_vgpu_type_groups)
+static bool intel_get_gvt_attrs(struct attribute_group 
***intel_vgpu_type_groups)
 {
-   *type_attrs = gvt_type_attrs;
*intel_vgpu_type_groups = gvt_vgpu_type_groups;
return true;
 }
@@ -142,7 +155,10 @@ static bool intel_gvt_init_vgpu_type_groups(struct 
intel_gvt *gvt)
goto unwind;
 
group->name = type->name;
-   group->attrs = gvt_type_attrs;
+   if (type->aggregation)
+   group->attrs = gvt_type_aggregate_attrs;
+   else
+   group->attrs = gvt_type_attrs;
gvt_vgpu_type_groups[i] = group;
}
 
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 9a9671522774..8848587f638f 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -241,6 +241,9 @@ struct intel_vgpu {
 struct intel_gvt_gm {
unsigned long vgpu_allocated_low_gm_size;
unsigned long vgpu_allocated_high_gm_size;
+   unsigned long low_avail;
+   unsigned long high_avail;
+   unsigned long fence_avail;
 };
 
 struct intel_gvt_fence {
@@ -292,13 +295,14 @@ struct intel_gvt_firmware {
 
 #define NR_MAX_INTEL_VGPU_TYPES 20
 struct intel_vgpu_type {
-   char name[16];
+   char name[32];
unsigned int avail_instance;
unsigned int low_gm_size;
unsigned int high_gm_size;
unsigned int fence;
unsigned int weight;
enum intel_vgpu_edid resolution;
+   bool aggregation;  /* fine-grained resource type with aggregation 
capability */
 };
 
 struct intel_gvt {
@@ -484,7 +488,8 @@ void intel_gvt_clean_vgpu_types(struct intel_gvt *gvt);
 struct intel_vgpu *intel_gvt_create_idle_vgpu(struct intel_gvt *gvt);
 void intel_gvt_destroy_idle_vgpu(struct intel_vgpu *vgpu);
 struct intel_vgpu *intel_gvt_create_vgpu(struct intel_gvt *gvt,
-struct intel_vgpu_type *type);
+struct intel_vgpu_type *type,
+unsigned int);
 void intel_gvt_destroy_vgpu(struct intel_vgpu *vgpu);
 void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr,
 unsigned int engine_mask);
@@ -562,15 +567,14 @@ struct intel_gvt_ops {
int (*emulate_mmio_write)(struct intel_vgpu *, u64, void *,
unsigned int);
struct intel_vgpu *(*vgpu_create)(struct intel_gvt *,
-   struct intel_vgpu_type *);
+

[libvirt] [PATCH v2 1/4] vfio/mdev: Add new instances parameter for mdev create

2018-07-19 Thread Zhenyu Wang
For special mdev type which can aggregate instances for mdev device,
this extends mdev create interface by allowing extra "instances=xxx"
parameter, which is passed to mdev device model to be able to create
arbitrary bundled number of instances for target mdev device.

v2: create new create_with_instances operator for vendor driver

Cc: Kirti Wankhede 
Cc: Alex Williamson 
Cc: Kevin Tian 
Signed-off-by: Zhenyu Wang 
---
 drivers/vfio/mdev/mdev_core.c| 18 +
 drivers/vfio/mdev/mdev_private.h |  5 -
 drivers/vfio/mdev/mdev_sysfs.c   | 34 ++--
 include/linux/mdev.h | 10 ++
 4 files changed, 56 insertions(+), 11 deletions(-)

diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c
index 0212f0ee8aea..e69db302a4f2 100644
--- a/drivers/vfio/mdev/mdev_core.c
+++ b/drivers/vfio/mdev/mdev_core.c
@@ -104,12 +104,16 @@ static inline void mdev_put_parent(struct mdev_parent 
*parent)
 }
 
 static int mdev_device_create_ops(struct kobject *kobj,
- struct mdev_device *mdev)
+ struct mdev_device *mdev,
+ unsigned int instances)
 {
struct mdev_parent *parent = mdev->parent;
int ret;
 
-   ret = parent->ops->create(kobj, mdev);
+   if (instances > 1)
+   ret = parent->ops->create_with_instances(kobj, mdev, instances);
+   else
+   ret = parent->ops->create(kobj, mdev);
if (ret)
return ret;
 
@@ -276,7 +280,8 @@ static void mdev_device_release(struct device *dev)
kfree(mdev);
 }
 
-int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid)
+int mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid,
+  unsigned int instances)
 {
int ret;
struct mdev_device *mdev, *tmp;
@@ -287,6 +292,11 @@ int mdev_device_create(struct kobject *kobj, struct device 
*dev, uuid_le uuid)
if (!parent)
return -EINVAL;
 
+   if (instances > 1 && !parent->ops->create_with_instances) {
+   ret = -EINVAL;
+   goto mdev_fail;
+   }
+
mutex_lock(_list_lock);
 
/* Check for duplicate */
@@ -323,7 +333,7 @@ int mdev_device_create(struct kobject *kobj, struct device 
*dev, uuid_le uuid)
goto mdev_fail;
}
 
-   ret = mdev_device_create_ops(kobj, mdev);
+   ret = mdev_device_create_ops(kobj, mdev, instances);
if (ret)
goto create_fail;
 
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev/mdev_private.h
index b5819b7d7ef7..c9d3fe04e273 100644
--- a/drivers/vfio/mdev/mdev_private.h
+++ b/drivers/vfio/mdev/mdev_private.h
@@ -52,13 +52,16 @@ struct mdev_type {
 #define to_mdev_type(_kobj)\
container_of(_kobj, struct mdev_type, kobj)
 
+#define MDEV_CREATE_OPT_LEN 32
+
 int  parent_create_sysfs_files(struct mdev_parent *parent);
 void parent_remove_sysfs_files(struct mdev_parent *parent);
 
 int  mdev_create_sysfs_files(struct device *dev, struct mdev_type *type);
 void mdev_remove_sysfs_files(struct device *dev, struct mdev_type *type);
 
-int  mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le 
uuid);
+int  mdev_device_create(struct kobject *kobj, struct device *dev, uuid_le uuid,
+   unsigned int instances);
 int  mdev_device_remove(struct device *dev, bool force_remove);
 
 #endif /* MDEV_PRIVATE_H */
diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c
index 249472f05509..a06e5b7c69d3 100644
--- a/drivers/vfio/mdev/mdev_sysfs.c
+++ b/drivers/vfio/mdev/mdev_sysfs.c
@@ -54,11 +54,15 @@ static const struct sysfs_ops mdev_type_sysfs_ops = {
 static ssize_t create_store(struct kobject *kobj, struct device *dev,
const char *buf, size_t count)
 {
-   char *str;
+   char *str, *opt = NULL;
uuid_le uuid;
int ret;
+   unsigned int instances = 1;
 
-   if ((count < UUID_STRING_LEN) || (count > UUID_STRING_LEN + 1))
+   if (count < UUID_STRING_LEN)
+   return -EINVAL;
+
+   if (count > UUID_STRING_LEN + 1 + MDEV_CREATE_OPT_LEN)
return -EINVAL;
 
str = kstrndup(buf, count, GFP_KERNEL);
@@ -66,13 +70,31 @@ static ssize_t create_store(struct kobject *kobj, struct 
device *dev,
return -ENOMEM;
 
ret = uuid_le_to_bin(str, );
-   kfree(str);
-   if (ret)
+   if (ret) {
+   kfree(str);
return ret;
+   }
 
-   ret = mdev_device_create(kobj, dev, uuid);
-   if (ret)
+   if (count > UUID_STRING_LEN + 1) {
+   opt = str + UUID_STRING_LEN;
+   if (*opt++ != ',' ||
+   strncmp(opt, "instances=", 10)) {
+   kfree(str);
+   return -EINVAL;
+   }
+   

[libvirt] [PATCH v2 4/4] Documentation/vfio-mediated-device.txt: update for aggregation attribute

2018-07-19 Thread Zhenyu Wang
Update mdev doc on new aggregration attribute and instances attribute
for mdev.

Cc: Kirti Wankhede 
Cc: Alex Williamson 
Cc: Kevin Tian 
Signed-off-by: Zhenyu Wang 
---
 Documentation/vfio-mediated-device.txt | 39 ++
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/Documentation/vfio-mediated-device.txt 
b/Documentation/vfio-mediated-device.txt
index c3f69bcaf96e..9ec9495dcbe7 100644
--- a/Documentation/vfio-mediated-device.txt
+++ b/Documentation/vfio-mediated-device.txt
@@ -211,12 +211,20 @@ Directories and files under the sysfs for Each Physical 
Device
   | |   |--- description
   | |   |--- [devices]
   | |--- []
-  |  |--- create
-  |  |--- name
-  |  |--- available_instances
-  |  |--- device_api
-  |  |--- description
-  |  |--- [devices]
+  | ||--- create
+  | ||--- name
+  | ||--- available_instances
+  | ||--- device_api
+  | ||--- description
+  | ||--- [devices]
+  | |--- []
+  | ||--- create
+  | ||--- name
+  | ||--- available_instances
+  | ||--- device_api
+  | ||--- description
+  | ||--- 
+  | ||--- [devices]
 
 * [mdev_supported_types]
 
@@ -260,6 +268,19 @@ Directories and files under the sysfs for Each Physical 
Device
   This attribute should show brief features/description of the type. This is
   optional attribute.
 
+* 
+
+  The description is to show feature for one instance of the type. 

+  is an optional attributes to show that []'s instances can be
+  aggregated to be assigned for one mdev device. Set number of instances by
+  appending "instances=N" parameter for create. Instances number can't exceed
+  available_instances number. Without "instances=N" parameter will be default
+  one instance to create.
+
+Example::
+
+   # echo ",instances=N" > create
+
 Directories and Files Under the sysfs for Each mdev Device
 --
 
@@ -268,6 +289,7 @@ Directories and Files Under the sysfs for Each mdev Device
   |- [parent phy device]
   |--- [$MDEV_UUID]
  |--- remove
+|--- instances
  |--- mdev_type {link to its type}
  |--- vendor-specific-attributes [optional]
 
@@ -281,6 +303,11 @@ Example::
 
# echo 1 > /sys/bus/mdev/devices/$mdev_UUID/remove
 
+* instances
+
+For aggregation type show number of instances assigned for this mdev. For 
normal
+type or default will just show one instance.
+
 Mediated device Hot plug
 
 
-- 
2.18.0

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


Re: [libvirt] [PATCHv4 13/15] build: switch --with-qemu default from yes to check

2018-07-19 Thread John Ferlan


On 07/18/2018 10:44 AM, Ján Tomko wrote:
> Unless explicitly requested, enable the QEMU driver
> only if the Jansson library is present.
> 
> Signed-off-by: Ján Tomko 
> ---
>  m4/virt-driver-qemu.m4 | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 

Perhaps it's obvious for someone else, but I think there some sort of
dependency missing. Starting with this patch I found that my with-qemu
"went away".

I have:

jansson.x86_64   2.11-1.fc28
@fedora


But not:

 jansson-devel x86_64 2.11-1.fc28  fedora
  15 k

If I explicitly add --with-jansson onto the command line, then I get:

checking for JANSSON... no
configure: error: You must install the jansson >= 2.5 pkg-config module
to compile libvirt
error: configure failed

If I then install jansson-devel, the build succeeds.

Honestly I think we need to be much more in your face in this instance -
something isn't quite right and it eventually leads to some really
strange results because nothing in/for qemu is built, but you are left
with old build bits in your tree.  Eventually something fails.

This whole build/config system is a generally a mystery to me, so I have
zero suggestions.  Ironically if I had to build from source, I'd know
from libvirt.spec that jansson-devel was required, although there's no
>= version check so that probably should be fixed.

Suffice to say digging into the config.log trying to figure why one's
QEMU is disabled is not an enjoyable or easy experience.

Yeah, yeah, we're developers we're supposed to be smart, we get what we
get... I'll bet some qemu devel will hit this some day and wonder how to
actually build libvirt with qemu because it's not obvious and it "used
to be" a default=yes.

John

Off to go drown the rest of my frustration ;-)

> diff --git a/m4/virt-driver-qemu.m4 b/m4/virt-driver-qemu.m4
> index 80e1d3ad46..ddb2834705 100644
> --- a/m4/virt-driver-qemu.m4
> +++ b/m4/virt-driver-qemu.m4
> @@ -18,7 +18,7 @@ dnl .
>  dnl
>  
>  AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
> -  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [yes])
> +  LIBVIRT_ARG_WITH_FEATURE([QEMU], [QEMU/KVM], [check])
>LIBVIRT_ARG_WITH([QEMU_USER], [username to run QEMU system instance as],
> ['platform dependent'])
>LIBVIRT_ARG_WITH([QEMU_GROUP], [groupname to run QEMU system instance as],
> @@ -26,6 +26,10 @@ AC_DEFUN([LIBVIRT_DRIVER_ARG_QEMU], [
>  ])
>  
>  AC_DEFUN([LIBVIRT_DRIVER_CHECK_QEMU], [
> +  AC_REQUIRE([LIBVIRT_CHECK_JANSSON])
> +  if test "$with_qemu" = "check"; then
> +with_qemu=$with_jansson
> +  fi
>if test "$with_qemu" = "yes" ; then
>  AC_DEFINE_UNQUOTED([WITH_QEMU], 1, [whether QEMU driver is enabled])
>fi
> 

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

Re: [libvirt] [PATCHv4 03/15] Switch from yajl to Jansson

2018-07-19 Thread John Ferlan


On 07/18/2018 10:44 AM, Ján Tomko wrote:
> Yajl has not seen much activity upstream recently.
> Switch to using Jansson >= 2.5.
> 
> All the platforms we target on https://libvirt.org/platforms.html
> have a version >= 2.7 listed on the sites below:
> https://repology.org/metapackage/jansson/versions
> https://build.opensuse.org/package/show/devel:libraries:c_c++/libjansson
> 
> Additionally, Ubuntu 14.04 on Travis-CI has 2.5. Set the requirement
> to 2.5 since we don't use anything from newer versions.
> 
> Implement virJSONValue{From,To}String using Jansson, delete the yajl
> code (and the related virJSONParser structure) and report an error
> if someone explicitly specifies --with-yajl.
> 
> Also adjust the test data to account for Jansson's different whitespace
> usage for empty arrays and tune up the specfile to keep 'make rpm'
> working when bisecting.
> 
> Signed-off-by: Ján Tomko 
> ---
>  src/util/virjson.c | 211 
> +
>  1 file changed, 211 insertions(+)
> 

Too late now, but git bisect and running the test suite seems to be
broken starting with this patch as I started getting "FAIL:
qemublocktest" here running a bisect chasing something else.

As I found out "later" I didn't have jansson-devel dnf installed either,
so that may have affected my results. Who knows at this point.

The failure goes away with patch 13, but that introduced other issues
for me. I'll respond there with what I found.

John


[...]

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

[libvirt] [PATCH] build: Fix accidental revert of .gnulib update

2018-07-19 Thread John Ferlan
Commit id 1bff5bbe25eb7a7e7a4e0067c4ca7cbc1cb34999 accidentally
reverted .gnulib back to d6397dde2e127e246e3eeb5254a21f42cac783c8
which was two updates ago.

Update to the latest 68df637b5f1b5c10370f6981d2a43a5cf74368df
which includes three changes since the previous fetch of
cdbf3d385a32ff904c96f20c26f3470bd8345248.

> autoupdate
> hard-locale: simplify by removing hard-locale.m4
> gnulib-tool: limit line length for git send-email

Signed-off-by: John Ferlan 
---

 Pushing under this I know fixes some previous build breaking issue
 and of course it's a .gnulib maint, so that's reason #2.

 .gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gnulib b/.gnulib
index d6397dde2e..68df637b5f 16
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit d6397dde2e127e246e3eeb5254a21f42cac783c8
+Subproject commit 68df637b5f1b5c10370f6981d2a43a5cf74368df
-- 
2.17.1

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


Re: [libvirt] [PATCH] virt-xml-validate: Add schema for nwfilterbinding

2018-07-19 Thread John Ferlan



On 07/12/2018 09:39 PM, Han Han wrote:
> Add nwfilterbinding schema in virt-xml-validate for autoprobing.
> Add document of nwfilterbinding schema in tools/virt-xml-validate.pod.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1600330
> 
> Signed-off-by: Han Han 
> ---
>  tools/virt-xml-validate.in  | 3 +++
>  tools/virt-xml-validate.pod | 4 
>  2 files changed, 7 insertions(+)
> 

With a slight adjustment to the commit message, putting the bz first and
removing the Resolves: label

Reviewed-by: John Ferlan 

(I'll push in a bit - trying to figure the best way to handle the
inadvertent .gnulib submodule push - revert or just get the latest).

John

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


[libvirt] [PATCH] tools: Fix typo generating adapter_wwpn field

2018-07-19 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1601377

Fix typo from commit id d45bee449 for the parent_wwpn field
resulting in parent_wwnn being printed twice.

Signed-off-by: John Ferlan 
---
 tools/virsh-pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index cc49a5b96d..6faff781b2 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -371,7 +371,7 @@ virshBuildPoolXML(vshControl *ctl,
 if (adapterParent)
 virBufferAsprintf(, " parent='%s'", adapterParent);
 else if (adapterParentWwnn && adapterParentWwpn)
-virBufferAsprintf(, " parent_wwnn='%s' parent_wwnn='%s'",
+virBufferAsprintf(, " parent_wwnn='%s' parent_wwpn='%s'",
   adapterParentWwnn, adapterParentWwpn);
 else if (adapterParentFabricWwn)
 virBufferAsprintf(, " parent_fabric_wwn='%s'",
-- 
2.17.1

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


Re: [libvirt] [PATCH v2] util: set OOM in virCopyLastError if error is not set

2018-07-19 Thread John Ferlan



On 07/19/2018 04:15 AM, Nikolay Shirokovskiy wrote:
> 
> 
> On 17.07.2018 22:28, John Ferlan wrote:
>>
>>
> +} else {
> +to->code = VIR_ERR_NO_MEMORY;
> +to->domain = VIR_FROM_NONE;
> +to->level = VIR_ERR_ERROR;

 Should we do a VIR_FREE(to->message); so that nothing that was there
 before somehow remains... I don't think either agent or monitor> 
 "lastError" is reset until Dispose time.
>>>
>>> Won't hurt but probably will not be used by monitor or agent. If thread
>>> error is not allocated message is NULL upon return, after error is 
>>> allocated we never
>>> hit this OOM branch anymore. Of course hypotetical client can bring @to
>>> with message already set so this a bit future proof. 
>>>
>>> I think then we can leave reset and then set these 3 fields.
>>>
>>> Nikolay
>>>
>>
>> You have commit access and my R-by regardless of whether you add the
>> VIR_FREE or not.  I leave the rest to you ;-)
>>
> 
> Thanx! Pushed with reset added.
> 
> Nikolay
> 

Oh no, you pushed a local .gnulib too!

git log -p
...
commit 1bff5bbe25eb7a7e7a4e0067c4ca7cbc1cb34999
Author: Nikolay Shirokovskiy 
Date:   Mon Jul 2 14:16:52 2018 +0300

...
diff --git a/.gnulib b/.gnulib
index cdbf3d385a..d6397dde2e 16
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit cdbf3d385a32ff904c96f20c26f3470bd8345248
+Subproject commit d6397dde2e127e246e3eeb5254a21f42cac783c8
diff --git a/src/util/virerror.c b/src/util/virerror.c
index f198f27957..5f26d59777 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c


...

John

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


[libvirt] [jenkins-ci PATCH 8/8] guests: Update documentation

2018-07-19 Thread Andrea Bolognani
The usage has once again changed slightly; additionally,
a few concrete examples are now provided.

Signed-off-by: Andrea Bolognani 
---
 guests/README.markdown | 38 --
 1 file changed, 32 insertions(+), 6 deletions(-)

diff --git a/guests/README.markdown b/guests/README.markdown
index 4a40619..ddf0149 100644
--- a/guests/README.markdown
+++ b/guests/README.markdown
@@ -4,22 +4,48 @@ libvirt CI - guest management tools
 The tools contained in this directory simplify and automate the management
 of the guests used by the Jenkins-based libvirt CI environment.
 
+
+Usage and examples
+--
+
 There are two steps to bringing up a guest:
 
-* `./lcitool -a install -h $guest` will perform an unattended installation
+* `lcitool -a install -h $guest` will perform an unattended installation
   of `$guest`. Not all guests can be installed this way: see the "FreeBSD"
   section below;
 
-* `./lcitool -a update -h $guest` will go through all the post-installation
-  configuration steps required to make the newly-created guest usable;
+* `lcitool -a update -h $guest -p $project` will go through all the
+  post-installation configuration steps required to make the newly-created
+  guest usable and ready to be used for building `$project`;
 
 Once those steps have been performed, maintainance will involve running:
 
-* `./lcitool -a update -h $guest`
+lcitool -a update -h $guest -p $project
 
 periodically to ensure the guest configuration is sane and all installed
 packages are updated.
 
+To get a list of known guests and projects, run
+
+lcitool -a hosts
+
+and
+
+lcitool -a projects
+
+respectively. You can run operations involving multiple guests and projects
+at once by providing a list on the command line: for example, running
+
+lcitool -a update -h '*fedora*' -p '*osinfo*'
+
+will update all Fedora guests and get them ready to build libosinfo and
+related projects, while running
+
+lcitool -a update -h all -p libvirt,libvirt+mingw
+
+will update all hosts and prepare them to build libvirt both as a native
+library and, where supported, as a Windows library using MinGW.
+
 
 Host setup
 --
@@ -40,13 +66,13 @@ you'll want to use the `libvirt_guest` variant of the 
plugin.
 To keep guests up to date over time, it's recommended to have an entry
 along the lines of
 
-0 0 * * * cd ~/libvirt-jenkins-ci/guests && ./lcitool -a update -h all
+0 0 * * * ~/libvirt-jenkins-ci/guests/lcitool -a update -h all -p all
 
 in your crontab.
 
 
 Test use

+
 
 If you are a developer trying to reproduce a bug on some OS you don't
 have easy access to, you can use these tools to create a suitable test
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 2/8] lcitool: Use JSON to pass extra-vars

2018-07-19 Thread Andrea Bolognani
We're going to add more extra-vars later on, and they
will be in some cases more complex than simple strings;
using JSON allows us to do that and also be less verbose.

Signed-off-by: Andrea Bolognani 
---
 guests/lcitool | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 5526a27..4acb076 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -19,6 +19,7 @@
 import argparse
 import crypt
 import fnmatch
+import json
 import os
 import random
 import string
@@ -432,10 +433,10 @@ class Application:
 ansible_cfg_path = os.path.join(base, "ansible.cfg")
 playbook_path = os.path.join(base, "site.yml")
 
-extra_vars = "flavor={} root_password_file={}".format(
-flavor,
-root_pass_file,
-)
+extra_vars = json.dumps({
+"root_password_file": root_pass_file,
+"flavor": flavor,
+})
 
 cmd = [
 "ansible-playbook",
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 7/8] lcitool: Allow installing a subset of build dependencies

2018-07-19 Thread Andrea Bolognani
For CentOS CI, we need build dependencies for all known
projects to be installed; however, when using lcitool
for development purposes, it is very convenient to install
just the subset relevant to the project that's being
worked on, as doing so reduces the storage requirements
and makes the update procedure quite a bit faster.

The previous behavior can still be obtained by using

  $ lcitool -a update -p all ...

Signed-off-by: Andrea Bolognani 
---
 guests/lcitool   | 4 +++-
 guests/playbooks/update/main.yml | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 96a59ac..2aa9674 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -430,7 +430,7 @@ class Application:
 except Exception:
 raise Error("Failed to install '{}'".format(host))
 
-def _action_update(self, hosts, _projects):
+def _action_update(self, hosts, projects):
 base = Util.get_base()
 
 flavor = self._config.get_flavor()
@@ -438,6 +438,7 @@ class Application:
 root_pass_file = self._config.get_root_password_file()
 
 ansible_hosts = ",".join(self._inventory.expand_pattern(hosts))
+selected_projects = self._projects.expand_pattern(projects)
 
 ansible_cfg_path = os.path.join(base, "ansible.cfg")
 playbook_base = os.path.join(base, "playbooks", "update")
@@ -448,6 +449,7 @@ class Application:
 "playbook_base": playbook_base,
 "root_password_file": root_pass_file,
 "flavor": flavor,
+"selected_projects": selected_projects,
 })
 
 cmd = [
diff --git a/guests/playbooks/update/main.yml b/guests/playbooks/update/main.yml
index 4de759b..753bac4 100644
--- a/guests/playbooks/update/main.yml
+++ b/guests/playbooks/update/main.yml
@@ -34,11 +34,11 @@
 # Install build dependencies for each project
 - include: '{{ playbook_base }}/tasks/packages.yml'
   with_items:
-'{{ projects }}'
+'{{ selected_projects }}'
   loop_control:
 loop_var: project
   when:
-- projects is defined
+- project in projects
 
 # Install packages needed for the Jenkins agent
 - include: '{{ playbook_base }}/tasks/packages.yml'
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 5/8] guests: Drop install_config from inventory

2018-07-19 Thread Andrea Bolognani
The information is mostly duplicated and can be easily
inferred in a programmatic manner, so storing it in the
inventory is far from the cleanest solution.

As a side-effect, we reintroduce the error message that
was supposed to be displayed when attempting to install
a FreeBSD guest but was lost in the Python rewrite.

Signed-off-by: Andrea Bolognani 
---
 guests/host_vars/libvirt-centos-7/install.yml |  1 -
 guests/host_vars/libvirt-debian-8/install.yml |  1 -
 guests/host_vars/libvirt-debian-9/install.yml |  1 -
 .../host_vars/libvirt-debian-sid/install.yml  |  1 -
 .../host_vars/libvirt-fedora-27/install.yml   |  1 -
 .../host_vars/libvirt-fedora-28/install.yml   |  1 -
 .../libvirt-fedora-rawhide/install.yml|  1 -
 .../host_vars/libvirt-ubuntu-16/install.yml   |  1 -
 .../host_vars/libvirt-ubuntu-18/install.yml   |  1 -
 guests/lcitool| 19 ++-
 10 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/guests/host_vars/libvirt-centos-7/install.yml 
b/guests/host_vars/libvirt-centos-7/install.yml
index f003b89..2164ac5 100644
--- a/guests/host_vars/libvirt-centos-7/install.yml
+++ b/guests/host_vars/libvirt-centos-7/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: http://mirror.centos.org/centos/7/os/x86_64/
-install_config: kickstart.cfg
diff --git a/guests/host_vars/libvirt-debian-8/install.yml 
b/guests/host_vars/libvirt-debian-8/install.yml
index a2c8341..299a1a6 100644
--- a/guests/host_vars/libvirt-debian-8/install.yml
+++ b/guests/host_vars/libvirt-debian-8/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: http://deb.debian.org/debian/dists/jessie/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/host_vars/libvirt-debian-9/install.yml 
b/guests/host_vars/libvirt-debian-9/install.yml
index 5b1da76..7641753 100644
--- a/guests/host_vars/libvirt-debian-9/install.yml
+++ b/guests/host_vars/libvirt-debian-9/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: http://deb.debian.org/debian/dists/stretch/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/host_vars/libvirt-debian-sid/install.yml 
b/guests/host_vars/libvirt-debian-sid/install.yml
index da1c7a8..46c6366 100644
--- a/guests/host_vars/libvirt-debian-sid/install.yml
+++ b/guests/host_vars/libvirt-debian-sid/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: http://deb.debian.org/debian/dists/sid/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/host_vars/libvirt-fedora-27/install.yml 
b/guests/host_vars/libvirt-fedora-27/install.yml
index 66ce38e..f7a45af 100644
--- a/guests/host_vars/libvirt-fedora-27/install.yml
+++ b/guests/host_vars/libvirt-fedora-27/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: 
https://download.fedoraproject.org/pub/fedora/linux/releases/27/Everything/x86_64/os
-install_config: kickstart.cfg
diff --git a/guests/host_vars/libvirt-fedora-28/install.yml 
b/guests/host_vars/libvirt-fedora-28/install.yml
index 4b2b9f0..73433f1 100644
--- a/guests/host_vars/libvirt-fedora-28/install.yml
+++ b/guests/host_vars/libvirt-fedora-28/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: 
https://download.fedoraproject.org/pub/fedora/linux/releases/28/Everything/x86_64/os
-install_config: kickstart.cfg
diff --git a/guests/host_vars/libvirt-fedora-rawhide/install.yml 
b/guests/host_vars/libvirt-fedora-rawhide/install.yml
index 2216e81..5c67562 100644
--- a/guests/host_vars/libvirt-fedora-rawhide/install.yml
+++ b/guests/host_vars/libvirt-fedora-rawhide/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: 
https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os
-install_config: kickstart.cfg
diff --git a/guests/host_vars/libvirt-ubuntu-16/install.yml 
b/guests/host_vars/libvirt-ubuntu-16/install.yml
index a7bb2da..d8ce841 100644
--- a/guests/host_vars/libvirt-ubuntu-16/install.yml
+++ b/guests/host_vars/libvirt-ubuntu-16/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: 
http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/host_vars/libvirt-ubuntu-18/install.yml 
b/guests/host_vars/libvirt-ubuntu-18/install.yml
index bd3e1d9..544b3f2 100644
--- a/guests/host_vars/libvirt-ubuntu-18/install.yml
+++ b/guests/host_vars/libvirt-ubuntu-18/install.yml
@@ -1,3 +1,2 @@
 ---
 install_url: 
http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/
-install_config: preseed.cfg
diff --git a/guests/lcitool b/guests/lcitool
index 2cfb0e9..13f0392 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -382,15 +382,24 @@ class Application:
 facts["install_network"],
 )
 
-install_config = os.path.join(base, facts["install_config"])
+# Different operating systems require different configuration
+# files for unattended installation to work, but some operating
+# systems simply don't support unattended installation at all
+if facts["os_name"] in ["Debian", "Ubuntu"]:
+ 

[libvirt] [jenkins-ci PATCH 6/8] guests: Move install configs

2018-07-19 Thread Andrea Bolognani
The rationale is the same as for moving playbooks.

Signed-off-by: Andrea Bolognani 
---
 guests/{ => configs}/kickstart.cfg | 0
 guests/{ => configs}/preseed.cfg   | 0
 guests/lcitool | 2 +-
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename guests/{ => configs}/kickstart.cfg (100%)
 rename guests/{ => configs}/preseed.cfg (100%)

diff --git a/guests/kickstart.cfg b/guests/configs/kickstart.cfg
similarity index 100%
rename from guests/kickstart.cfg
rename to guests/configs/kickstart.cfg
diff --git a/guests/preseed.cfg b/guests/configs/preseed.cfg
similarity index 100%
rename from guests/preseed.cfg
rename to guests/configs/preseed.cfg
diff --git a/guests/lcitool b/guests/lcitool
index 13f0392..96a59ac 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -393,7 +393,7 @@ class Application:
 raise Error(
 "Host {} doesn't support installation".format(host)
 )
-initrd_inject = os.path.join(base, install_config)
+initrd_inject = os.path.join(base, "configs", install_config)
 
 # preseed files must use a well-known name to be picked up by
 # d-i; for kickstart files, we can use whatever name we please
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 4/8] guests: Move update playbook and related resources

2018-07-19 Thread Andrea Bolognani
This has two advantages: it unclutters the top-level
directory, and opens the door for adding more playbooks
down the line without turning it into a mess.

Thanks to the changes made earlier, moving the playbook
is almost entirely transparent to lcitool.

Signed-off-by: Andrea Bolognani 
---
 guests/lcitool| 4 ++--
 guests/{site.yml => playbooks/update/main.yml}| 0
 guests/{ => playbooks/update}/tasks/base.yml  | 0
 guests/{ => playbooks/update}/tasks/bootloader.yml| 0
 guests/{ => playbooks/update}/tasks/bootstrap.yml | 0
 guests/{ => playbooks/update}/tasks/jenkins.yml   | 0
 guests/{ => playbooks/update}/tasks/kludges.yml   | 0
 guests/{ => playbooks/update}/tasks/packages.yml  | 0
 guests/{ => playbooks/update}/tasks/paths.yml | 0
 guests/{ => playbooks/update}/tasks/services.yml  | 0
 guests/{ => playbooks/update}/tasks/users.yml | 0
 guests/{ => playbooks/update}/templates/bash_profile.j2   | 0
 guests/{ => playbooks/update}/templates/bashrc.j2 | 0
 guests/{ => playbooks/update}/templates/ccache.conf.j2| 0
 .../update}/templates/fedora-rawhide-kernel-nodebug.repo.j2   | 0
 guests/{ => playbooks/update}/templates/jenkins.service.j2| 0
 .../update}/templates/jessie-backports.preferences.j2 | 0
 .../update}/templates/jessie-backports.sources.j2 | 0
 18 files changed, 2 insertions(+), 2 deletions(-)
 rename guests/{site.yml => playbooks/update/main.yml} (100%)
 rename guests/{ => playbooks/update}/tasks/base.yml (100%)
 rename guests/{ => playbooks/update}/tasks/bootloader.yml (100%)
 rename guests/{ => playbooks/update}/tasks/bootstrap.yml (100%)
 rename guests/{ => playbooks/update}/tasks/jenkins.yml (100%)
 rename guests/{ => playbooks/update}/tasks/kludges.yml (100%)
 rename guests/{ => playbooks/update}/tasks/packages.yml (100%)
 rename guests/{ => playbooks/update}/tasks/paths.yml (100%)
 rename guests/{ => playbooks/update}/tasks/services.yml (100%)
 rename guests/{ => playbooks/update}/tasks/users.yml (100%)
 rename guests/{ => playbooks/update}/templates/bash_profile.j2 (100%)
 rename guests/{ => playbooks/update}/templates/bashrc.j2 (100%)
 rename guests/{ => playbooks/update}/templates/ccache.conf.j2 (100%)
 rename guests/{ => 
playbooks/update}/templates/fedora-rawhide-kernel-nodebug.repo.j2 (100%)
 rename guests/{ => playbooks/update}/templates/jenkins.service.j2 (100%)
 rename guests/{ => playbooks/update}/templates/jessie-backports.preferences.j2 
(100%)
 rename guests/{ => playbooks/update}/templates/jessie-backports.sources.j2 
(100%)

diff --git a/guests/lcitool b/guests/lcitool
index 206a014..2cfb0e9 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -431,8 +431,8 @@ class Application:
 ansible_hosts = ",".join(self._inventory.expand_pattern(hosts))
 
 ansible_cfg_path = os.path.join(base, "ansible.cfg")
-playbook_base = base
-playbook_path = os.path.join(playbook_base, "site.yml")
+playbook_base = os.path.join(base, "playbooks", "update")
+playbook_path = os.path.join(playbook_base, "main.yml")
 
 extra_vars = json.dumps({
 "base": base,
diff --git a/guests/site.yml b/guests/playbooks/update/main.yml
similarity index 100%
rename from guests/site.yml
rename to guests/playbooks/update/main.yml
diff --git a/guests/tasks/base.yml b/guests/playbooks/update/tasks/base.yml
similarity index 100%
rename from guests/tasks/base.yml
rename to guests/playbooks/update/tasks/base.yml
diff --git a/guests/tasks/bootloader.yml 
b/guests/playbooks/update/tasks/bootloader.yml
similarity index 100%
rename from guests/tasks/bootloader.yml
rename to guests/playbooks/update/tasks/bootloader.yml
diff --git a/guests/tasks/bootstrap.yml 
b/guests/playbooks/update/tasks/bootstrap.yml
similarity index 100%
rename from guests/tasks/bootstrap.yml
rename to guests/playbooks/update/tasks/bootstrap.yml
diff --git a/guests/tasks/jenkins.yml 
b/guests/playbooks/update/tasks/jenkins.yml
similarity index 100%
rename from guests/tasks/jenkins.yml
rename to guests/playbooks/update/tasks/jenkins.yml
diff --git a/guests/tasks/kludges.yml 
b/guests/playbooks/update/tasks/kludges.yml
similarity index 100%
rename from guests/tasks/kludges.yml
rename to guests/playbooks/update/tasks/kludges.yml
diff --git a/guests/tasks/packages.yml 
b/guests/playbooks/update/tasks/packages.yml
similarity index 100%
rename from guests/tasks/packages.yml
rename to guests/playbooks/update/tasks/packages.yml
diff --git a/guests/tasks/paths.yml b/guests/playbooks/update/tasks/paths.yml
similarity index 100%
rename from guests/tasks/paths.yml
rename to guests/playbooks/update/tasks/paths.yml
diff --git a/guests/tasks/services.yml 
b/guests/playbooks/update/tasks/services.yml
similarity index 100%
rename from guests/tasks/services.yml
rename to 

[libvirt] [jenkins-ci PATCH 0/8] lcitool: Cleanups and improvements

2018-07-19 Thread Andrea Bolognani
This series makes the guests/ directory less crowded by moving
a bunch of files to subdirectories, enhances the lcitool script
so that it works when called from any directory, and introduces
the ability to skip installation of build dependencies for
projects you don't care about. Some of these changes pave the
way for introducing [secret feature redacted] later on.

Andrea Bolognani (8):
  lcitool: Make the script location-independent
  lcitool: Use JSON to pass extra-vars
  lcitool: Pass base and playbook_base to Ansible
  guests: Move update playbook and related resources
  guests: Drop install_config from inventory
  guests: Move install configs
  lcitool: Allow installing a subset of build dependencies
  guests: Update documentation

 guests/README.markdown| 38 ++--
 guests/{ => configs}/kickstart.cfg|  0
 guests/{ => configs}/preseed.cfg  |  0
 guests/host_vars/libvirt-centos-7/install.yml |  1 -
 guests/host_vars/libvirt-debian-8/install.yml |  1 -
 guests/host_vars/libvirt-debian-9/install.yml |  1 -
 .../host_vars/libvirt-debian-sid/install.yml  |  1 -
 .../host_vars/libvirt-fedora-27/install.yml   |  1 -
 .../host_vars/libvirt-fedora-28/install.yml   |  1 -
 .../libvirt-fedora-rawhide/install.yml|  1 -
 .../host_vars/libvirt-ubuntu-16/install.yml   |  1 -
 .../host_vars/libvirt-ubuntu-18/install.yml   |  1 -
 guests/lcitool| 96 ++-
 .../{site.yml => playbooks/update/main.yml}   | 30 +++---
 guests/{ => playbooks/update}/tasks/base.yml  |  6 +-
 .../update}/tasks/bootloader.yml  |  0
 .../update}/tasks/bootstrap.yml   |  0
 .../{ => playbooks/update}/tasks/jenkins.yml  |  4 +-
 .../{ => playbooks/update}/tasks/kludges.yml  |  0
 .../{ => playbooks/update}/tasks/packages.yml |  2 +-
 guests/{ => playbooks/update}/tasks/paths.yml |  0
 .../{ => playbooks/update}/tasks/services.yml |  0
 guests/{ => playbooks/update}/tasks/users.yml |  4 +-
 .../update}/templates/bash_profile.j2 |  0
 .../update}/templates/bashrc.j2   |  0
 .../update}/templates/ccache.conf.j2  |  0
 .../fedora-rawhide-kernel-nodebug.repo.j2 |  0
 .../update}/templates/jenkins.service.j2  |  0
 .../templates/jessie-backports.preferences.j2 |  0
 .../templates/jessie-backports.sources.j2 |  0
 30 files changed, 128 insertions(+), 61 deletions(-)
 rename guests/{ => configs}/kickstart.cfg (100%)
 rename guests/{ => configs}/preseed.cfg (100%)
 rename guests/{site.yml => playbooks/update/main.yml} (52%)
 rename guests/{ => playbooks/update}/tasks/base.yml (92%)
 rename guests/{ => playbooks/update}/tasks/bootloader.yml (100%)
 rename guests/{ => playbooks/update}/tasks/bootstrap.yml (100%)
 rename guests/{ => playbooks/update}/tasks/jenkins.yml (92%)
 rename guests/{ => playbooks/update}/tasks/kludges.yml (100%)
 rename guests/{ => playbooks/update}/tasks/packages.yml (96%)
 rename guests/{ => playbooks/update}/tasks/paths.yml (100%)
 rename guests/{ => playbooks/update}/tasks/services.yml (100%)
 rename guests/{ => playbooks/update}/tasks/users.yml (95%)
 rename guests/{ => playbooks/update}/templates/bash_profile.j2 (100%)
 rename guests/{ => playbooks/update}/templates/bashrc.j2 (100%)
 rename guests/{ => playbooks/update}/templates/ccache.conf.j2 (100%)
 rename guests/{ => 
playbooks/update}/templates/fedora-rawhide-kernel-nodebug.repo.j2 (100%)
 rename guests/{ => playbooks/update}/templates/jenkins.service.j2 (100%)
 rename guests/{ => playbooks/update}/templates/jessie-backports.preferences.j2 
(100%)
 rename guests/{ => playbooks/update}/templates/jessie-backports.sources.j2 
(100%)

-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 1/8] lcitool: Make the script location-independent

2018-07-19 Thread Andrea Bolognani
Up until now, the only way to run lcitool has been from
the same directory it lives. After this patch, the script
is able to figure out its own location and adjust all
paths accordingly.

Suggested-by: Katerina Koukiou 
Signed-off-by: Andrea Bolognani 
---
 guests/lcitool | 61 +++---
 1 file changed, 48 insertions(+), 13 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 22b08dd..5526a27 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -43,6 +43,10 @@ class Error(Exception):
 
 class Util:
 
+@staticmethod
+def get_base():
+return os.path.dirname(os.path.abspath(__file__))
+
 @staticmethod
 def mksalt():
 alphabeth = string.ascii_letters + string.digits
@@ -83,8 +87,8 @@ class Config:
 try:
 config_dir = os.environ["XDG_CONFIG_HOME"]
 except KeyError:
-config_dir = os.path.join(os.environ["HOME"], ".config/")
-config_dir = os.path.join(config_dir, "lcitool/")
+config_dir = os.path.join(os.environ["HOME"], ".config")
+config_dir = os.path.join(config_dir, "lcitool")
 
 # Create the directory if it doesn't already exist
 if not os.path.exists(config_dir):
@@ -179,13 +183,18 @@ class Config:
 class Inventory:
 
 def __init__(self):
+base = Util.get_base()
+ansible_cfg_path = os.path.join(base, "ansible.cfg")
+
 try:
 parser = configparser.SafeConfigParser()
-parser.read("./ansible.cfg")
+parser.read(ansible_cfg_path)
 inventory_path = parser.get("defaults", "inventory")
 except Exception:
 raise Error("Can't find inventory location in ansible.cfg")
 
+inventory_path = os.path.join(base, inventory_path)
+
 self._facts = {}
 try:
 # We can only deal with trivial inventories, but that's
@@ -217,12 +226,19 @@ class Inventory:
 facts[fact] = some_facts[fact]
 
 def _read_all_facts(self, host):
+base = Util.get_base()
+
+sources = [
+os.path.join(base, "group_vars", "all"),
+os.path.join(base, "host_vars", host),
+]
+
 facts = {}
 
 # We load from group_vars/ first and host_vars/ second, sorting
 # files alphabetically; doing so should result in our view of
 # the facts matching Ansible's
-for source in ["./group_vars/all/", "./host_vars/{}/".format(host)]:
+for source in sources:
 for item in sorted(os.listdir(source)):
 yaml_path = os.path.join(source, item)
 if not os.path.isfile(yaml_path):
@@ -243,15 +259,20 @@ class Inventory:
 class Projects:
 
 def __init__(self):
+base = Util.get_base()
+
+mappings_path = os.path.join(base, "vars", "mappings.yml")
+
 try:
-with open("./vars/mappings.yml", "r") as infile:
+with open(mappings_path, "r") as infile:
 mappings = yaml.load(infile)
 self._mappings = mappings["mappings"]
 except Exception:
 raise Error("Can't load mappings")
 
+source = os.path.join(base, "vars", "projects")
+
 self._packages = {}
-source = "./vars/projects/"
 for item in os.listdir(source):
 yaml_path = os.path.join(source, item)
 if not os.path.isfile(yaml_path):
@@ -338,6 +359,8 @@ class Application:
 print(project)
 
 def _action_install(self, hosts, _projects):
+base = Util.get_base()
+
 flavor = self._config.get_flavor()
 
 for host in self._inventory.expand_pattern(hosts):
@@ -358,6 +381,8 @@ class Application:
 facts["install_network"],
 )
 
+install_config = os.path.join(base, facts["install_config"])
+
 # preseed files must use a well-known name to be picked up by
 # d-i; for kickstart files, we can use whatever name we please
 # but we need to point anaconda in the right direction through
@@ -381,7 +406,7 @@ class Application:
 "--graphics", "none",
 "--console", "pty",
 "--sound", "none",
-"--initrd-inject", facts["install_config"],
+"--initrd-inject", install_config,
 "--extra-args", extra_arg,
 "--wait", "0",
 ]
@@ -396,28 +421,38 @@ class Application:
 raise Error("Failed to install '{}'".format(host))
 
 def _action_update(self, hosts, _projects):
+base = Util.get_base()
+
 flavor = self._config.get_flavor()
 vault_pass_file = self._config.get_vault_password_file()
 root_pass_file = self._config.get_root_password_file()
 
 ansible_hosts = ",".join(self._inventory.expand_pattern(hosts))
 
+ansible_cfg_path = os.path.join(base, "ansible.cfg")
+

[libvirt] [jenkins-ci PATCH 3/8] lcitool: Pass base and playbook_base to Ansible

2018-07-19 Thread Andrea Bolognani
We want to get rid of relative paths in playbooks and
tasks, and in order to do that we have to provide Ansible
with some more information.

base is the directory where lcitool lives, and
playbook_base is the directory where a playbook should
look for its private resources: they match for the time
being, but that will no longer be the case very shortly.

Signed-off-by: Andrea Bolognani 
---
 guests/lcitool|  5 -
 guests/site.yml   | 26 +-
 guests/tasks/base.yml |  6 +++---
 guests/tasks/jenkins.yml  |  4 ++--
 guests/tasks/packages.yml |  2 +-
 guests/tasks/users.yml|  4 ++--
 6 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/guests/lcitool b/guests/lcitool
index 4acb076..206a014 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -431,9 +431,12 @@ class Application:
 ansible_hosts = ",".join(self._inventory.expand_pattern(hosts))
 
 ansible_cfg_path = os.path.join(base, "ansible.cfg")
-playbook_path = os.path.join(base, "site.yml")
+playbook_base = base
+playbook_path = os.path.join(playbook_base, "site.yml")
 
 extra_vars = json.dumps({
+"base": base,
+"playbook_base": playbook_base,
 "root_password_file": root_pass_file,
 "flavor": flavor,
 })
diff --git a/guests/site.yml b/guests/site.yml
index 063b0c6..4de759b 100644
--- a/guests/site.yml
+++ b/guests/site.yml
@@ -6,33 +6,33 @@
   tasks:
 
 # Bootstrap Ansible itself
-- include: tasks/bootstrap.yml
+- include: '{{ playbook_base }}/tasks/bootstrap.yml'
 
 - hosts: all
   remote_user: root
 
   vars_files:
-- vars/mappings.yml
+- '{{ base }}/vars/mappings.yml'
 
   tasks:
 
 # Prepare environment. None of the actions performed here might
 # depend on packages being installed
-- include: tasks/base.yml
+- include: '{{ playbook_base }}/tasks/base.yml'
 
 # Install base packages
-- include: tasks/packages.yml
+- include: '{{ playbook_base }}/tasks/packages.yml'
   vars:
 project: base
 
 # Remove blacklisted packages
-- include: tasks/packages.yml
+- include: '{{ playbook_base }}/tasks/packages.yml'
   vars:
 project: blacklist
 state: absent
 
 # Install build dependencies for each project
-- include: tasks/packages.yml
+- include: '{{ playbook_base }}/tasks/packages.yml'
   with_items:
 '{{ projects }}'
   loop_control:
@@ -41,20 +41,20 @@
 - projects is defined
 
 # Install packages needed for the Jenkins agent
-- include: tasks/packages.yml
+- include: '{{ playbook_base }}/tasks/packages.yml'
   vars:
 project: jenkins
   when:
 - flavor == "jenkins"
 
 # Configure environment. Needs to happen after installing packages
-- include: tasks/paths.yml
-- include: tasks/bootloader.yml
-- include: tasks/services.yml
-- include: tasks/kludges.yml
-- include: tasks/users.yml
+- include: '{{ playbook_base }}/tasks/paths.yml'
+- include: '{{ playbook_base }}/tasks/bootloader.yml'
+- include: '{{ playbook_base }}/tasks/services.yml'
+- include: '{{ playbook_base }}/tasks/kludges.yml'
+- include: '{{ playbook_base }}/tasks/users.yml'
 
 # Configure the Jenkins agent
-- include: tasks/jenkins.yml
+- include: '{{ playbook_base }}/tasks/jenkins.yml'
   when:
 - flavor == 'jenkins'
diff --git a/guests/tasks/base.yml b/guests/tasks/base.yml
index 6310d96..11f600f 100644
--- a/guests/tasks/base.yml
+++ b/guests/tasks/base.yml
@@ -25,7 +25,7 @@
 
 - name: Enable jessie-backports repository
   template:
-src: templates/jessie-backports.sources.j2
+src: '{{ playbook_base }}/templates/jessie-backports.sources.j2'
 dest: /etc/apt/sources.list.d/jessie-backports.list
 owner: root
 group: root
@@ -36,7 +36,7 @@
 
 - name: Configure APT pinning for jessie-backports
   template:
-src: templates/jessie-backports.preferences.j2
+src: '{{ playbook_base }}/templates/jessie-backports.preferences.j2'
 dest: /etc/apt/preferences.d/jessie-backports
 owner: root
 group: root
@@ -47,7 +47,7 @@
 
 - name: Enable fedora-rawhide-kernel-nodebug repository
   template:
-src: templates/fedora-rawhide-kernel-nodebug.repo.j2
+src: '{{ playbook_base }}/templates/fedora-rawhide-kernel-nodebug.repo.j2'
 dest: /etc/yum.repos.d/fedora-rawhide-kernel-nodebug.repo
 owner: root
 group: root
diff --git a/guests/tasks/jenkins.yml b/guests/tasks/jenkins.yml
index 9076c34..479e5d6 100644
--- a/guests/tasks/jenkins.yml
+++ b/guests/tasks/jenkins.yml
@@ -1,7 +1,7 @@
 ---
 - name: Open vault
   include_vars:
-file: vars/vault.yml
+file: '{{ base }}/vars/vault.yml'
 
 - name: Look up Jenkins secret
   set_fact:
@@ -32,7 +32,7 @@
 
 - name: Configure Jenkins agent
   template:
-src: templates/jenkins.service.j2
+src: '{{ playbook_base 

[libvirt] [PATCH 22/24] tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-network-gluster'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-network-gluster.x86_64-latest.args| 44 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 
tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args
new file mode 100644
index 00..9b99db8715
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-gluster.x86_64-latest.args
@@ -0,0 +1,44 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=gluster://example.org:6000/Volume1/Image,file.debug=4,format=raw,\
+if=none,id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1 \
+-drive 'file=gluster+unix:///Volume2/Image?socket=/path/to/sock,file.debug=4,\
+format=raw,if=none,id=drive-virtio-disk1' \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-drive file.driver=gluster,file.volume=Volume3,file.path=Image.qcow2,\
+file.server.0.type=tcp,file.server.0.host=example.org,file.server.0.port=6000,\
+file.server.1.type=tcp,file.server.1.host=example.org,file.server.1.port=24007,\
+file.server.2.type=unix,file.server.2.socket=/path/to/sock,file.debug=4,\
+format=qcow2,if=none,id=drive-virtio-disk2 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk2,\
+id=virtio-disk2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index aef69aeb2e..0c6356f19f 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1048,6 +1048,7 @@ mymain(void)
 DO_TEST_PARSE_ERROR("disk-network-source-auth-both", NONE);
 DO_TEST("disk-network-gluster",
 QEMU_CAPS_GLUSTER_DEBUG_LEVEL);
+DO_TEST_CAPS_LATEST("disk-network-gluster");
 DO_TEST_CAPS_VER("disk-network-rbd", "2.5.0");
 DO_TEST_CAPS_LATEST("disk-network-rbd");
 DO_TEST_FAILURE("disk-network-rbd-no-colon", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 24/24] tests: qemuxml2argv: Add CAPS_LATEST version of security-related tests

2018-07-19 Thread Peter Krempa
'disk-network-source-auth' and 'disk-netowrk-tlsx509'

Signed-off-by: Peter Krempa 
---
 .../disk-network-source-auth.x86_64-latest.args| 47 +
 .../disk-network-tlsx509.x86_64-latest.args| 59 ++
 tests/qemuxml2argvtest.c   |  2 +
 3 files changed, 108 insertions(+)
 create mode 100644 
tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args
 create mode 100644 
tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args
new file mode 100644
index 00..9f124ec75f
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-source-auth.x86_64-latest.args
@@ -0,0 +1,47 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object secret,id=virtio-disk0-secret0,\
+data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
+keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
+-drive file.driver=iscsi,file.portal=example.org:6000,\
+file.target=iqn.1992-01.com.example:storage,file.lun=1,file.transport=tcp,\
+file.user=myname,file.password-secret=virtio-disk0-secret0,format=raw,if=none,\
+id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1 \
+-object secret,id=virtio-disk1-secret0,\
+data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
+keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
+-drive 'file=rbd:pool/image:id=myname:auth_supported=cephx\;none:\
+mon_host=mon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:\
+6322,file.password-secret=virtio-disk1-secret0,format=raw,if=none,\
+id=drive-virtio-disk1' \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args
new file mode 100644
index 00..48d70e1cd3
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-tlsx509.x86_64-latest.args
@@ -0,0 +1,59 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-cpu qemu32 \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-object 
tls-creds-x509,id=objvirtio-disk0_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
+,path,endpoint=client,verify-peer=yes \
+-drive file.driver=vxhs,file.tls-creds=objvirtio-disk0_tls0,\
+file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
+file.server.host=192.168.0.1,file.server.port=,format=raw,if=none,\
+id=drive-virtio-disk0,cache=none \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1,write-cache=on,\
+serial=eb90327c-8302-4725-9e1b-4e85ed4dc251 \
+-object 
tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
+,path,endpoint=client,verify-peer=yes \
+-drive file.driver=vxhs,file.tls-creds=objvirtio-disk1_tls0,\
+file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc252,\
+file.server.host=192.168.0.2,file.server.port=,format=raw,if=none,\
+id=drive-virtio-disk1,cache=none \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,\
+id=virtio-disk1,write-cache=on,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252 \
+-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc253,\
+file.server.host=192.168.0.3,file.server.port=,format=raw,if=none,\
+id=drive-virtio-disk2,cache=none \
+-device 

[libvirt] [PATCH 21/24] tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-readonly' and 'disk-shared'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-readonly-disk.x86_64-latest.args  | 34 
 .../disk-shared.x86_64-latest.args | 37 ++
 tests/qemuxml2argvtest.c   |  2 ++
 3 files changed, 73 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/disk-shared.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args
new file mode 100644
index 00..3fd8f5c849
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-readonly-disk.x86_64-latest.args
@@ -0,0 +1,34 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=/dev/sr0,format=raw,if=none,id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args
new file mode 100644
index 00..15f8c6b3d7
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-shared.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
+cache=none \
+-device ide-hd,bus=ide.0,unit=0,share-rw=on,drive=drive-ide0-0-0,id=ide0-0-0,\
+bootindex=1,write-cache=on,serial=XYZXYZXYZYXXYZYZYXYZY \
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-1-0,\
+readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 06ba425da5..aef69aeb2e 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1022,12 +1022,14 @@ mymain(void)
 QEMU_CAPS_DRIVE_BOOT);
 DO_TEST_CAPS_LATEST("floppy-drive-fat");
 DO_TEST("disk-readonly-disk", NONE);
+DO_TEST_CAPS_LATEST("disk-readonly-disk");
 DO_TEST("disk-fmt-qcow",
 QEMU_CAPS_DRIVE_BOOT);
 DO_TEST_PARSE_ERROR("disk-fmt-cow", QEMU_CAPS_DRIVE_BOOT);
 DO_TEST_PARSE_ERROR("disk-fmt-dir", QEMU_CAPS_DRIVE_BOOT);
 DO_TEST_PARSE_ERROR("disk-fmt-iso", QEMU_CAPS_DRIVE_BOOT);
 DO_TEST("disk-shared", NONE);
+DO_TEST_CAPS_LATEST("disk-shared");
 DO_TEST_PARSE_ERROR("disk-shared-qcow", NONE);
 DO_TEST("disk-shared-locking",
 QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DISK_SHARE_RW);
-- 
2.16.2

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


[libvirt] [PATCH 20/24] tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-floppy' and 'floppy-drive-fat'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-floppy.x86_64-latest.args | 35 ++
 .../floppy-drive-fat.x86_64-latest.args| 33 
 tests/qemuxml2argvtest.c   |  2 ++
 3 files changed, 70 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args
new file mode 100644
index 00..302e19b36a
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-floppy.x86_64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=/dev/fd0,format=raw,if=none,id=drive-fdc0-0-0 \
+-global isa-fdc.driveA=drive-fdc0-0-0 \
+-drive file=/tmp/firmware.img,format=raw,if=none,id=drive-fdc0-0-1 \
+-global isa-fdc.driveB=drive-fdc0-0-1 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args 
b/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args
new file mode 100644
index 00..bf133aaab0
--- /dev/null
+++ b/tests/qemuxml2argvdata/floppy-drive-fat.x86_64-latest.args
@@ -0,0 +1,33 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=fat:floppy:/var/somefiles,if=none,id=drive-fdc0-0-0,readonly=on \
+-global isa-fdc.driveA=drive-fdc0-0-0 \
+-global isa-fdc.bootindexA=1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3554b63428..06ba425da5 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -997,6 +997,7 @@ mymain(void)
 QEMU_CAPS_VIRTIO_TX_ALG);
 DO_TEST_CAPS_LATEST("disk-cdrom-tray");
 DO_TEST("disk-floppy", NONE);
+DO_TEST_CAPS_LATEST("disk-floppy");
 DO_TEST_FAILURE("disk-floppy-pseries",
 QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
 DO_TEST("disk-floppy-tray", NONE);
@@ -1019,6 +1020,7 @@ mymain(void)
 QEMU_CAPS_DRIVE_BOOT);
 DO_TEST("floppy-drive-fat",
 QEMU_CAPS_DRIVE_BOOT);
+DO_TEST_CAPS_LATEST("floppy-drive-fat");
 DO_TEST("disk-readonly-disk", NONE);
 DO_TEST("disk-fmt-qcow",
 QEMU_CAPS_DRIVE_BOOT);
-- 
2.16.2

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


[libvirt] [PATCH 18/24] tests: qemuxml2argv: Unify testing of 'disk-network-rbd'

2018-07-19 Thread Peter Krempa
Move the authentication and ipv6 cases into the main test file. To allow
removal of the separate testing of the secure credential passing via the
'secret' object in qemu, use the DO_TEST_CAPS_VER macro with version
2.5.0 when the secret object is not supported by qemu.

Signed-off-by: Peter Krempa 
---
 .../disk-network-rbd-auth-AES.args | 47 -
 .../qemuxml2argvdata/disk-network-rbd-auth-AES.xml | 55 ---
 tests/qemuxml2argvdata/disk-network-rbd-auth.args  | 32 
 tests/qemuxml2argvdata/disk-network-rbd-auth.xml   | 42 ---
 tests/qemuxml2argvdata/disk-network-rbd-ipv6.args  | 31 ---
 tests/qemuxml2argvdata/disk-network-rbd-ipv6.xml   | 40 --
 tests/qemuxml2argvdata/disk-network-rbd.args   | 44 
 .../disk-network-rbd.x86_64-2.5.0.args | 55 +++
 .../disk-network-rbd.x86_64-latest.args| 61 ++
 tests/qemuxml2argvdata/disk-network-rbd.xml| 28 +++---
 tests/qemuxml2argvtest.c   |  9 ++--
 tests/qemuxml2xmloutdata/disk-network-rbd-auth.xml | 47 -
 tests/qemuxml2xmloutdata/disk-network-rbd-ipv6.xml | 45 
 tests/qemuxml2xmloutdata/disk-network-rbd.xml  | 30 ---
 tests/qemuxml2xmltest.c|  2 -
 15 files changed, 165 insertions(+), 403 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-auth-AES.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-auth-AES.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-auth.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-auth.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-ipv6.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-ipv6.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd.args
 create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-2.5.0.args
 create mode 100644 tests/qemuxml2argvdata/disk-network-rbd.x86_64-latest.args
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-rbd-auth.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-rbd-ipv6.xml

diff --git a/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.args 
b/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.args
deleted file mode 100644
index 9c39082bec..00
--- a/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.args
+++ /dev/null
@@ -1,47 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--object secret,id=masterKey0,format=raw,\
-file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--object secret,id=virtio-disk0-secret0,\
-data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
-keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive 'file=rbd:pool/image:id=myname:auth_supported=cephx\;none:\
-mon_host=mon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:\
-6322,file.password-secret=virtio-disk0-secret0,format=raw,if=none,\
-id=drive-virtio-disk0' \
--device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
-id=virtio-disk0 \
--object secret,id=scsi0-0-0-0-secret0,\
-data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
-keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
--drive 'file=rbd:pool/image:id=myname:auth_supported=cephx\;none:\
-mon_host=mon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:\
-6322,file.password-secret=scsi0-0-0-0-secret0,format=raw,if=none,\
-id=drive-scsi0-0-0-0,cache=none' \
--device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
-drive=drive-scsi0-0-0-0,id=scsi0-0-0-0
diff --git a/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.xml 
b/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.xml
deleted file mode 100644
index 390d2d6038..00
--- a/tests/qemuxml2argvdata/disk-network-rbd-auth-AES.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-
-  
-  
-
-
-
-  
-  
-
-
-  
-  
-

[libvirt] [PATCH 14/24] tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-iscsi'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-network-iscsi.x86_64-latest.args  | 63 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 64 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args
new file mode 100644
index 00..be9ab18314
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-iscsi.x86_64-latest.args
@@ -0,0 +1,63 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x2 \
+-drive file.driver=iscsi,file.portal=example.org:6000,\
+file.target=iqn.1992-01.com.example,file.lun=0,file.transport=tcp,format=raw,\
+if=none,id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1 \
+-drive file.driver=iscsi,file.portal=example.org:6000,\
+file.target=iqn.1992-01.com.example,file.lun=1,file.transport=tcp,format=raw,\
+if=none,id=drive-virtio-disk1 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-object secret,id=virtio-disk2-secret0,\
+data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
+keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
+-drive file.driver=iscsi,file.portal=example.org:6000,\
+file.target=iqn.1992-01.com.example:storage,file.lun=1,file.transport=tcp,\
+file.user=myname,file.password-secret=virtio-disk2-secret0,format=raw,if=none,\
+id=drive-virtio-disk2 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk2,\
+id=virtio-disk2 \
+-object secret,id=virtio-disk3-secret0,\
+data=9eao5F8qtkGt+seB1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,\
+keyid=masterKey0,iv=AAECAwQFBgcICQoLDA0ODw==,format=base64 \
+-drive file.driver=iscsi,file.portal=example.org:6000,\
+file.target=iqn.1992-01.com.example:storage,file.lun=2,file.transport=tcp,\
+file.user=myname,file.password-secret=virtio-disk3-secret0,format=raw,if=none,\
+id=drive-virtio-disk3 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk3,\
+id=virtio-disk3 \
+-drive file.driver=iscsi,file.portal=example.org:3260,\
+file.target=iqn.1992-01.com.example,file.lun=0,file.transport=tcp,format=raw,\
+if=none,id=drive-scsi0-0-0-0 \
+-device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
+drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 31e992b989..2dfb0da267 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1042,6 +1042,7 @@ mymain(void)
 DO_TEST("disk-network-nbd-ipv6-export", NONE);
 DO_TEST("disk-network-nbd-unix", NONE);
 DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BLOCK);
+DO_TEST_CAPS_LATEST("disk-network-iscsi");
 DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-secrettype-invalid", NONE);
 DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-wrong-secrettype", NONE);
 DO_TEST_PARSE_ERROR("disk-network-source-auth-both", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 16/24] tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-nbd'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-network-nbd.x86_64-latest.args| 46 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args
new file mode 100644
index 00..85452e715a
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-nbd.x86_64-latest.args
@@ -0,0 +1,46 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=nbd:example.org:6000,format=raw,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=1 \
+-drive file=nbd:example.org:6000:exportname=bar,format=raw,if=none,\
+id=drive-virtio-disk1 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk1,\
+id=virtio-disk1 \
+-drive 'file=nbd://[::1]:6000,format=raw,if=none,id=drive-virtio-disk2' \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk2,\
+id=virtio-disk2 \
+-drive 'file=nbd://[::1]:6000/bar,format=raw,if=none,id=drive-virtio-disk3' \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk3,\
+id=virtio-disk3 \
+-drive file=nbd:unix:/var/run/nbdsock:exportname=bar,format=raw,if=none,\
+id=drive-virtio-disk4 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x6,drive=drive-virtio-disk4,\
+id=virtio-disk4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d4d98bfe21..7019d65eb7 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1037,6 +1037,7 @@ mymain(void)
 DO_TEST_CAPS_VER("disk-cache", "2.7.0");
 DO_TEST_CAPS_LATEST("disk-cache");
 DO_TEST("disk-network-nbd", NONE);
+DO_TEST_CAPS_LATEST("disk-network-nbd");
 DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BLOCK);
 DO_TEST_CAPS_LATEST("disk-network-iscsi");
 DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-secrettype-invalid", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 12/24] tests: qemu: Unify disk cache testing

2018-07-19 Thread Peter Krempa
Move the 'unsafe' cache test into 'disk-cache' and remove all the
individual cases for one cache mode each.

Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-cache-directsync.args  | 30 
 tests/qemuxml2argvdata/disk-cache-directsync.xml   | 37 ---
 tests/qemuxml2argvdata/disk-cache-unsafe.args  | 30 
 tests/qemuxml2argvdata/disk-cache-unsafe.xml   | 37 ---
 tests/qemuxml2argvdata/disk-cache-v2-none.args | 30 
 tests/qemuxml2argvdata/disk-cache-v2-none.xml  | 37 ---
 tests/qemuxml2argvdata/disk-cache-v2-wb.args   | 30 
 tests/qemuxml2argvdata/disk-cache-v2-wb.xml| 37 ---
 tests/qemuxml2argvdata/disk-cache-v2-wt.args   | 30 
 tests/qemuxml2argvdata/disk-cache-v2-wt.xml| 37 ---
 tests/qemuxml2argvdata/disk-cache.args |  3 ++
 .../qemuxml2argvdata/disk-cache.x86_64-2.6.0.args  |  3 ++
 .../qemuxml2argvdata/disk-cache.x86_64-2.7.0.args  |  4 +++
 .../qemuxml2argvdata/disk-cache.x86_64-latest.args |  4 +++
 tests/qemuxml2argvdata/disk-cache.xml  |  6 
 tests/qemuxml2argvtest.c   |  5 ---
 tests/qemuxml2xmloutdata/disk-cache-directsync.xml | 41 --
 tests/qemuxml2xmloutdata/disk-cache-unsafe.xml | 41 --
 tests/qemuxml2xmloutdata/disk-cache-v2-none.xml| 41 --
 tests/qemuxml2xmloutdata/disk-cache-v2-wb.xml  | 41 --
 tests/qemuxml2xmloutdata/disk-cache-v2-wt.xml  | 41 --
 tests/qemuxml2xmloutdata/disk-cache.xml|  6 
 tests/qemuxml2xmltest.c|  5 ---
 23 files changed, 26 insertions(+), 550 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-directsync.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-directsync.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-unsafe.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-unsafe.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-none.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-none.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-wb.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-wb.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-wt.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cache-v2-wt.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cache-directsync.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cache-unsafe.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cache-v2-none.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cache-v2-wb.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cache-v2-wt.xml

diff --git a/tests/qemuxml2argvdata/disk-cache-directsync.args 
b/tests/qemuxml2argvdata/disk-cache-directsync.args
deleted file mode 100644
index 82b2e1a218..00
--- a/tests/qemuxml2argvdata/disk-cache-directsync.args
+++ /dev/null
@@ -1,30 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\
-cache=directsync \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-1-0,\
-media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
diff --git a/tests/qemuxml2argvdata/disk-cache-directsync.xml 
b/tests/qemuxml2argvdata/disk-cache-directsync.xml
deleted file mode 100644
index e5b2ad3182..00
--- a/tests/qemuxml2argvdata/disk-cache-directsync.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-cache-unsafe.args 
b/tests/qemuxml2argvdata/disk-cache-unsafe.args
deleted file mode 100644
index 6759a02416..00
--- a/tests/qemuxml2argvdata/disk-cache-unsafe.args
+++ /dev/null
@@ -1,30 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine 

[libvirt] [PATCH 19/24] tests: qemu: Remove pointless 'disks-many' test

2018-07-19 Thread Peter Krempa
We have several cases when a VM has multiple disks in the test files so
having another one without any interresting configuration is not
necessary.

Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-many.args  | 32 -
 tests/qemuxml2argvdata/disk-many.xml   | 48 ---
 tests/qemuxml2argvtest.c   |  1 -
 tests/qemuxml2xmloutdata/disk-many.xml | 52 --
 tests/qemuxml2xmltest.c|  1 -
 5 files changed, 134 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-many.args
 delete mode 100644 tests/qemuxml2argvdata/disk-many.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-many.xml

diff --git a/tests/qemuxml2argvdata/disk-many.args 
b/tests/qemuxml2argvdata/disk-many.args
deleted file mode 100644
index 97baddd67e..00
--- a/tests/qemuxml2argvdata/disk-many.args
+++ /dev/null
@@ -1,32 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-1 \
--device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
--drive file=/tmp/data.img,format=raw,if=none,id=drive-ide0-1-0 \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--drive file=/tmp/logs.img,format=raw,if=none,id=drive-ide0-1-1 \
--device ide-drive,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1
diff --git a/tests/qemuxml2argvdata/disk-many.xml 
b/tests/qemuxml2argvdata/disk-many.xml
deleted file mode 100644
index fb915ac489..00
--- a/tests/qemuxml2argvdata/disk-many.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2db4d350a5..3554b63428 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1002,7 +1002,6 @@ mymain(void)
 DO_TEST("disk-floppy-tray", NONE);
 DO_TEST("disk-virtio-s390",
 QEMU_CAPS_VIRTIO_S390);
-DO_TEST("disk-many", NONE);
 DO_TEST("disk-virtio", QEMU_CAPS_DRIVE_BOOT);
 DO_TEST("disk-virtio-ccw",
 QEMU_CAPS_CCW, QEMU_CAPS_VIRTIO_S390);
diff --git a/tests/qemuxml2xmloutdata/disk-many.xml 
b/tests/qemuxml2xmloutdata/disk-many.xml
deleted file mode 100644
index b7a971e51d..00
--- a/tests/qemuxml2xmloutdata/disk-many.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-
-
-  
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index a333d448c3..795ddc7003 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -348,7 +348,6 @@ mymain(void)
 DO_TEST("disk-aio", NONE);
 DO_TEST("disk-cdrom", NONE);
 DO_TEST("disk-floppy", NONE);
-DO_TEST("disk-many", NONE);
 DO_TEST("disk-usb-device", NONE);
 DO_TEST("disk-virtio", NONE);
 DO_TEST("floppy-drive-fat", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 17/24] tests: qemu: Remove pointless 'disk-networ-ceph-env' test

2018-07-19 Thread Peter Krempa
The xml2argv variant was unused. The xml2xml variant is redundant in
other tests for RBD.

Signed-off-by: Peter Krempa 
---
 .../disk-network-rbd-ceph-env.args | 25 
 .../qemuxml2argvdata/disk-network-rbd-ceph-env.xml | 39 ---
 .../disk-network-rbd-ceph-env.xml  | 44 --
 tests/qemuxml2xmltest.c|  1 -
 4 files changed, 109 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-ceph-env.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-rbd-ceph-env.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-rbd-ceph-env.xml

diff --git a/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.args 
b/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.args
deleted file mode 100644
index ead74e3110..00
--- a/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.args
+++ /dev/null
@@ -1,25 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-CEPH_ARGS=-m \
-mon1.example.org:6321,mon2.example.org:6322,mon3.example.org:6322 \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--M pc \
--m 214 \
--smp 1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--nographic \
--monitor unix:/tmp/test-monitor,server,nowait \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=ide,bus=0,unit=0 \
--drive file=rbd:pool/image,format=raw,if=virtio \
--net none \
--serial none \
--parallel none
diff --git a/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.xml 
b/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.xml
deleted file mode 100644
index 4f54867c6c..00
--- a/tests/qemuxml2argvdata/disk-network-rbd-ceph-env.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-
-
-
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2xmloutdata/disk-network-rbd-ceph-env.xml 
b/tests/qemuxml2xmloutdata/disk-network-rbd-ceph-env.xml
deleted file mode 100644
index 2e46e1d0b9..00
--- a/tests/qemuxml2xmloutdata/disk-network-rbd-ceph-env.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-
-
-
-  
-  
-  
-
-
-  
-
-
-  
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b2aa903ec9..a0bf160ee6 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -364,7 +364,6 @@ mymain(void)
 DO_TEST("disk-network-rbd", NONE);
 DO_TEST("disk-network-rbd-auth", NONE);
 DO_TEST("disk-network-rbd-ipv6", NONE);
-DO_TEST("disk-network-rbd-ceph-env", NONE);
 DO_TEST("disk-network-source-auth", NONE);
 DO_TEST("disk-network-sheepdog", NONE);
 DO_TEST("disk-network-vxhs", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 15/24] tests: qemu: Unify nbd disk source testing

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../qemuxml2argvdata/disk-network-nbd-export.args  | 30 
 tests/qemuxml2argvdata/disk-network-nbd-export.xml | 37 ---
 .../disk-network-nbd-ipv6-export.args  | 29 ---
 .../disk-network-nbd-ipv6-export.xml   | 37 ---
 tests/qemuxml2argvdata/disk-network-nbd-ipv6.args  | 29 ---
 tests/qemuxml2argvdata/disk-network-nbd-ipv6.xml   | 37 ---
 tests/qemuxml2argvdata/disk-network-nbd-unix.args  | 30 
 tests/qemuxml2argvdata/disk-network-nbd-unix.xml   | 37 ---
 tests/qemuxml2argvdata/disk-network-nbd.args   | 18 --
 tests/qemuxml2argvdata/disk-network-nbd.xml| 34 ++
 tests/qemuxml2argvtest.c   |  4 ---
 .../qemuxml2xmloutdata/disk-network-nbd-export.xml | 42 --
 .../disk-network-nbd-ipv6-export.xml   | 42 --
 tests/qemuxml2xmloutdata/disk-network-nbd-ipv6.xml | 42 --
 tests/qemuxml2xmloutdata/disk-network-nbd-unix.xml | 42 --
 tests/qemuxml2xmloutdata/disk-network-nbd.xml  | 38 
 tests/qemuxml2xmltest.c|  4 ---
 17 files changed, 75 insertions(+), 457 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-export.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-export.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-ipv6-export.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-ipv6-export.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-ipv6.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-ipv6.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-unix.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-nbd-unix.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-nbd-export.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-nbd-ipv6-export.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-nbd-ipv6.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-nbd-unix.xml

diff --git a/tests/qemuxml2argvdata/disk-network-nbd-export.args 
b/tests/qemuxml2argvdata/disk-network-nbd-export.args
deleted file mode 100644
index ff220d3f7d..00
--- a/tests/qemuxml2argvdata/disk-network-nbd-export.args
+++ /dev/null
@@ -1,30 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive file=nbd:example.org:6000:exportname=bar,format=raw,if=none,\
-id=drive-virtio-disk0 \
--device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
-id=virtio-disk0
diff --git a/tests/qemuxml2argvdata/disk-network-nbd-export.xml 
b/tests/qemuxml2argvdata/disk-network-nbd-export.xml
deleted file mode 100644
index 2acf380c35..00
--- a/tests/qemuxml2argvdata/disk-network-nbd-export.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-network-nbd-ipv6-export.args 
b/tests/qemuxml2argvdata/disk-network-nbd-ipv6-export.args
deleted file mode 100644
index 8ced242f52..00
--- a/tests/qemuxml2argvdata/disk-network-nbd-ipv6-export.args
+++ /dev/null
@@ -1,29 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive 

[libvirt] [PATCH 23/24] tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-network-sheepdog'

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-network-sheepdog.x86_64-latest.args   | 35 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 
tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args
new file mode 100644
index 00..544c673820
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-network-sheepdog.x86_64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMU,,Guest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=sheepdog:example.org:6000:image,,with,,commas,format=raw,if=none,\
+id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 0c6356f19f..dfac925359 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1053,6 +1053,7 @@ mymain(void)
 DO_TEST_CAPS_LATEST("disk-network-rbd");
 DO_TEST_FAILURE("disk-network-rbd-no-colon", NONE);
 DO_TEST("disk-network-sheepdog", NONE);
+DO_TEST_CAPS_LATEST("disk-network-sheepdog");
 DO_TEST("disk-network-source-auth", NONE);
 DO_TEST("disk-network-vxhs", QEMU_CAPS_VXHS);
 driver.config->vxhsTLS = 1;
-- 
2.16.2

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


[libvirt] [PATCH 11/24] tests: qemu: Add xml2xml and minimal version of 'disk-cache' test

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-cache.args  | 38 +++
 tests/qemuxml2argvtest.c|  1 +
 tests/qemuxml2xmloutdata/disk-cache.xml | 54 +
 tests/qemuxml2xmltest.c |  1 +
 4 files changed, 94 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-cache.args
 create mode 100644 tests/qemuxml2xmloutdata/disk-cache.xml

diff --git a/tests/qemuxml2argvdata/disk-cache.args 
b/tests/qemuxml2argvdata/disk-cache.args
new file mode 100644
index 00..ee2f79a99f
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-cache.args
@@ -0,0 +1,38 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-machine pc-i440fx-2.6,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot c \
+-device lsi,id=scsi0,bus=pci.0,addr=0x3 \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\
+cache=writeback \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-scsi0-0-0,\
+cache=none \
+-device scsi-disk,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-virtio-disk0,\
+cache=writethrough \
+-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-usb-disk1,\
+cache=directsync \
+-device usb-storage,bus=usb.0,port=1,drive=drive-usb-disk1,id=usb-disk1
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 6f6b5869b3..d3c2101abd 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1037,6 +1037,7 @@ mymain(void)
 DO_TEST("disk-cache-v2-none", NONE);
 DO_TEST("disk-cache-directsync", NONE);
 DO_TEST("disk-cache-unsafe", NONE);
+DO_TEST("disk-cache", QEMU_CAPS_SCSI_LSI, QEMU_CAPS_DEVICE_USB_STORAGE);
 DO_TEST_CAPS_VER("disk-cache", "2.6.0");
 DO_TEST_CAPS_VER("disk-cache", "2.7.0");
 DO_TEST_CAPS_LATEST("disk-cache");
diff --git a/tests/qemuxml2xmloutdata/disk-cache.xml 
b/tests/qemuxml2xmloutdata/disk-cache.xml
new file mode 100644
index 00..4c2a196ac0
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/disk-cache.xml
@@ -0,0 +1,54 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+hvm
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-i686
+
+  
+  
+  
+  
+
+
+  
+  
+  
+  
+
+
+  
+  
+  
+  
+
+
+  
+  
+  
+
+
+  
+
+
+  
+
+
+
+  
+
+
+
+
+  
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 904b86571f..a3480cd5d1 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -362,6 +362,7 @@ mymain(void)
 DO_TEST("disk-cache-v2-none", NONE);
 DO_TEST("disk-cache-directsync", NONE);
 DO_TEST("disk-cache-unsafe", NONE);
+DO_TEST("disk-cache", QEMU_CAPS_SCSI_LSI);
 DO_TEST("disk-network-nbd", NONE);
 DO_TEST("disk-network-nbd-export", NONE);
 DO_TEST("disk-network-nbd-ipv6", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 07/24] tests: qemuxml2argv: Add 'CAPS_LATEST' data for disk-cdrom* tests

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-cdrom-network.x86_64-latest.args  | 41 ++
 .../disk-cdrom-tray.x86_64-latest.args | 39 
 .../qemuxml2argvdata/disk-cdrom.x86_64-latest.args | 35 ++
 tests/qemuxml2argvtest.c   |  3 ++
 4 files changed, 118 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args
new file mode 100644
index 00..0ce8497840
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args
@@ -0,0 +1,41 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
+-m 1024 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=ftp://host.name:21/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-0-0,readonly=on \
+-device ide-cd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
+-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-0-1,readonly=on \
+-device ide-cd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
+-drive file=https://host.name:443/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-1-1,readonly=on \
+-device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args
new file mode 100644
index 00..79863e456d
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-cdrom-tray.x86_64-latest.args
@@ -0,0 +1,39 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-test/master-key.aes \
+-machine pc-0.13,accel=tcg,usb=off,dump-guest-core=off \
+-m 1024 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 3fa02811-7832-34bd-004d-1ff56a9286ff \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot menu=on,strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/var/lib/libvirt/images/f14.img,format=qcow2,if=none,\
+id=drive-virtio-disk0 \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=2 \
+-drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,format=raw,if=none,\
+id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 \
+-drive if=none,id=drive-ide0-1-1,readonly=on \
+-device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
new file mode 100644
index 00..4c5a599820
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-cdrom.x86_64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon 

[libvirt] [PATCH 13/24] tests: qemu: Unify iscsi disk source testing

2018-07-19 Thread Peter Krempa
Move various different iSCSI configuration into one test file.

Signed-off-by: Peter Krempa 
---
 .../qemuxml2argvdata/disk-network-iscsi-auth.args  | 34 
 tests/qemuxml2argvdata/disk-network-iscsi-auth.xml | 43 
 tests/qemuxml2argvdata/disk-network-iscsi-lun.args | 29 -
 tests/qemuxml2argvdata/disk-network-iscsi-lun.xml  | 28 -
 tests/qemuxml2argvdata/disk-network-iscsi.args | 21 --
 tests/qemuxml2argvdata/disk-network-iscsi.xml  | 28 +
 tests/qemuxml2argvtest.c   |  6 +--
 .../qemuxml2xmloutdata/disk-network-iscsi-auth.xml | 47 --
 tests/qemuxml2xmloutdata/disk-network-iscsi.xml| 37 -
 tests/qemuxml2xmltest.c|  3 +-
 10 files changed, 83 insertions(+), 193 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-auth.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-auth.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-lun.args
 delete mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-lun.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-network-iscsi-auth.xml

diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-auth.args 
b/tests/qemuxml2argvdata/disk-network-iscsi-auth.args
deleted file mode 100644
index 423b6b2a8f..00
--- a/tests/qemuxml2argvdata/disk-network-iscsi-auth.args
+++ /dev/null
@@ -1,34 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=iscsi://myname:aqcvn5ho6hzfahaaq0ncv8jtjcice+hoblm...@example.org:\
-6000/iqn.1992-01.com.example%3Astorage/1,format=raw,if=none,\
-id=drive-virtio-disk0 \
--device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
-id=virtio-disk0 \
--drive file=iscsi://myname:aqcvn5ho6hzfahaaq0ncv8jtjcice+hoblm...@example.org:\
-6000/iqn.1992-01.com.example%3Astorage/2,format=raw,if=none,\
-id=drive-virtio-disk1 \
--device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
-id=virtio-disk1
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-auth.xml 
b/tests/qemuxml2argvdata/disk-network-iscsi-auth.xml
deleted file mode 100644
index 63919f1000..00
--- a/tests/qemuxml2argvdata/disk-network-iscsi-auth.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-
-  
-  
-
-  
-  
-
-
-  
-  
-
-  
-  
-
-  
-  
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-lun.args 
b/tests/qemuxml2argvdata/disk-network-iscsi-lun.args
deleted file mode 100644
index 96601ae29e..00
--- a/tests/qemuxml2argvdata/disk-network-iscsi-lun.args
+++ /dev/null
@@ -1,29 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
--usb \
--drive file=iscsi://example.org:3260/iqn.1992-01.com.example/0,format=raw,\
-if=none,id=drive-scsi0-0-0-0 \
--device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
-drive=drive-scsi0-0-0-0,id=scsi0-0-0-0
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi-lun.xml 
b/tests/qemuxml2argvdata/disk-network-iscsi-lun.xml
deleted file mode 100644
index 3e8408044b..00
--- a/tests/qemuxml2argvdata/disk-network-iscsi-lun.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-
-  
-  
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-network-iscsi.args 
b/tests/qemuxml2argvdata/disk-network-iscsi.args
index 8cf2810b7f..f68296586d 100644
--- a/tests/qemuxml2argvdata/disk-network-iscsi.args
+++ 

[libvirt] [PATCH 10/24] tests: qemuxml2argv: Rename disk-write-cache test do disk-cache

2018-07-19 Thread Peter Krempa
We'll agregate testing of all cache modes in this test later on.

Signed-off-by: Peter Krempa 
---
 ...k-write-cache.x86_64-2.6.0.args => disk-cache.x86_64-2.6.0.args} | 0
 ...k-write-cache.x86_64-2.7.0.args => disk-cache.x86_64-2.7.0.args} | 0
 ...write-cache.x86_64-latest.args => disk-cache.x86_64-latest.args} | 0
 tests/qemuxml2argvdata/{disk-write-cache.xml => disk-cache.xml} | 0
 tests/qemuxml2argvtest.c| 6 +++---
 5 files changed, 3 insertions(+), 3 deletions(-)
 rename tests/qemuxml2argvdata/{disk-write-cache.x86_64-2.6.0.args => 
disk-cache.x86_64-2.6.0.args} (100%)
 rename tests/qemuxml2argvdata/{disk-write-cache.x86_64-2.7.0.args => 
disk-cache.x86_64-2.7.0.args} (100%)
 rename tests/qemuxml2argvdata/{disk-write-cache.x86_64-latest.args => 
disk-cache.x86_64-latest.args} (100%)
 rename tests/qemuxml2argvdata/{disk-write-cache.xml => disk-cache.xml} (100%)

diff --git a/tests/qemuxml2argvdata/disk-write-cache.x86_64-2.6.0.args 
b/tests/qemuxml2argvdata/disk-cache.x86_64-2.6.0.args
similarity index 100%
rename from tests/qemuxml2argvdata/disk-write-cache.x86_64-2.6.0.args
rename to tests/qemuxml2argvdata/disk-cache.x86_64-2.6.0.args
diff --git a/tests/qemuxml2argvdata/disk-write-cache.x86_64-2.7.0.args 
b/tests/qemuxml2argvdata/disk-cache.x86_64-2.7.0.args
similarity index 100%
rename from tests/qemuxml2argvdata/disk-write-cache.x86_64-2.7.0.args
rename to tests/qemuxml2argvdata/disk-cache.x86_64-2.7.0.args
diff --git a/tests/qemuxml2argvdata/disk-write-cache.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args
similarity index 100%
rename from tests/qemuxml2argvdata/disk-write-cache.x86_64-latest.args
rename to tests/qemuxml2argvdata/disk-cache.x86_64-latest.args
diff --git a/tests/qemuxml2argvdata/disk-write-cache.xml 
b/tests/qemuxml2argvdata/disk-cache.xml
similarity index 100%
rename from tests/qemuxml2argvdata/disk-write-cache.xml
rename to tests/qemuxml2argvdata/disk-cache.xml
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 09b9e206cc..6f6b5869b3 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1037,9 +1037,9 @@ mymain(void)
 DO_TEST("disk-cache-v2-none", NONE);
 DO_TEST("disk-cache-directsync", NONE);
 DO_TEST("disk-cache-unsafe", NONE);
-DO_TEST_CAPS_VER("disk-write-cache", "2.6.0");
-DO_TEST_CAPS_VER("disk-write-cache", "2.7.0");
-DO_TEST_CAPS_LATEST("disk-write-cache");
+DO_TEST_CAPS_VER("disk-cache", "2.6.0");
+DO_TEST_CAPS_VER("disk-cache", "2.7.0");
+DO_TEST_CAPS_LATEST("disk-cache");
 DO_TEST("disk-network-nbd", NONE);
 DO_TEST("disk-network-nbd-export", NONE);
 DO_TEST("disk-network-nbd-ipv6", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 06/24] tests: qemuxml2argv: Unify testing of local cdroms

2018-07-19 Thread Peter Krempa
Test empty cdroms along with cdroms with medium.

Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-cdrom-empty.args  | 28 ---
 tests/qemuxml2argvdata/disk-cdrom-empty.xml   | 36 
 tests/qemuxml2argvdata/disk-cdrom.args|  4 ++-
 tests/qemuxml2argvdata/disk-cdrom.xml |  6 
 tests/qemuxml2argvtest.c  |  1 -
 tests/qemuxml2xmloutdata/disk-cdrom-empty.xml | 40 ---
 tests/qemuxml2xmloutdata/disk-cdrom.xml   |  6 
 tests/qemuxml2xmltest.c   |  1 -
 8 files changed, 15 insertions(+), 107 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-empty.xml

diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty.args 
b/tests/qemuxml2argvdata/disk-cdrom-empty.args
deleted file mode 100644
index 1cbc76ab86..00
--- a/tests/qemuxml2argvdata/disk-cdrom-empty.args
+++ /dev/null
@@ -1,28 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive if=none,id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty.xml 
b/tests/qemuxml2argvdata/disk-cdrom-empty.xml
deleted file mode 100644
index 7de5a6ebf5..00
--- a/tests/qemuxml2argvdata/disk-cdrom-empty.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219100
-  219100
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-cdrom.args 
b/tests/qemuxml2argvdata/disk-cdrom.args
index 55a76f6dac..2bef3bd71e 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.args
@@ -26,4 +26,6 @@ server,nowait \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
 -drive file=/root/boot.iso,format=raw,if=none,id=drive-ide0-1-0,media=cdrom,\
 readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0
+-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-drive if=none,id=drive-ide0-1-1,media=cdrom,readonly=on \
+-device ide-drive,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1
diff --git a/tests/qemuxml2argvdata/disk-cdrom.xml 
b/tests/qemuxml2argvdata/disk-cdrom.xml
index 341025c477..be229657f7 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom.xml
@@ -27,6 +27,12 @@
   
   
 
+
+  
+  
+  
+  
+
 
 
 
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 44b6245747..0eac624ebf 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -991,7 +991,6 @@ mymain(void)
 DO_TEST("disk-cdrom", NONE);
 DO_TEST("disk-iscsi", NONE);
 DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM);
-DO_TEST("disk-cdrom-empty", NONE);
 DO_TEST("disk-cdrom-tray",
 QEMU_CAPS_VIRTIO_TX_ALG);
 DO_TEST("disk-floppy", NONE);
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml 
b/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml
deleted file mode 100644
index 26ce476557..00
--- a/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219100
-  219100
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-  
-
-
-  
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom.xml 
b/tests/qemuxml2xmloutdata/disk-cdrom.xml
index 163ce88f19..e96c94097a 100644
--- a/tests/qemuxml2xmloutdata/disk-cdrom.xml
+++ b/tests/qemuxml2xmloutdata/disk-cdrom.xml
@@ -27,6 +27,12 @@
   
   
 
+
+  
+  
+  
+  
+
 
   
 
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 6fcadab66b..904b86571f 100644
--- a/tests/qemuxml2xmltest.c
+++ 

[libvirt] [PATCH 08/24] tests: qemuxml2argv: Add 'CAPS_LATEST' version for 'disk-detect-zeroes'

2018-07-19 Thread Peter Krempa
This test also excercises options of 'discard'.

Signed-off-by: Peter Krempa 
---
 .../disk-detect-zeroes.x86_64-latest.args  | 37 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args
new file mode 100644
index 00..101c0f2e65
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-detect-zeroes.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-test/master-key.aes \
+-machine pc-0.13,accel=tcg,usb=off,dump-guest-core=off \
+-m 1024 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 92d7a226-cfae-425b-a6d3-00bbf9ec5c9e \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot menu=on,strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/var/lib/libvirt/images/f14.img,format=qcow2,if=none,\
+id=drive-virtio-disk0,discard=unmap,detect-zeroes=unmap \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=2 \
+-drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,format=raw,if=none,\
+id=drive-ide0-1-0,readonly=on,discard=ignore,detect-zeroes=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 6a190461e7..518ea63ecf 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1130,6 +1130,7 @@ mymain(void)
 DO_TEST("disk-detect-zeroes",
 QEMU_CAPS_DRIVE_DISCARD,
 QEMU_CAPS_DRIVE_DETECT_ZEROES);
+DO_TEST_CAPS_LATEST("disk-detect-zeroes");
 DO_TEST("disk-snapshot", NONE);
 DO_TEST_PARSE_ERROR("disk-same-targets",
 QEMU_CAPS_SCSI_LSI,
-- 
2.16.2

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


[libvirt] [PATCH 09/24] tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-aio' test

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-aio.x86_64-latest.args | 37 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-aio.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args
new file mode 100644
index 00..3894ed2502
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-aio.x86_64-latest.args
@@ -0,0 +1,37 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-i686 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
+-m 214 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-drive file=/dev/HostVG/QEMUGuest1,format=qcow2,if=none,id=drive-ide0-0-0,\
+cache=none,aio=native \
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1,\
+write-cache=on \
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-1-0,\
+readonly=on,aio=threads \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 518ea63ecf..09b9e206cc 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1115,6 +1115,7 @@ mymain(void)
 DO_TEST("disk-sata-device",
 QEMU_CAPS_ICH9_AHCI);
 DO_TEST("disk-aio", NONE);
+DO_TEST_CAPS_LATEST("disk-aio");
 DO_TEST("disk-source-pool", NONE);
 DO_TEST("disk-source-pool-mode", NONE);
 DO_TEST("disk-ioeventfd",
-- 
2.16.2

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


[libvirt] [PATCH 05/24] tests: qemuxml2argv: Unify network cdrom source testing

2018-07-19 Thread Peter Krempa
Unify most of the tests into a common test named disk-cdrom-network by
adding multiple cdroms. The 'http' test is dropped since there can be
only 4 cdroms.

Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args | 27 
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml  | 36 --
 .../qemuxml2argvdata/disk-cdrom-network-ftps.args  | 27 
 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml | 36 --
 .../qemuxml2argvdata/disk-cdrom-network-http.args  | 27 
 tests/qemuxml2argvdata/disk-cdrom-network-http.xml | 36 --
 .../qemuxml2argvdata/disk-cdrom-network-tftp.args  | 27 
 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml | 36 --
 ...-network-https.args => disk-cdrom-network.args} |  9 ++
 ...om-network-https.xml => disk-cdrom-network.xml} | 27 
 tests/qemuxml2argvtest.c   |  6 +---
 11 files changed, 37 insertions(+), 257 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml
 rename tests/qemuxml2argvdata/{disk-cdrom-network-https.args => 
disk-cdrom-network.args} (58%)
 rename tests/qemuxml2argvdata/{disk-cdrom-network-https.xml => 
disk-cdrom-network.xml} (52%)

diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args 
b/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
deleted file mode 100644
index e9eab22aaf..00
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=ftp://host.name:21/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml 
b/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
deleted file mode 100644
index b4e3311606..00
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  1048576
-  1048576
-  1
-  
-hvm
-
-  
-  
-
-
-
-  
-  
-  destroy
-  restart
-  restart
-  
-/usr/bin/qemu-system-x86_64
-
-  
-  
-
-  
-  
-  
-  
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args 
b/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
deleted file mode 100644
index d334f7938f..00
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml 
b/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
deleted file mode 100644
index 4e6ca1bad1..00
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  1048576
-  1048576
-  1
-  
-hvm
-
-  
-  
-
-
-
-  
-  
-  destroy
-  restart
-  restart
-  
-/usr/bin/qemu-system-x86_64
-
-   

[libvirt] [PATCH 04/24] tests: qemuxml2argv: Remove tests obsoleted by assuming support for '-device'

2018-07-19 Thread Peter Krempa
Few disk tests were testing support for pure -drive command line
generation for disks now that we assume it for all qemu versions the
cases are obsolete.

Replacements:
disk-readonly-no-device -> disk-readonly-disk
disk-floppy-tray-no-device -> disk-floppy-tray
disk-cdrom-tray-no-device -> disk-cdrom-tray

Signed-off-by: Peter Krempa 
---
 .../disk-cdrom-tray-no-device-cap.args | 29 -
 .../disk-cdrom-tray-no-device-cap.xml  | 32 ---
 .../disk-floppy-tray-no-device-cap.args| 31 --
 .../disk-floppy-tray-no-device-cap.xml | 37 --
 .../qemuxml2argvdata/disk-readonly-no-device.args  | 30 --
 tests/qemuxml2argvdata/disk-readonly-no-device.xml | 32 ---
 tests/qemuxml2argvtest.c   |  3 --
 7 files changed, 194 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.args
 delete mode 100644 tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-readonly-no-device.args
 delete mode 100644 tests/qemuxml2argvdata/disk-readonly-no-device.xml

diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.args 
b/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.args
deleted file mode 100644
index b9bdb6443f..00
--- a/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.args
+++ /dev/null
@@ -1,29 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive if=none,id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.xml 
b/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.xml
deleted file mode 100644
index 77e64448f6..00
--- a/tests/qemuxml2argvdata/disk-cdrom-tray-no-device-cap.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219100
-  219100
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-
-
-  
-  
-  
-  
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.args 
b/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.args
deleted file mode 100644
index a3c6881e98..00
--- a/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.args
+++ /dev/null
@@ -1,31 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive file=/dev/fd0,format=raw,if=none,id=drive-fdc0-0-0 \
--global isa-fdc.driveA=drive-fdc0-0-0 \
--drive if=none,id=drive-fdc0-0-1 \
--global isa-fdc.driveB=drive-fdc0-0-1 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.xml 
b/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.xml
deleted file mode 100644
index 4b9bc1b6c9..00
--- a/tests/qemuxml2argvdata/disk-floppy-tray-no-device-cap.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-
-
-  
-  
-  
-
-
-  
-  
-  
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2argvdata/disk-readonly-no-device.args 

[libvirt] [PATCH 03/24] tests: qemuxml2argv: Add 'CAPS_LATEST' version of "disk-copy_on_read"

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 .../disk-copy_on_read.x86_64-latest.args   | 41 ++
 tests/qemuxml2argvtest.c   |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args

diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
new file mode 100644
index 00..f2b5dbe050
--- /dev/null
+++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args
@@ -0,0 +1,41 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-x86_64 \
+-name guest=test,debug-threads=on \
+-S \
+-object secret,id=masterKey0,format=raw,\
+file=/tmp/lib/domain--1-test/master-key.aes \
+-machine pc-0.13,accel=tcg,usb=off,dump-guest-core=off \
+-m 1024 \
+-realtime mlock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid 468404ad-d49c-40f2-9e14-02294f9c1be3 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-no-acpi \
+-boot menu=on,strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \
+-drive file=/var/lib/libvirt/images/f14.img,format=qcow2,if=none,\
+id=drive-virtio-disk0,copy-on-read=on \
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
+id=virtio-disk0,bootindex=2 \
+-drive file=/var/lib/libvirt/Fedora-14-x86_64-Live-KDE.iso,format=raw,if=none,\
+id=drive-ide0-1-0,readonly=on \
+-device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 \
+-netdev user,id=hostnet0 \
+-device virtio-net-pci,tx=bh,netdev=hostnet0,id=net0,mac=52:54:00:e5:48:58,\
+bus=pci.0,addr=0x2 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
+resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 2708a58d60..8f9dd53214 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1129,6 +1129,7 @@ mymain(void)
 DO_TEST("disk-copy_on_read",
 QEMU_CAPS_VIRTIO_TX_ALG,
 QEMU_CAPS_VIRTIO_BLK_SCSI);
+DO_TEST_CAPS_LATEST("disk-copy_on_read");
 DO_TEST("disk-discard",
 QEMU_CAPS_DRIVE_DISCARD);
 DO_TEST("disk-detect-zeroes",
-- 
2.16.2

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


[libvirt] [PATCH 01/24] tests: qemu: Drop 'drive' from disk tests

2018-07-19 Thread Peter Krempa
Signed-off-by: Peter Krempa 
---
 ...ress-conflict.xml => disk-address-conflict.xml} |  0
 ...-drive-boot-cdrom.args => disk-boot-cdrom.args} |  0
 ...sk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} |  0
 ...sk-drive-boot-disk.args => disk-boot-disk.args} |  0
 ...disk-drive-boot-disk.xml => disk-boot-disk.xml} |  0
 ...-directsync.args => disk-cache-directsync.args} |  0
 ...he-directsync.xml => disk-cache-directsync.xml} |  0
 ...ve-cache-unsafe.args => disk-cache-unsafe.args} |  0
 ...rive-cache-unsafe.xml => disk-cache-unsafe.xml} |  0
 ...-cache-v2-none.args => disk-cache-v2-none.args} |  0
 ...ve-cache-v2-none.xml => disk-cache-v2-none.xml} |  0
 ...rive-cache-v2-wb.args => disk-cache-v2-wb.args} |  0
 ...-drive-cache-v2-wb.xml => disk-cache-v2-wb.xml} |  0
 ...rive-cache-v2-wt.args => disk-cache-v2-wt.args} |  0
 ...-drive-cache-v2-wt.xml => disk-cache-v2-wt.xml} |  0
 ...rive-copy-on-read.xml => disk-copy-on-read.xml} |  0
 ...-detect-zeroes.args => disk-detect-zeroes.args} |  0
 ...ve-detect-zeroes.xml => disk-detect-zeroes.xml} |  0
 .../{disk-drive-discard.args => disk-discard.args} |  0
 .../{disk-drive-discard.xml => disk-discard.xml}   |  0
 ...ve-error-policy.args => disk-error-policy.args} |  0
 ...t.args => disk-error-policy.x86_64-latest.args} |  0
 ...rive-error-policy.xml => disk-error-policy.xml} |  0
 .../{disk-drive-fmt-cow.xml => disk-fmt-cow.xml}   |  0
 .../{disk-drive-fmt-dir.xml => disk-fmt-dir.xml}   |  0
 .../{disk-drive-fmt-iso.xml => disk-fmt-iso.xml}   |  0
 ...disk-drive-fmt-qcow.args => disk-fmt-qcow.args} |  0
 .../{disk-drive-fmt-qcow.xml => disk-fmt-qcow.xml} |  0
 ...sk-ide-drive-split.args => disk-ide-split.args} |  0
 ...disk-ide-drive-split.xml => disk-ide-split.xml} |  0
 ...work-gluster.args => disk-network-gluster.args} |  0
 ...etwork-gluster.xml => disk-network-gluster.xml} |  0
 ...disk-network-iscsi-auth-secrettype-invalid.xml} |  0
 ...> disk-network-iscsi-auth-wrong-secrettype.xml} |  0
 ...scsi-auth.args => disk-network-iscsi-auth.args} |  0
 ...-iscsi-auth.xml => disk-network-iscsi-auth.xml} |  0
 ...-iscsi-lun.args => disk-network-iscsi-lun.args} |  0
 ...rk-iscsi-lun.xml => disk-network-iscsi-lun.xml} |  0
 ...-network-iscsi.args => disk-network-iscsi.args} |  0
 ...ve-network-iscsi.xml => disk-network-iscsi.xml} |  0
 ...bd-export.args => disk-network-nbd-export.args} |  0
 ...-nbd-export.xml => disk-network-nbd-export.xml} |  0
 ...port.args => disk-network-nbd-ipv6-export.args} |  0
 ...export.xml => disk-network-nbd-ipv6-export.xml} |  0
 ...rk-nbd-ipv6.args => disk-network-nbd-ipv6.args} |  0
 ...work-nbd-ipv6.xml => disk-network-nbd-ipv6.xml} |  0
 ...rk-nbd-unix.args => disk-network-nbd-unix.args} |  0
 ...work-nbd-unix.xml => disk-network-nbd-unix.xml} |  0
 ...rive-network-nbd.args => disk-network-nbd.args} |  0
 ...-drive-network-nbd.xml => disk-network-nbd.xml} |  0
 ...uth-AES.args => disk-network-rbd-auth-AES.args} |  0
 ...-auth-AES.xml => disk-network-rbd-auth-AES.xml} |  0
 ...rk-rbd-auth.args => disk-network-rbd-auth.args} |  0
 ...work-rbd-auth.xml => disk-network-rbd-auth.xml} |  0
 ...eph-env.args => disk-network-rbd-ceph-env.args} |  0
 ...-ceph-env.xml => disk-network-rbd-ceph-env.xml} |  0
 ...rk-rbd-ipv6.args => disk-network-rbd-ipv6.args} |  0
 ...work-rbd-ipv6.xml => disk-network-rbd-ipv6.xml} |  0
 ...-no-colon.xml => disk-network-rbd-no-colon.xml} |  0
 ...rive-network-rbd.args => disk-network-rbd.args} |  0
 ...-drive-network-rbd.xml => disk-network-rbd.xml} |  0
 ...rk-sheepdog.args => disk-network-sheepdog.args} |  0
 ...work-sheepdog.xml => disk-network-sheepdog.xml} |  0
 ...-both.xml => disk-network-source-auth-both.xml} |  0
 ...rce-auth.args => disk-network-source-auth.args} |  0
 ...ource-auth.xml => disk-network-source-auth.xml} |  0
 ...work-tlsx509.args => disk-network-tlsx509.args} |  0
 ...etwork-tlsx509.xml => disk-network-tlsx509.xml} |  0
 ...ve-network-vxhs.args => disk-network-vxhs.args} |  0
 ...rive-network-vxhs.xml => disk-network-vxhs.xml} |  0
 .../{disk-drive-no-boot.args => disk-no-boot.args} |  0
 .../{disk-drive-no-boot.xml => disk-no-boot.xml}   |  0
 ...-readonly-disk.args => disk-readonly-disk.args} |  0
 ...ve-readonly-disk.xml => disk-readonly-disk.xml} |  0
 ...no-device.args => disk-readonly-no-device.args} |  0
 ...y-no-device.xml => disk-readonly-no-device.xml} |  0
 ...hared-locking.args => disk-shared-locking.args} |  0
 ...-shared-locking.xml => disk-shared-locking.xml} |  0
 ...-drive-shared-qcow.xml => disk-shared-qcow.xml} |  0
 .../{disk-drive-shared.args => disk-shared.args}   |  0
 .../{disk-drive-shared.xml => disk-shared.xml} |  0
 ...o-drive-queues.args => disk-virtio-queues.args} |  0
 ...tio-drive-queues.xml => disk-virtio-queues.xml} |  0
 ...6.0.args => disk-write-cache.x86_64-2.6.0.args} |  0
 ...7.0.args => disk-write-cache.x86_64-2.7.0.args} |  0
 ...st.args => disk-write-cache.x86_64-latest.args} |  0
 ...-drive-write-cache.xml => disk-write-cache.xml} |  0
 

[libvirt] [PATCH 02/24] tests: qemuxml2xml: Remove duplicate test disk-copy-on-read.xml

2018-07-19 Thread Peter Krempa
We also have disk-copy_on_read.xml which also tests the command line.

Signed-off-by: Peter Krempa 
---
 tests/qemuxml2argvdata/disk-copy-on-read.xml   | 30 -
 tests/qemuxml2xmloutdata/disk-copy-on-read.xml | 36 --
 tests/qemuxml2xmltest.c|  1 -
 3 files changed, 67 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-copy-on-read.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-copy-on-read.xml

diff --git a/tests/qemuxml2argvdata/disk-copy-on-read.xml 
b/tests/qemuxml2argvdata/disk-copy-on-read.xml
deleted file mode 100644
index 1177b642ad..00
--- a/tests/qemuxml2argvdata/disk-copy-on-read.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-
-
-
-
-
-  
-
diff --git a/tests/qemuxml2xmloutdata/disk-copy-on-read.xml 
b/tests/qemuxml2xmloutdata/disk-copy-on-read.xml
deleted file mode 100644
index 69361a453a..00
--- a/tests/qemuxml2xmloutdata/disk-copy-on-read.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-  QEMUGuest1
-  c7a5fdbd-edaf-9455-926a-d65c16db1809
-  219136
-  219136
-  1
-  
-hvm
-
-  
-  
-  destroy
-  restart
-  destroy
-  
-/usr/bin/qemu-system-i686
-
-  
-  
-  
-  
-
-
-  
-
-
-  
-
-
-
-
-
-  
-
-  
-
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 0373117f06..6fcadab66b 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -358,7 +358,6 @@ mymain(void)
 DO_TEST("disk-boot-cdrom", NONE);
 DO_TEST("disk-error-policy", NONE);
 DO_TEST("disk-fmt-qcow", NONE);
-DO_TEST("disk-copy-on-read", NONE);
 DO_TEST("disk-cache-v2-wt", NONE);
 DO_TEST("disk-cache-v2-wb", NONE);
 DO_TEST("disk-cache-v2-none", NONE);
-- 
2.16.2

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


[libvirt] [PATCH 00/24] tests: qemu: Clean up disk testing (blockdev-add saga)

2018-07-19 Thread Peter Krempa
Clean up many test files and add CAPS_LATEST versions of tests which
will change when we switch from -drive to -blockdev

This series removes many duplicated and obsolete tests and adds much
more useful CAPS_LATEST testing

Peter Krempa (24):
  tests: qemu: Drop 'drive' from disk tests
  tests: qemuxml2xml: Remove duplicate test disk-copy-on-read.xml
  tests: qemuxml2argv: Add 'CAPS_LATEST' version of "disk-copy_on_read"
  tests: qemuxml2argv: Remove tests obsoleted by assuming support for
'-device'
  tests: qemuxml2argv: Unify network cdrom source testing
  tests: qemuxml2argv: Unify testing of local cdroms
  tests: qemuxml2argv: Add 'CAPS_LATEST' data for disk-cdrom* tests
  tests: qemuxml2argv: Add 'CAPS_LATEST' version for
'disk-detect-zeroes'
  tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-aio' test
  tests: qemuxml2argv: Rename disk-write-cache test do disk-cache
  tests: qemu: Add xml2xml and minimal version of 'disk-cache' test
  tests: qemu: Unify disk cache testing
  tests: qemu: Unify iscsi disk source testing
  tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-iscsi'
  tests: qemu: Unify nbd disk source testing
  tests: qemuxml2argv: Add 'CAPS_LATEST' version of 'disk-network-nbd'
  tests: qemu: Remove pointless 'disk-networ-ceph-env' test
  tests: qemuxml2argv: Unify testing of 'disk-network-rbd'
  tests: qemu: Remove pointless 'disks-many' test
  tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-floppy' and
'floppy-drive-fat'
  tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-readonly' and
'disk-shared'
  tests: qemuxml2argv: Add CAPS_LATEST version of 'disk-network-gluster'
  tests: qemuxml2argv: Add CAPS_LATEST version of
'disk-network-sheepdog'
  tests: qemuxml2argv: Add CAPS_LATEST version of security-related tests

 ...ress-conflict.xml => disk-address-conflict.xml} |   0
 tests/qemuxml2argvdata/disk-aio.x86_64-latest.args |  37 +++
 ...-drive-boot-cdrom.args => disk-boot-cdrom.args} |   0
 ...sk-drive-boot-cdrom.xml => disk-boot-cdrom.xml} |   0
 ...sk-drive-boot-disk.args => disk-boot-disk.args} |   0
 ...disk-drive-boot-disk.xml => disk-boot-disk.xml} |   0
 tests/qemuxml2argvdata/disk-cache.args |  41 
 ..._64-2.6.0.args => disk-cache.x86_64-2.6.0.args} |   3 +
 ..._64-2.7.0.args => disk-cache.x86_64-2.7.0.args} |   4 +
 ...4-latest.args => disk-cache.x86_64-latest.args} |   4 +
 .../{disk-drive-write-cache.xml => disk-cache.xml} |   6 ++
 tests/qemuxml2argvdata/disk-cdrom-empty.args   |  28 --
 tests/qemuxml2argvdata/disk-cdrom-empty.xml|  36 ---
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args |  27 -
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml  |  36 ---
 .../qemuxml2argvdata/disk-cdrom-network-ftps.args  |  27 -
 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml |  36 ---
 .../qemuxml2argvdata/disk-cdrom-network-http.args  |  27 -
 tests/qemuxml2argvdata/disk-cdrom-network-http.xml |  36 ---
 .../qemuxml2argvdata/disk-cdrom-network-tftp.args  |  27 -
 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml |  36 ---
 ...-network-https.args => disk-cdrom-network.args} |   9 ++
 .../disk-cdrom-network.x86_64-latest.args  |  41 
 ...om-network-https.xml => disk-cdrom-network.xml} |  27 +
 .../disk-cdrom-tray-no-device-cap.args |  29 --
 .../disk-cdrom-tray-no-device-cap.xml  |  32 --
 .../disk-cdrom-tray.x86_64-latest.args |  39 +++
 tests/qemuxml2argvdata/disk-cdrom.args |   4 +-
 .../qemuxml2argvdata/disk-cdrom.x86_64-latest.args |  35 +++
 tests/qemuxml2argvdata/disk-cdrom.xml  |   6 ++
 .../disk-copy_on_read.x86_64-latest.args   |  41 
 ...-detect-zeroes.args => disk-detect-zeroes.args} |   0
 .../disk-detect-zeroes.x86_64-latest.args  |  37 +++
 ...ve-detect-zeroes.xml => disk-detect-zeroes.xml} |   0
 .../{disk-drive-discard.args => disk-discard.args} |   0
 .../{disk-drive-discard.xml => disk-discard.xml}   |   0
 .../disk-drive-cache-directsync.args   |  30 --
 .../disk-drive-cache-directsync.xml|  37 ---
 .../qemuxml2argvdata/disk-drive-cache-unsafe.args  |  30 --
 tests/qemuxml2argvdata/disk-drive-cache-unsafe.xml |  37 ---
 .../qemuxml2argvdata/disk-drive-cache-v2-none.args |  30 --
 .../qemuxml2argvdata/disk-drive-cache-v2-none.xml  |  37 ---
 tests/qemuxml2argvdata/disk-drive-cache-v2-wb.args |  30 --
 tests/qemuxml2argvdata/disk-drive-cache-v2-wb.xml  |  37 ---
 tests/qemuxml2argvdata/disk-drive-cache-v2-wt.args |  30 --
 tests/qemuxml2argvdata/disk-drive-cache-v2-wt.xml  |  37 ---
 tests/qemuxml2argvdata/disk-drive-copy-on-read.xml |  30 --
 .../disk-drive-network-iscsi-lun.args  |  29 --
 .../disk-drive-network-iscsi-lun.xml   |  28 --
 .../qemuxml2argvdata/disk-drive-network-iscsi.args |  32 --
 

Re: [libvirt] [PATCH v2 6/6] rpc: Fix name of include guard

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> The include guard should match the file name and comment.
> 
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> ---
>  src/rpc/virnetserverprogram.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: John Ferlan 

John

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


Re: [libvirt] [PATCH v2 5/6] virt-admin: Fix two error messages

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> ---
>  tools/virt-admin.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Reviewed-by: John Ferlan 

John

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


Re: [libvirt] [PATCH v2 3/6] virThreadPool: Prevent switching between zero and non-zero maxWorkers

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> ...since maxWorkers=0 is only intended for virtlockd or virlogd which
> must not be multithreaded.
> 
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> Reviewed-by: Bjoern Walk 
> ---
>  src/util/virthreadpool.c | 8 
>  1 file changed, 8 insertions(+)
> 

I think this is separable - this could be pushed regardless of the
outcome of patch2, right? Let me know - I can reduce the load the next
update based on patch2 comments.

Reviewed-by: John Ferlan 

John

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


Re: [libvirt] [PATCH v2 4/6] daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> Hypervisor drivers (e.g. QEMU) assume that they run in a separate
> thread from the main event loop thread otherwise deadlocks can
> occur. Therefore let's report an error if max_workers < 1 is set in
> the libvirtd configuration file.
> 
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> Reviewed-by: Bjoern Walk 
> ---
>  src/remote/remote_daemon_config.c | 5 +
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: John Ferlan 

John

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


Re: [libvirt] [PATCH v2 2/6] rpc: Initialize a worker pool for max_workers=0 as well

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> Semantically, there is no difference between an uninitialized worker
> pool and an initialized worker pool with zero workers. Let's allow the
> worker pool to be initialized for max_workers=0 as well then which
> makes the API more symmetric and simplifies code. Validity of the
> worker pool is delegated to virThreadPoolGetMaxWorkersLocked instead.
> 
> This patch fixes segmentation faults in
> virNetServerGetThreadPoolParameters and
> virNetServerSetThreadPoolParameters for the case when no worker pool
> is actually initialized (max_workers=0).
> 
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> Reviewed-by: Bjoern Walk 
> ---
>  src/libvirt_private.syms |  4 +++
>  src/rpc/virnetserver.c   | 13 -
>  src/util/virthreadpool.c | 73 
> 
>  src/util/virthreadpool.h |  8 ++
>  4 files changed, 73 insertions(+), 25 deletions(-)
> 

So it seems there's multiple things going on in this patch - maybe
they're semantically tied and I'm missing it ;-)...

The virNetServerNew to not inhibit the call to virThreadPoolNew if
max_workers == 0 would seem to be easily separable with the other places
that would check if srv->workers == NULL before continuing.

I don't understand why virNetServerDispatchNewMessage needs anything
more than if (virThreadPoolGetMaxWorkers(srv->workers)

If I think back to the previous patch, then why not:

size_t workers = 0;
...

if (srv->workers)
workers = virThreadPoolGetMaxWorkers(srv->workers);

/* we can unlock @srv since @prog can only become invalid in case
 * of disposing @srv, but let's grab a ref first to ensure nothing
 * else disposes of it before we use it. */
virObjectRef(srv);
virObjectUnlock(srv);

if (workers > 0) {
...

In the long run, I don't think it's been the desire to expose so many
virthreadpool.c API's - especially the locks.

John

> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index ffe5dfd19b11..aa496ddf8012 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -3005,11 +3005,15 @@ virThreadPoolGetCurrentWorkers;
>  virThreadPoolGetFreeWorkers;
>  virThreadPoolGetJobQueueDepth;
>  virThreadPoolGetMaxWorkers;
> +virThreadPoolGetMaxWorkersLocked;
>  virThreadPoolGetMinWorkers;
>  virThreadPoolGetPriorityWorkers;
> +virThreadPoolLock;
>  virThreadPoolNewFull;
>  virThreadPoolSendJob;
> +virThreadPoolSendJobLocked;
>  virThreadPoolSetParameters;
> +virThreadPoolUnlock;
>  
>  
>  # util/virtime.h
> diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
> index 091e3ef23406..fdee08fee7cd 100644
> --- a/src/rpc/virnetserver.c
> +++ b/src/rpc/virnetserver.c
> @@ -203,7 +203,8 @@ virNetServerDispatchNewMessage(virNetServerClientPtr 
> client,
>   * of disposing @srv */
>  virObjectUnlock(srv);
>  
> -if (srv->workers) {
> +virThreadPoolLock(srv->workers);
> +if (virThreadPoolGetMaxWorkersLocked(srv->workers) > 0)  {
>  virNetServerJobPtr job;
>  
>  if (VIR_ALLOC(job) < 0)
> @@ -218,7 +219,7 @@ virNetServerDispatchNewMessage(virNetServerClientPtr 
> client,
>  }
>  
>  virObjectRef(client);
> -if (virThreadPoolSendJob(srv->workers, priority, job) < 0) {
> +if (virThreadPoolSendJobLocked(srv->workers, priority, job) < 0) {
>  virObjectUnref(client);
>  VIR_FREE(job);
>  virObjectUnref(prog);
> @@ -228,10 +229,12 @@ virNetServerDispatchNewMessage(virNetServerClientPtr 
> client,
>  if (virNetServerProcessMsg(srv, client, prog, msg) < 0)
>  goto error;
>  }
> +virThreadPoolUnlock(srv->workers);
>  
>  return;
>  
>   error:
> +virThreadPoolUnlock(srv->workers);
>  virNetMessageFree(msg);
>  virNetServerClientClose(client);
>  }
> @@ -363,8 +366,7 @@ virNetServerPtr virNetServerNew(const char *name,
>  if (!(srv = virObjectLockableNew(virNetServerClass)))
>  return NULL;
>  
> -if (max_workers &&
> -!(srv->workers = virThreadPoolNew(min_workers, max_workers,
> +if (!(srv->workers = virThreadPoolNew(min_workers, max_workers,
>priority_workers,
>virNetServerHandleJob,
>srv)))
> @@ -575,21 +577,18 @@ virJSONValuePtr 
> virNetServerPreExecRestart(virNetServerPtr srv)
>  goto error;
>  
>  if (virJSONValueObjectAppendNumberUint(object, "min_workers",
> -   srv->workers == NULL ? 0 :
> 
> virThreadPoolGetMinWorkers(srv->workers)) < 0) {
>  virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> _("Cannot set min_workers data in JSON document"));
>  goto error;
>  }
>  if (virJSONValueObjectAppendNumberUint(object, "max_workers",
> 

Re: [libvirt] [PATCH v2 1/6] rpc: Fix deadlock if there is no worker pool available

2018-07-19 Thread John Ferlan



On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> @srv must be unlocked for the call virNetServerProcessMsg otherwise a
> deadlock can occur.
> 
> Since the pointer 'srv->workers' will never be changed after
> initialization and the thread pool has it's own locking we can release
> the lock of 'srv' earlier. This also fixes the deadlock.
> 
> Signed-off-by: Marc Hartmayer 
> Reviewed-by: Boris Fiuczynski 
> Reviewed-by: Bjoern Walk 
> ---
>  src/rpc/virnetserver.c | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
> index 5c7f7dd08fe1..091e3ef23406 100644
> --- a/src/rpc/virnetserver.c
> +++ b/src/rpc/virnetserver.c
> @@ -51,6 +51,7 @@ struct _virNetServer {
>  
>  char *name;
>  
> +/* Immutable pointer, self-locking APIs */
>  virThreadPoolPtr workers;
>  
>  char *mdnsGroupName;
> @@ -177,9 +178,11 @@ static void virNetServerHandleJob(void *jobOpaque, void 
> *opaque)
>  VIR_FREE(job);
>  }
>  
> -static void virNetServerDispatchNewMessage(virNetServerClientPtr client,
> -   virNetMessagePtr msg,
> -   void *opaque)
> +
> +static void
> +virNetServerDispatchNewMessage(virNetServerClientPtr client,
> +   virNetMessagePtr msg,
> +   void *opaque)
>  {
>  virNetServerPtr srv = opaque;
>  virNetServerProgramPtr prog = NULL;
> @@ -196,6 +199,9 @@ static void 
> virNetServerDispatchNewMessage(virNetServerClientPtr client,
>  break;
>  }
>  }

Should we grab an object reference then to avoid the chance that
something disposes srv right after it's unlocked? And then Unref instead
of Unlock later on?

Following virThreadPoolSendJob finds that it'll grab the srv->workers
pool mutex and check the quit flag before adding a job to and of course
as you point out virNetServerProcessMsg would eventually assume that the
server is unlocked in virNetServerProgramDispatchCall before calling
dispatcher->func.

With a Ref/Unref, I'd feel better and thus consider this,

Reviewed-by: John Ferlan 

John

> +/* we can unlock @srv since @prog can only become invalid in case
> + * of disposing @srv */
> +virObjectUnlock(srv);
>  
>  if (srv->workers) {
>  virNetServerJobPtr job;
> @@ -223,15 +229,14 @@ static void 
> virNetServerDispatchNewMessage(virNetServerClientPtr client,
>  goto error;
>  }
>  
> -virObjectUnlock(srv);
>  return;
>  
>   error:
>  virNetMessageFree(msg);
>  virNetServerClientClose(client);
> -virObjectUnlock(srv);
>  }
>  
> +
>  /**
>   * virNetServerCheckLimits:
>   * @srv: server to check limits on
> 

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


[libvirt] [java PATCH 1/1] Add support for Qemu Guest Agent commands

2018-07-19 Thread Wido den Hollander
Through Qemu we can send commands to a Qemu Guest Agent running inside
a domain.

This way we can communicate with a running Domain by asking for it's
network information, requesting a filesystem trim or even execute a
command inside a Domain.

Commands need to be send as JSON Strings, but these have been wrapped
into the QemuCommand class which has a list of pre-defined and the most
commonly used commands.

RAW commands can also be send for more flexibility.

Signed-off-by: Wido den Hollander 
---
 src/main/java/org/libvirt/Domain.java |  34 ++
 src/main/java/org/libvirt/Library.java|   3 +
 .../java/org/libvirt/jna/LibvirtQemu.java |  16 +++
 .../java/org/libvirt/qemu/QemuCommand.java| 106 ++
 .../org/libvirt/qemu/TestQemuCommand.java |  24 
 5 files changed, 183 insertions(+)
 create mode 100644 src/main/java/org/libvirt/jna/LibvirtQemu.java
 create mode 100644 src/main/java/org/libvirt/qemu/QemuCommand.java
 create mode 100644 src/test/java/org/libvirt/qemu/TestQemuCommand.java

diff --git a/src/main/java/org/libvirt/Domain.java 
b/src/main/java/org/libvirt/Domain.java
index 83a500c..9138238 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -8,6 +8,7 @@ import org.libvirt.jna.CString;
 import org.libvirt.jna.DomainPointer;
 import org.libvirt.jna.DomainSnapshotPointer;
 import org.libvirt.jna.Libvirt;
+import org.libvirt.jna.LibvirtQemu;
 import org.libvirt.jna.SizeT;
 import org.libvirt.jna.virDomainBlockInfo;
 import org.libvirt.jna.virDomainBlockStats;
@@ -21,7 +22,9 @@ import org.libvirt.event.RebootListener;
 import org.libvirt.event.LifecycleListener;
 import org.libvirt.event.PMWakeupListener;
 import org.libvirt.event.PMSuspendListener;
+import org.libvirt.qemu.QemuCommand;
 import static org.libvirt.Library.libvirt;
+import static org.libvirt.Library.libvirtqemu;
 import static org.libvirt.ErrorHandler.processError;
 import static org.libvirt.ErrorHandler.processErrorIfZero;
 
@@ -1556,4 +1559,35 @@ public class Domain {
 return processError(libvirt.virDomainUpdateDeviceFlags(VDP, xml, 
flags));
 }
 
+/**
+ * Send a Qemu Guest Agent command to a domain
+ *
+ * @param cmd
+ *The command which has to be send
+ * @param timeout
+ *The timeout for waiting on an answer. See QemuAgentFlags for 
more information.
+ * @param flags
+ *Flags to be send
+ * @return String
+ * @throws LibvirtException
+ */
+public String qemuAgentCommand(QemuCommand command) throws 
LibvirtException {
+return this.qemuAgentCommand(command, 0);
+}
+
+/**
+ * Send a Qemu Guest Agent command to a domain
+ * @see http://wiki.qemu.org/Features/QAPI/GuestAgent;>Qemu 
Documentation
+ * @param command
+ *The command which has to be send
+ * @param timeout
+ *The timeout for waiting on an answer. See QemuAgentFlags for 
more information
+ * @return String
+ * @throws LibvirtException
+ */
+public String qemuAgentCommand(QemuCommand command, int timeout) throws 
LibvirtException {
+CString result = libvirtqemu.virDomainQemuAgentCommand(this.VDP, 
command.toString(), timeout, 0);
+processError(result);
+return result.toString();
+}
 }
diff --git a/src/main/java/org/libvirt/Library.java 
b/src/main/java/org/libvirt/Library.java
index 8e054c6..30f15be 100644
--- a/src/main/java/org/libvirt/Library.java
+++ b/src/main/java/org/libvirt/Library.java
@@ -2,6 +2,7 @@ package org.libvirt;
 
 import org.libvirt.jna.Libvirt;
 import org.libvirt.jna.Libvirt.VirEventTimeoutCallback;
+import org.libvirt.jna.LibvirtQemu;
 import org.libvirt.jna.CString;
 import static org.libvirt.ErrorHandler.processError;
 
@@ -34,6 +35,7 @@ public final class Library {
 };
 
 final static Libvirt libvirt;
+final static LibvirtQemu libvirtqemu;
 
 // an empty string array constant
 // prefer this over creating empty arrays dynamically.
@@ -47,6 +49,7 @@ public final class Library {
 } catch (Exception e) {
 e.printStackTrace();
 }
+libvirtqemu = LibvirtQemu.INSTANCE;
 }
 
 private Library() {}
diff --git a/src/main/java/org/libvirt/jna/LibvirtQemu.java 
b/src/main/java/org/libvirt/jna/LibvirtQemu.java
new file mode 100644
index 000..82213e9
--- /dev/null
+++ b/src/main/java/org/libvirt/jna/LibvirtQemu.java
@@ -0,0 +1,16 @@
+package org.libvirt.jna;
+
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.Platform;
+
+/**
+ * The libvirt Qemu interface which is exposed via JNA
+ */
+
+public interface LibvirtQemu extends Library {
+
+LibvirtQemu INSTANCE = (LibvirtQemu) 
Native.loadLibrary(Platform.isWindows() ? "virt-qemu-0" : "virt-qemu", 
LibvirtQemu.class);
+
+CString virDomainQemuAgentCommand(DomainPointer virDomainPtr, String cmd, 
int timeout, int 

[libvirt] [java PATCH 0/1] *** Add support for sendng Qemu Guest Agent Commands ***

2018-07-19 Thread Wido den Hollander
*** BLURB HERE ***

Wido den Hollander (1):
  Add support for Qemu Guest Agent commands

 src/main/java/org/libvirt/Domain.java |  34 ++
 src/main/java/org/libvirt/Library.java|   3 +
 .../java/org/libvirt/jna/LibvirtQemu.java |  16 +++
 .../java/org/libvirt/qemu/QemuCommand.java| 106 ++
 .../org/libvirt/qemu/TestQemuCommand.java |  24 
 5 files changed, 183 insertions(+)
 create mode 100644 src/main/java/org/libvirt/jna/LibvirtQemu.java
 create mode 100644 src/main/java/org/libvirt/qemu/QemuCommand.java
 create mode 100644 src/test/java/org/libvirt/qemu/TestQemuCommand.java

-- 
2.17.1

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


Re: [libvirt] [PATCH 11/10] qemu: hotplug: Add/remove managed PR objects on media change

2018-07-19 Thread Ján Tomko

On Wed, Jul 18, 2018 at 01:36:54PM +0200, Peter Krempa wrote:

When changing cdrom media we did not handle the managed PR objects thus
we'd either have a stale PR object left behind or the media change would
fail.

Signed-off-by: Peter Krempa 
---

Opps this one was also left behind in the blockdev-add series but
belongs to this posting.

src/qemu/qemu_hotplug.c | 6 ++
1 file changed, 6 insertions(+)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 10/10] qemu: hotplug: Make qemuHotplugWaitForTrayEject reusable

2018-07-19 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:30PM +0200, Peter Krempa wrote:

Remove the issue of the monitor command to the caller so that the
function can be used with the modern approach.

Additionally improve the error message.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 09/10] qemu: hotplug: Extract legacy disk media changing bits

2018-07-19 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:29PM +0200, Peter Krempa wrote:

Prepare for the -blockdev implementation of ejectable media changing by
splitting up the old bits.

Additionally since both callers make sure that the device is a cdrom or
floppy the check is no longer necessary.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 99 +++--
1 file changed, 62 insertions(+), 37 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 08/10] qemu: hotplug: Refactor/simplify PR managed addition to VM

2018-07-19 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:28PM +0200, Peter Krempa wrote:

Similarly to qemuDomainDiskRemoveManagedPR make it enter monitor on
it's own so that it can be reused. Future users will be in the snapshot


its


code and in removable media change code.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 55 ++---
1 file changed, 29 insertions(+), 26 deletions(-)




@@ -619,11 +628,10 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks + 1) < 0)
goto error;

-qemuDomainObjEnterMonitor(driver, vm);
+if (qemuHotplugAttachManagedPR(driver, vm, disk->src, QEMU_ASYNC_JOB_NONE) 
< 0)
+goto error;

-if (managedPrmgrProps &&
-qemuMonitorAddObject(priv->mon, , ) 
< 0)


Both variables are unused after this change.


-goto exit_monitor;
+qemuDomainObjEnterMonitor(driver, vm);

if (qemuHotplugDiskSoureceAttach(priv->mon, diskdata) < 0)
goto exit_monitor;


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 07/10] qemu: hotplug: Simplify removal of managed PR infrastructure on unplug

2018-07-19 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:27PM +0200, Peter Krempa wrote:

Extract the (possible) removal of the PR backend and daemon into a
separate helper which enters monitor on it's own. This simplifies the


its


code and allows reuse of this function in the future e.g. for blockjobs
where removing a image with PR may result into PR not being necessary.

Since the PR is not used often the overhead of entering monitor again
should be negligible.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 49 ++---
1 file changed, 38 insertions(+), 11 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 06/10] qemu: hotplug: Reuse qemuHotplugDiskSourceRemove for disk backend removal

2018-07-19 Thread Ján Tomko

On Tue, Jul 17, 2018 at 02:14:26PM +0200, Peter Krempa wrote:

Add code which will convert a disk definition into
qemuHotplugDiskSourceData and then reuse qemuHotplugDiskSourceRemove to
remove all the backend related objects.

This unifies the detach code as much as possible with the already
existing helpers and will allow reuse this infrastructure when changing
removable disk media.

Signed-off-by: Peter Krempa 
---
src/qemu/qemu_hotplug.c | 129 +++-
1 file changed, 94 insertions(+), 35 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index f1b18fcc7d..3ee74c8e40 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -373,6 +373,96 @@ qemuHotplugDiskSourceDataFree(qemuHotplugDiskSourceDataPtr 
data)
}


+/**
+ * qemuDomainRemoveDiskStorageSourcePrepareData:
+ * @src: disk source structure
+ * @driveAlias: Alias of the -drive backend, the pointer is always consumed
+ *
+ * Prepare qemuBlockStorageSourceAttachDataPtr for detaching a single source
+ * from a VM. If @driveAlias is NULL -blockdev is assumed.
+ */
+static qemuBlockStorageSourceAttachDataPtr
+qemuHotplugRemoveStorageSourcePrepareData(virStorageSourcePtr src,
+  char *driveAlias)
+
+{
+qemuDomainStorageSourcePrivatePtr srcpriv = 
QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src);
+qemuBlockStorageSourceAttachDataPtr data;
+qemuBlockStorageSourceAttachDataPtr ret = NULL;
+
+if (VIR_ALLOC(data) < 0)
+goto cleanup;
+
+if (driveAlias) {
+VIR_STEAL_PTR(data->driveAlias, driveAlias);
+data->driveAdded = true;
+} else {
+data->formatNodeName = src->nodeformat;
+data->formatAttached = true;
+data->storageNodeName = src->nodestorage;
+data->storageAttached = true;
+}
+
+if (src->pr &&
+!virStoragePRDefIsManaged(src->pr) &&
+VIR_STRDUP(data->prmgrAlias, src->pr->mgralias) < 0)
+goto cleanup;
+
+if (VIR_STRDUP(data->tlsAlias, src->tlsAlias) < 0)
+goto cleanup;
+
+if (srcpriv) {
+if (srcpriv->secinfo &&
+srcpriv->secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES &&
+VIR_STRDUP(data->authsecretAlias, srcpriv->secinfo->s.aes.alias) < 
0)
+goto cleanup;
+
+if (srcpriv->encinfo &&
+srcpriv->encinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES &&
+VIR_STRDUP(data->encryptsecretAlias, srcpriv->encinfo->s.aes.alias) 
< 0)
+goto cleanup;
+}
+
+VIR_STEAL_PTR(ret, data);
+
+ cleanup:
+VIR_FREE(driveAlias);
+qemuBlockStorageSourceAttachDataFree(data);
+return ret;
+}
+
+
+static qemuHotplugDiskSourceDataPtr
+qemuHotplugDiskSourceRemovePrepare(virDomainDiskDefPtr disk,
+   virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
+{
+qemuBlockStorageSourceAttachDataPtr backend;
+qemuHotplugDiskSourceDataPtr data;
+qemuHotplugDiskSourceDataPtr ret = NULL;
+char *drivealias = NULL;
+
+if (VIR_ALLOC(data) < 0)
+return NULL;
+
+if (!(drivealias = qemuAliasDiskDriveFromDisk(disk)))
+goto cleanup;
+


qemu/qemu_hotplug.c:447:9: error: variable 'backend' is used uninitialized 
whenever 'if' condition is true
 [-Werror,-Wsometimes-uninitialized]
   if (!(drivealias = qemuAliasDiskDriveFromDisk(disk)))
   ^~~~


+if (!(backend = qemuHotplugRemoveStorageSourcePrepareData(disk->src,
+  drivealias)))
+goto cleanup;
+


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [dockerfiles PATCH] Refresh after switch from yajl to jansson

2018-07-19 Thread Andrea Bolognani
The corresponding libvirt-jenkins-ci commit is d2bbe1eee61a.

Signed-off-by: Andrea Bolognani 
---
Pushed under the Dockerfile refresh rule.

 buildenv-centos-7.Dockerfile   | 4 ++--
 buildenv-debian-8.Dockerfile   | 2 +-
 buildenv-debian-9.Dockerfile   | 2 +-
 buildenv-debian-sid.Dockerfile | 2 +-
 buildenv-fedora-27.Dockerfile  | 2 +-
 buildenv-fedora-28.Dockerfile  | 2 +-
 buildenv-fedora-rawhide.Dockerfile | 2 +-
 buildenv-ubuntu-16.Dockerfile  | 2 +-
 buildenv-ubuntu-18.Dockerfile  | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/buildenv-centos-7.Dockerfile b/buildenv-centos-7.Dockerfile
index 5d92bfa..2c4c26d 100644
--- a/buildenv-centos-7.Dockerfile
+++ b/buildenv-centos-7.Dockerfile
@@ -23,6 +23,7 @@ ENV PACKAGES audit-libs-devel \
  gnutls-devel \
  iproute \
  iscsi-initiator-utils \
+ jansson-devel \
  libacl-devel \
  libattr-devel \
  libblkid-devel \
@@ -63,8 +64,7 @@ ENV PACKAGES audit-libs-devel \
  scrub \
  sudo \
  systemtap-sdt-devel \
- vim \
- yajl-devel
+ vim
 RUN yum install -y ${PACKAGES} && \
 yum autoremove -y && \
 yum clean all -y
diff --git a/buildenv-debian-8.Dockerfile b/buildenv-debian-8.Dockerfile
index 0766cc9..8a8c3b0 100644
--- a/buildenv-debian-8.Dockerfile
+++ b/buildenv-debian-8.Dockerfile
@@ -29,6 +29,7 @@ ENV PACKAGES augeas-tools \
  libdevmapper-dev \
  libfuse-dev \
  libgnutls28-dev \
+ libjansson-dev \
  libnetcf-dev \
  libnl-3-dev \
  libnl-route-3-dev \
@@ -50,7 +51,6 @@ ENV PACKAGES augeas-tools \
  libxen-dev \
  libxml2-dev \
  libxml2-utils \
- libyajl-dev \
  lvm2 \
  make \
  nfs-common \
diff --git a/buildenv-debian-9.Dockerfile b/buildenv-debian-9.Dockerfile
index e106574..c3af421 100644
--- a/buildenv-debian-9.Dockerfile
+++ b/buildenv-debian-9.Dockerfile
@@ -29,6 +29,7 @@ ENV PACKAGES augeas-tools \
  libdevmapper-dev \
  libfuse-dev \
  libgnutls28-dev \
+ libjansson-dev \
  libnetcf-dev \
  libnl-3-dev \
  libnl-route-3-dev \
@@ -50,7 +51,6 @@ ENV PACKAGES augeas-tools \
  libxen-dev \
  libxml2-dev \
  libxml2-utils \
- libyajl-dev \
  lvm2 \
  make \
  nfs-common \
diff --git a/buildenv-debian-sid.Dockerfile b/buildenv-debian-sid.Dockerfile
index c3a18be..a922457 100644
--- a/buildenv-debian-sid.Dockerfile
+++ b/buildenv-debian-sid.Dockerfile
@@ -29,6 +29,7 @@ ENV PACKAGES augeas-tools \
  libdevmapper-dev \
  libfuse-dev \
  libgnutls28-dev \
+ libjansson-dev \
  libnetcf-dev \
  libnl-3-dev \
  libnl-route-3-dev \
@@ -50,7 +51,6 @@ ENV PACKAGES augeas-tools \
  libxen-dev \
  libxml2-dev \
  libxml2-utils \
- libyajl-dev \
  lvm2 \
  make \
  nfs-common \
diff --git a/buildenv-fedora-27.Dockerfile b/buildenv-fedora-27.Dockerfile
index 4e5173f..2f35a2e 100644
--- a/buildenv-fedora-27.Dockerfile
+++ b/buildenv-fedora-27.Dockerfile
@@ -27,6 +27,7 @@ ENV PACKAGES audit-libs-devel \
  iproute \
  iproute-tc \
  iscsi-initiator-utils \
+ jansson-devel \
  libacl-devel \
  libattr-devel \
  libblkid-devel \
@@ -71,7 +72,6 @@ ENV PACKAGES audit-libs-devel \
  vim \
  wireshark-devel \
  xen-devel \
- yajl-devel \
  zfs-fuse
 RUN yum install -y ${PACKAGES} && \
 yum autoremove -y && \
diff --git a/buildenv-fedora-28.Dockerfile b/buildenv-fedora-28.Dockerfile
index d051d65..f4f7198 100644
--- a/buildenv-fedora-28.Dockerfile
+++ b/buildenv-fedora-28.Dockerfile
@@ -26,6 +26,7 @@ ENV PACKAGES audit-libs-devel \
  iproute \
  iproute-tc \
  iscsi-initiator-utils \
+ jansson-devel \
  libacl-devel \
  libattr-devel \
  libblkid-devel \
@@ -71,7 +72,6 @@ ENV PACKAGES audit-libs-devel \
  vim \
  wireshark-devel \
  xen-devel \
- yajl-devel \
  zfs-fuse
 RUN yum install -y ${PACKAGES} && \
 yum autoremove -y && \
diff --git a/buildenv-fedora-rawhide.Dockerfile 
b/buildenv-fedora-rawhide.Dockerfile
index 56d59a1..189ea59 100644
--- a/buildenv-fedora-rawhide.Dockerfile
+++ b/buildenv-fedora-rawhide.Dockerfile
@@ -26,6 +26,7 @@ ENV PACKAGES audit-libs-devel \
  iproute \
  iproute-tc \
  iscsi-initiator-utils \
+

Re: [libvirt] [jenkins-ci PATCH 0/4] guests: Replace yajl with jansson

2018-07-19 Thread Erik Skultety
On Thu, Jul 19, 2018 at 11:49:51AM +0200, Andrea Bolognani wrote:
> Andrea Bolognani (4):
>   guests: Install jansson for libvirt
>   guests: Don't install yajl for libvirt
>   guests: Remove yajl mapping
>   guests: Remove yajl kludge
>
>  guests/tasks/kludges.yml |  2 --
>  guests/vars/mappings.yml | 10 +-
>  guests/vars/projects/libvirt.yml |  2 +-
>  3 files changed, 6 insertions(+), 8 deletions(-)

Reviewed-by: Erik Skultety 

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


[libvirt] [jenkins-ci PATCH 3/4] guests: Remove yajl mapping

2018-07-19 Thread Andrea Bolognani
There are no users left.

Signed-off-by: Andrea Bolognani 
---
 guests/vars/mappings.yml | 5 -
 1 file changed, 5 deletions(-)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index eb31131..f6b308a 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -800,11 +800,6 @@ mappings:
 deb: liblzma-dev
 Fedora: xz-static
 
-  yajl:
-deb: libyajl-dev
-pkg: yajl
-rpm: yajl-devel
-
   zfs:
 default: zfs-fuse
 CentOS:
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 0/4] guests: Replace yajl with jansson

2018-07-19 Thread Andrea Bolognani
Andrea Bolognani (4):
  guests: Install jansson for libvirt
  guests: Don't install yajl for libvirt
  guests: Remove yajl mapping
  guests: Remove yajl kludge

 guests/tasks/kludges.yml |  2 --
 guests/vars/mappings.yml | 10 +-
 guests/vars/projects/libvirt.yml |  2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)

-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 2/4] guests: Don't install yajl for libvirt

2018-07-19 Thread Andrea Bolognani
Signed-off-by: Andrea Bolognani 
---
 guests/vars/projects/libvirt.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index 8c90a85..e512a50 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -55,5 +55,4 @@ packages:
   - xen
   - xmllint
   - xsltproc
-  - yajl
   - zfs
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 1/4] guests: Install jansson for libvirt

2018-07-19 Thread Andrea Bolognani
libvirt has switched from yajl to jansson as its JSON
implementation, so we need to have the latter available
when building or the QEMU driver will be disabled.

Signed-off-by: Andrea Bolognani 
---
 guests/vars/mappings.yml | 5 +
 guests/vars/projects/libvirt.yml | 1 +
 2 files changed, 6 insertions(+)

diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index 92822cb..eb31131 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -185,6 +185,11 @@ mappings:
 deb: open-iscsi
 rpm: iscsi-initiator-utils
 
+  jansson:
+deb: libjansson-dev
+rpm: jansson-devel
+pkg: jansson
+
   java:
 deb: openjdk-8-jre-headless
 pkg: openjdk8-jre
diff --git a/guests/vars/projects/libvirt.yml b/guests/vars/projects/libvirt.yml
index 3274564..8c90a85 100644
--- a/guests/vars/projects/libvirt.yml
+++ b/guests/vars/projects/libvirt.yml
@@ -15,6 +15,7 @@ packages:
   - hal
   - ip
   - iscsiadm
+  - jansson
   - libacl
   - libattr
   - libaudit
-- 
2.17.1

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


[libvirt] [jenkins-ci PATCH 4/4] guests: Remove yajl kludge

2018-07-19 Thread Andrea Bolognani
No longer necessary now that yajl itself is not
being installed.

Signed-off-by: Andrea Bolognani 
---
 guests/tasks/kludges.yml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/guests/tasks/kludges.yml b/guests/tasks/kludges.yml
index 0ad61a7..31e9d6a 100644
--- a/guests/tasks/kludges.yml
+++ b/guests/tasks/kludges.yml
@@ -9,9 +9,7 @@
 force: yes
   with_items:
 - include/sasl
-- include/yajl
 - lib/libsasl2.so
-- lib/libyajl.so
   when:
 - os_name == 'FreeBSD'
 
-- 
2.17.1

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


Re: [libvirt] [PATCH v4] qemu: fix broken autostart symlink after renaming domain.

2018-07-19 Thread Erik Skultety
On Thu, Jul 19, 2018 at 01:21:48AM -0300, Julio Faracco wrote:
> If a domain is configured to start on boot, it has a symlink to the
> domain definition inside the autostart directory. If you rename this
> domain, the definition is renamed too. The symlink need to be pointed to
> this renamed file. This commit recreates the symlink after renaming the
> XML file.
>
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1594985
>
> Signed-off-by: Julio Faracco 
> ---
>  src/qemu/qemu_driver.c | 34 ++
>  1 file changed, 34 insertions(+)
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 25170f6f26..09af231dfc 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -20917,6 +20917,8 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
>  char *old_dom_name = NULL;
>  char *new_dom_cfg_file = NULL;
>  char *old_dom_cfg_file = NULL;
> +char *new_dom_autostart_link = NULL;
> +char *old_dom_autostart_link = NULL;
>
>  virCheckFlags(0, ret);
>
> @@ -20937,6 +20939,14 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
>   vm->def->name)))
>  goto cleanup;
>
> +if (vm->autostart) {
> +if (!(new_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
> +  new_dom_name)) ||
> +!(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
> +  vm->def->name)))
> +goto cleanup;
> +}
> +
>  event_old = virDomainEventLifecycleNewFromObj(vm,
>  VIR_DOMAIN_EVENT_UNDEFINED,
>  
> VIR_DOMAIN_EVENT_UNDEFINED_RENAMED);
> @@ -20949,6 +20959,23 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
>  if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0)
>  goto rollback;
>
> +if (vm->autostart) {
> +if (virFileIsLink(old_dom_autostart_link) &&
> +unlink(old_dom_autostart_link) < 0) {
> +virReportSystemError(errno,
> + _("Failed to delete symlink '%s'"),
> + old_dom_autostart_link);
> +goto rollback;
> +}
> +
> +if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) {
> +virReportSystemError(errno,
> + _("Failed to create symlink '%s to '%s'"),
> + new_dom_autostart_link, new_dom_cfg_file);
> +goto rollback;

If ^this symlink fails, you don't restore the original. The only thing your
code really needs is to move some bits around, the logic is fine otherwise.
I've done that, you can see the diff of the changes I performed in the attached
diff and pushed the patch.

Thanks,
Erik

> +}
> +}
> +
>  if (virFileExists(old_dom_cfg_file) &&
>  unlink(old_dom_cfg_file) < 0) {
>  virReportSystemError(errno,
> @@ -20963,6 +20990,8 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
>  ret = 0;
>
>   cleanup:
> +VIR_FREE(old_dom_autostart_link);
> +VIR_FREE(new_dom_autostart_link);
>  VIR_FREE(old_dom_cfg_file);
>  VIR_FREE(new_dom_cfg_file);
>  VIR_FREE(old_dom_name);
> @@ -20982,6 +21011,11 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
>  if (virFileExists(new_dom_cfg_file))
>  unlink(new_dom_cfg_file);
>
> +if (vm->autostart) {
> +if (virFileExists(new_dom_autostart_link))
> +unlink(new_dom_autostart_link);
> +}
> +
>  goto cleanup;
>  }
>
> --
> 2.17.1
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 09af231dfc..b5e6fe8132 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20945,6 +20945,13 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
 !(old_dom_autostart_link = virDomainConfigFile(cfg->autostartDir,
   vm->def->name)))
 goto cleanup;
+
+if (symlink(new_dom_cfg_file, new_dom_autostart_link) < 0) {
+virReportSystemError(errno,
+ _("Failed to create symlink '%s to '%s'"),
+ new_dom_autostart_link, new_dom_cfg_file);
+goto cleanup;
+}
 }
 
 event_old = virDomainEventLifecycleNewFromObj(vm,
@@ -20959,23 +20966,6 @@ qemuDomainRenameCallback(virDomainObjPtr vm,
 if (virDomainSaveConfig(cfg->configDir, driver->caps, vm->def) < 0)
 goto rollback;
 
-if (vm->autostart) {
-if (virFileIsLink(old_dom_autostart_link) &&
-unlink(old_dom_autostart_link) < 0) {
-virReportSystemError(errno,
- _("Failed to delete 

Re: [libvirt] [dockerfiles PATCH] refresh: Add refresh script

2018-07-19 Thread Daniel P . Berrangé
On Thu, Jul 19, 2018 at 10:20:55AM +0200, Andrea Bolognani wrote:
> This calls lcitool, part of the libvirt-jenkins-ci
> project, to refresh the Dockerfiles so that they
> contain up to date information about build
> requirements.
> 
> Signed-off-by: Andrea Bolognani 
> ---
>  refresh | 30 ++
>  1 file changed, 30 insertions(+)
>  create mode 100755 refresh

Reviewed-by: Daniel P. Berrangé 



Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

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

[libvirt] [dockerfiles PATCH] refresh: Add refresh script

2018-07-19 Thread Andrea Bolognani
This calls lcitool, part of the libvirt-jenkins-ci
project, to refresh the Dockerfiles so that they
contain up to date information about build
requirements.

Signed-off-by: Andrea Bolognani 
---
 refresh | 30 ++
 1 file changed, 30 insertions(+)
 create mode 100755 refresh

diff --git a/refresh b/refresh
new file mode 100755
index 000..7aa2151
--- /dev/null
+++ b/refresh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+die() {
+test "$1" && echo "$1" >&2
+exit 1
+}
+
+me="$0"
+here=$(pwd)
+
+ci_repo="$1"
+
+cd "$ci_repo/guests/" >/dev/null 2>&1 || {
+die "Usage: $me path/to/libvirt-jenkins-ci.git"
+}
+
+for host in $(./lcitool -a hosts)
+do
+projects="libvirt"
+dockerfile="$here/buildenv-${host#libvirt-}.Dockerfile"
+
+case "$host" in
+libvirt-fedora-rawhide) projects="libvirt,libvirt+mingw" ;;
+libvirt-freebsd-*)  continue ;;
+esac
+
+./lcitool -a dockerfile -h "$host" -p "$projects" >"$dockerfile" || {
+die "$me: Failed to refresh Dockerfile for $host"
+}
+done
-- 
2.17.1

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


Re: [libvirt] [PATCH v2] util: set OOM in virCopyLastError if error is not set

2018-07-19 Thread Nikolay Shirokovskiy



On 17.07.2018 22:28, John Ferlan wrote:
> 
> 
 +} else {
 +to->code = VIR_ERR_NO_MEMORY;
 +to->domain = VIR_FROM_NONE;
 +to->level = VIR_ERR_ERROR;
>>>
>>> Should we do a VIR_FREE(to->message); so that nothing that was there
>>> before somehow remains... I don't think either agent or monitor> 
>>> "lastError" is reset until Dispose time.
>>
>> Won't hurt but probably will not be used by monitor or agent. If thread
>> error is not allocated message is NULL upon return, after error is allocated 
>> we never
>> hit this OOM branch anymore. Of course hypotetical client can bring @to
>> with message already set so this a bit future proof. 
>>
>> I think then we can leave reset and then set these 3 fields.
>>
>> Nikolay
>>
> 
> You have commit access and my R-by regardless of whether you add the
> VIR_FREE or not.  I leave the rest to you ;-)
> 

Thanx! Pushed with reset added.

Nikolay

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