[libvirt] [PATCH] cgroup: drop INSERT_ELEMENT usage virCgroupPartitionEscape
by Ján Tomko
Use virAsprintf to prepend an underscore to make the code more
readable.
---
src/util/vircgroup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 04f3818..07cd7f6 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -231,16 +231,18 @@ virCgroupPartitionNeedsEscaping(const char *path)
static int
virCgroupPartitionEscape(char **path)
{
- size_t len = strlen(*path) + 1;
int rc;
- char escape = '_';
+ char *newstr = NULL;
if ((rc = virCgroupPartitionNeedsEscaping(*path)) <= 0)
return rc;
- if (VIR_INSERT_ELEMENT(*path, 0, len, escape) < 0)
+ if (virAsprintf(&newstr, "_%s", *path) < 0)
return -1;
+ VIR_FREE(*path);
+ *path = newstr;
+
return 0;
}
--
2.7.3
8 years, 5 months
[libvirt] [PATCH] qemu_monitor_json: add support to search QOM device path by device alias
by Pavel Hrdina
Commit ce745914 introduced detection of actual video ram sizes to fix migration
if QEMU decide to modify the values provided by libvirt. This works perfectly
for domains with number of video devices up to two.
If there are more than two video devices in the guest all the secondary devices
in the XML will have the same memory values. This is because our current code
search for QOM device path only by the device type name and all the secondary
video devices has the same name "qxl".
This patch introduces a new search function that will try to search a QOM device
path using also device's alias if the alias is available. After that it will
fallback to the old recursive code if the alias search found no results.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1358728
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_monitor.c | 11 ++++---
src/qemu/qemu_monitor_json.c | 74 ++++++++++++++++++++++++++++++++++++++------
src/qemu/qemu_monitor_json.h | 3 +-
3 files changed, 74 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 098e654..1fac4de 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1084,10 +1084,11 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon)
}
mon->ballooninit = true;
- flp_ret = qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", &path);
+ flp_ret = qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-pci", NULL, &path);
if (flp_ret == -2) {
/* pci object was not found retry search for ccw object */
- if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-ccw", &path) < 0)
+ if (qemuMonitorJSONFindLinkPath(mon, "virtio-balloon-ccw",
+ NULL, &path) < 0)
return;
} else if (flp_ret < 0) {
return;
@@ -1138,7 +1139,8 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR(mon);
if (mon->json) {
- ret = qemuMonitorJSONFindLinkPath(mon, videoName, &path);
+ ret = qemuMonitorJSONFindLinkPath(mon, videoName,
+ video->info.alias, &path);
if (ret < 0) {
if (ret == -2)
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1173,7 +1175,8 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon,
QEMU_CHECK_MONITOR(mon);
if (mon->json) {
- ret = qemuMonitorJSONFindLinkPath(mon, videoName, &path);
+ ret = qemuMonitorJSONFindLinkPath(mon, videoName,
+ video->info.alias, &path);
if (ret < 0) {
if (ret == -2)
virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index bb426dc..5d24e26 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -6810,7 +6810,55 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
/**
- * Recursively search for a QOM object link.
+ * Search for a QOM object link by alias and name.
+ *
+ * For @alias and @name, this function tries to find QOM object named @name
+ * with id @alias in /machine/peripheral.
+ *
+ * Returns:
+ * 0 - Found
+ * -1 - Error - bail out
+ * -2 - Not found
+ */
+static int
+qemuMonitorJSONFindObjectPathByAlias(qemuMonitorPtr mon,
+ const char *name,
+ const char *alias,
+ char **path)
+{
+ qemuMonitorJSONListPathPtr *paths = NULL;
+ char *child = NULL;
+ int npaths;
+ int ret = -1;
+ size_t i;
+
+ npaths = qemuMonitorJSONGetObjectListPaths(mon, "/machine/peripheral", &paths);
+ if (npaths < 0)
+ return -1;
+
+ if (virAsprintf(&child, "child<%s>", name) < 0)
+ return -1;
+
+ for (i = 0; i < npaths; i++) {
+ if (STREQ(paths[i]->name, alias) && STREQ(paths[i]->type, child)) {
+ if (virAsprintf(path, "/machine/peripheral/%s", alias) < 0)
+ goto cleanup;
+
+ ret = 0;
+ goto cleanup;
+ }
+ }
+
+ ret = -2;
+
+ cleanup:
+ VIR_FREE(child);
+ return ret;
+}
+
+
+/**
+ * Recursively search for a QOM object link only by name.
*
* For @name, this function finds the first QOM object
* named @name, recursively going through all the "child<>"
@@ -6822,10 +6870,10 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
* -2 - Not found
*/
static int
-qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
- const char *curpath,
- const char *name,
- char **path)
+qemuMonitorJSONFindObjectPathByName(qemuMonitorPtr mon,
+ const char *curpath,
+ const char *name,
+ char **path)
{
ssize_t i, npaths = 0;
int ret = -2;
@@ -6859,7 +6907,7 @@ qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
goto cleanup;
}
- ret = qemuMonitorJSONFindObjectPath(mon, nextpath, name, path);
+ ret = qemuMonitorJSONFindObjectPathByName(mon, nextpath, name, path);
VIR_FREE(nextpath);
}
}
@@ -6876,8 +6924,9 @@ qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
/**
* Recursively search for a QOM object link.
*
- * For @name, this function finds the first QOM object
- * pointed to by a link in the form of 'link<@name>'
+ * For @name and @alias, this function finds the first QOM object.
+ * The search is done at first by @alias and @name and if nothing was found
+ * it continues recursively only with @name.
*
* Returns:
* 0 - Found
@@ -6887,15 +6936,22 @@ qemuMonitorJSONFindObjectPath(qemuMonitorPtr mon,
int
qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
const char *name,
+ const char *alias,
char **path)
{
char *linkname = NULL;
int ret = -1;
+ if (alias) {
+ ret = qemuMonitorJSONFindObjectPathByAlias(mon, name, alias, path);
+ if (ret == -1 || ret == 0)
+ return ret;
+ }
+
if (virAsprintf(&linkname, "link<%s>", name) < 0)
return -1;
- ret = qemuMonitorJSONFindObjectPath(mon, "/", linkname, path);
+ ret = qemuMonitorJSONFindObjectPathByName(mon, "/", linkname, path);
VIR_FREE(linkname);
return ret;
}
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index 37a739e..0b3d898 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -477,8 +477,9 @@ int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon,
int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon,
const char *name,
+ const char *alias,
char **path)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4);
int qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon,
const char *uri)
--
2.9.2
8 years, 5 months
[libvirt] [python PATCH] Post-release version bump to 2.1.0
by Pavel Hrdina
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 099b1e0..936aeb4 100755
--- a/setup.py
+++ b/setup.py
@@ -305,7 +305,7 @@ class my_clean(clean):
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '2.0.0',
+ version = '2.1.0',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = 'libvir-list(a)redhat.com',
--
2.9.2
8 years, 5 months
[libvirt] [libvirt-glib v8 4/5] gconfig: Add GVirConfigDomainAddressPci getters
by Zeeshan Ali (Khattak)
From: Christophe Fergeau <cfergeau(a)redhat.com>
They will be useful to do more checks in the GVirDomainDeviceHostdev
unit test.
---
.../libvirt-gconfig-domain-address-pci.c | 45 ++++++++++++++++++++++
.../libvirt-gconfig-domain-address-pci.h | 5 +++
libvirt-gconfig/libvirt-gconfig.sym | 6 +++
3 files changed, 56 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-address-pci.c b/libvirt-gconfig/libvirt-gconfig-domain-address-pci.c
index 4bf94cc..0105402 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-address-pci.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-address-pci.c
@@ -92,30 +92,75 @@ static void set_attribute_hex(GVirConfigDomainAddressPci *address,
g_free(format);
}
+int gvir_config_domain_address_pci_get_domain(GVirConfigDomainAddressPci *address)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_ADDRESS_PCI(address), -1);
+
+ return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(address),
+ NULL, "domain",
+ -1);
+}
+
void gvir_config_domain_address_pci_set_domain(GVirConfigDomainAddressPci *address,
guint16 pci_domain)
{
set_attribute_hex(address, "domain", pci_domain, 0, G_MAXUINT16, 4);
}
+int gvir_config_domain_address_pci_get_bus(GVirConfigDomainAddressPci *address)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_ADDRESS_PCI(address), -1);
+
+ return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(address),
+ NULL, "bus",
+ -1);
+}
+
void gvir_config_domain_address_pci_set_bus(GVirConfigDomainAddressPci *address,
guchar bus)
{
set_attribute_hex(address, "bus", bus, 0, G_MAXUINT8, 2);
}
+int gvir_config_domain_address_pci_get_slot(GVirConfigDomainAddressPci *address)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_ADDRESS_PCI(address), -1);
+
+ return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(address),
+ NULL, "slot",
+ -1);
+}
+
void gvir_config_domain_address_pci_set_slot(GVirConfigDomainAddressPci *address,
guchar slot)
{
set_attribute_hex(address, "slot", slot, 0, 0x1f, 2);
}
+int gvir_config_domain_address_pci_get_function(GVirConfigDomainAddressPci *address)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_ADDRESS_PCI(address), -1);
+
+ return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(address),
+ NULL, "function",
+ -1);
+}
+
void gvir_config_domain_address_pci_set_function(GVirConfigDomainAddressPci *address,
guchar function)
{
set_attribute_hex(address, "function", function, 0, 7, 1);
}
+gboolean gvir_config_domain_address_pci_get_multifunction(GVirConfigDomainAddressPci *address)
+{
+ g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_ADDRESS_PCI(address), FALSE);
+
+ return gvir_config_object_get_attribute_boolean(GVIR_CONFIG_OBJECT(address),
+ NULL, "multifunction",
+ FALSE);
+}
+
void gvir_config_domain_address_pci_set_multifunction(GVirConfigDomainAddressPci *address,
gboolean multifunction)
{
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-address-pci.h b/libvirt-gconfig/libvirt-gconfig-domain-address-pci.h
index 3b82624..cdef4a8 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-address-pci.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-address-pci.h
@@ -62,14 +62,19 @@ GVirConfigDomainAddressPci *gvir_config_domain_address_pci_new(void);
GVirConfigDomainAddressPci *gvir_config_domain_address_pci_new_from_xml(const gchar *xml,
GError **error);
+int gvir_config_domain_address_pci_get_domain(GVirConfigDomainAddressPci *address);
void gvir_config_domain_address_pci_set_domain(GVirConfigDomainAddressPci *address,
guint16 pci_domain);
+int gvir_config_domain_address_pci_get_bus(GVirConfigDomainAddressPci *address);
void gvir_config_domain_address_pci_set_bus(GVirConfigDomainAddressPci *address,
guchar bus);
+int gvir_config_domain_address_pci_get_slot(GVirConfigDomainAddressPci *address);
void gvir_config_domain_address_pci_set_slot(GVirConfigDomainAddressPci *address,
guchar slot);
+int gvir_config_domain_address_pci_get_function(GVirConfigDomainAddressPci *address);
void gvir_config_domain_address_pci_set_function(GVirConfigDomainAddressPci *address,
guchar function);
+gboolean gvir_config_domain_address_pci_get_multifunction(GVirConfigDomainAddressPci *address);
void gvir_config_domain_address_pci_set_multifunction(GVirConfigDomainAddressPci *address,
gboolean multifunction);
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index 4d080b9..4ef4bf7 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -735,6 +735,12 @@ global:
LIBVIRT_GCONFIG_0.2.4 {
global:
+ gvir_config_domain_address_pci_get_bus;
+ gvir_config_domain_address_pci_get_domain;
+ gvir_config_domain_address_pci_get_function;
+ gvir_config_domain_address_pci_get_multifunction;
+ gvir_config_domain_address_pci_get_slot;
+
gvir_config_domain_graphics_spice_set_gl;
gvir_config_domain_hostdev_get_boot_order;
--
2.7.4
8 years, 5 months
[libvirt] [libvirt-glib v8 2/5] gconfig: Add GVirConfigDomainHostdev
by Zeeshan Ali (Khattak)
Add API to read and write domain/devices/hostdev nodes. This patch only
adds the baseclass and hence is not useful on it's own. A more specific
subclass to represent PCI devices will be added in a following patch.
---
libvirt-gconfig/Makefile.am | 2 +
.../libvirt-gconfig-domain-device-private.h | 3 +
libvirt-gconfig/libvirt-gconfig-domain-device.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-hostdev.c | 190 +++++++++++++++++++++
libvirt-gconfig/libvirt-gconfig-domain-hostdev.h | 76 +++++++++
libvirt-gconfig/libvirt-gconfig.h | 1 +
libvirt-gconfig/libvirt-gconfig.sym | 10 ++
7 files changed, 283 insertions(+), 1 deletion(-)
create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-hostdev.c
create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-hostdev.h
diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
index f308539..a7c6c4e 100644
--- a/libvirt-gconfig/Makefile.am
+++ b/libvirt-gconfig/Makefile.am
@@ -50,6 +50,7 @@ GCONFIG_HEADER_FILES = \
libvirt-gconfig-domain-graphics-sdl.h \
libvirt-gconfig-domain-graphics-spice.h \
libvirt-gconfig-domain-graphics-vnc.h \
+ libvirt-gconfig-domain-hostdev.h \
libvirt-gconfig-domain-input.h \
libvirt-gconfig-domain-interface.h \
libvirt-gconfig-domain-interface-bridge.h \
@@ -141,6 +142,7 @@ GCONFIG_SOURCE_FILES = \
libvirt-gconfig-domain-graphics-sdl.c \
libvirt-gconfig-domain-graphics-spice.c \
libvirt-gconfig-domain-graphics-vnc.c \
+ libvirt-gconfig-domain-hostdev.c \
libvirt-gconfig-domain-input.c \
libvirt-gconfig-domain-interface.c \
libvirt-gconfig-domain-interface-bridge.c \
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-device-private.h b/libvirt-gconfig/libvirt-gconfig-domain-device-private.h
index 062c0e2..c45e1df 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-device-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-domain-device-private.h
@@ -43,6 +43,9 @@ GVirConfigDomainDevice *
gvir_config_domain_graphics_new_from_tree(GVirConfigXmlDoc *doc,
xmlNodePtr tree);
GVirConfigDomainDevice *
+gvir_config_domain_hostdev_new_from_tree(GVirConfigXmlDoc *doc,
+ xmlNodePtr tree);
+GVirConfigDomainDevice *
gvir_config_domain_interface_new_from_tree(GVirConfigXmlDoc *doc,
xmlNodePtr tree);
GVirConfigDomainDevice *
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-device.c b/libvirt-gconfig/libvirt-gconfig-domain-device.c
index 3d2b9b3..8a75cea 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-device.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-device.c
@@ -66,7 +66,7 @@ gvir_config_domain_device_new_from_tree(GVirConfigXmlDoc *doc,
} else if (xmlStrEqual(tree->name, (xmlChar*)"lease")) {
goto unimplemented;
} else if (xmlStrEqual(tree->name, (xmlChar*)"hostdev")) {
- goto unimplemented;
+ return gvir_config_domain_hostdev_new_from_tree(doc, tree);
} else if (xmlStrEqual(tree->name, (xmlChar*)"redirdev")) {
type = GVIR_CONFIG_TYPE_DOMAIN_REDIRDEV;
} else if (xmlStrEqual(tree->name, (xmlChar*)"smartcard")) {
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-hostdev.c b/libvirt-gconfig/libvirt-gconfig-domain-hostdev.c
new file mode 100644
index 0000000..ce5f8aa
--- /dev/null
+++ b/libvirt-gconfig/libvirt-gconfig-domain-hostdev.c
@@ -0,0 +1,190 @@
+/*
+ * libvirt-gconfig-domain-hostdev.c: libvirt domain hostdev configuration
+ *
+ * Copyright (C) 2016 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Zeeshan Ali (Khattak) <zeeshanak(a)gnome.org>
+ * Christophe Fergeau <cfergeau(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include "libvirt-gconfig/libvirt-gconfig.h"
+#include "libvirt-gconfig/libvirt-gconfig-private.h"
+
+#define GVIR_CONFIG_DOMAIN_HOSTDEV_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV, GVirConfigDomainHostdevPrivate))
+
+struct _GVirConfigDomainHostdevPrivate
+{
+ gboolean unused;
+};
+
+G_DEFINE_ABSTRACT_TYPE(GVirConfigDomainHostdev, gvir_config_domain_hostdev, GVIR_CONFIG_TYPE_DOMAIN_DEVICE);
+
+
+static void gvir_config_domain_hostdev_class_init(GVirConfigDomainHostdevClass *klass)
+{
+ g_type_class_add_private(klass, sizeof(GVirConfigDomainHostdevPrivate));
+}
+
+
+static void gvir_config_domain_hostdev_init(GVirConfigDomainHostdev *hostdev)
+{
+ hostdev->priv = GVIR_CONFIG_DOMAIN_HOSTDEV_GET_PRIVATE(hostdev);
+}
+
+G_GNUC_INTERNAL GVirConfigDomainDevice *
+gvir_config_domain_hostdev_new_from_tree(GVirConfigXmlDoc *doc,
+ xmlNodePtr tree)
+{
+ const char *type;
+ GType gtype;
+
+ type = gvir_config_xml_get_attribute_content(tree, "type");
+ if (type == NULL)
+ return NULL;
+
+ if (g_str_equal(type, "usb")) {
+ goto unimplemented;
+ } else if (g_str_equal(type, "pci")) {
+ goto unimplemented;
+ } else if (g_str_equal(type, "scsi")) {
+ goto unimplemented;
+ } else {
+ g_debug("Unknown domain hostdev node: %s", type);
+ return NULL;
+ }
+
+ return GVIR_CONFIG_DOMAIN_DEVICE(gvir_config_object_new_from_tree(gtype, doc, NULL, tree));
+
+unimplemented:
+ g_debug("Parsing of '%s' domain hostdev nodes is unimplemented", type);
+ return NULL;
+}
+
+/**
+ * gvir_config_domain_hostdev_set_boot_order:
+ * @hostdev: the host device
+ * @order: the boot order
+ *
+ * If a positive integer is passed as @order, @hostdev is marked bootable and
+ * boot order set to @order, otherwise @hostdev is marked to be unbootable.
+ */
+void gvir_config_domain_hostdev_set_boot_order(GVirConfigDomainHostdev *hostdev,
+ gint order)
+{
+ g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_HOSTDEV(hostdev));
+
+ if (order >= 0) {
+ char *order_str = g_strdup_printf("%u", order);
+
+ gvir_config_object_replace_child_with_attribute(GVIR_CONFIG_OBJECT(hostdev),
+ "boot",
+ "order",
+ order_str);
+ g_free(order_str);
+ } else {
+ gvir_config_object_delete_child(GVIR_CONFIG_OBJECT(hostdev),
+ "boot",
+ NULL);
+ }
+}
+
+/**
+ * gvir_config_domain_hostdev_get_boot_order:
+ * @hostdev: the host device
+ *
+ * Returns: The boot order if @hostdev is bootable, otherwise a negative integer.
+ */
+gint gvir_config_domain_hostdev_get_boot_order(GVirConfigDomainHostdev *hostdev)
+{
+ return gvir_config_object_get_attribute_uint64(GVIR_CONFIG_OBJECT(hostdev),
+ "boot", "order", -1);
+}
+
+/**
+ * gvir_config_domain_hostdev_set_readonly:
+ * @hostdev: the host device
+ * @readonly: the new readonly status
+ *
+ * Set the readonly status of @hostdev to @readonly.
+ */
+void gvir_config_domain_hostdev_set_readonly(GVirConfigDomainHostdev *hostdev,
+ gboolean readonly)
+{
+ g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_HOSTDEV(hostdev));
+
+ if (readonly) {
+ GVirConfigObject *node;
+
+ node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(hostdev),
+ "readonly");
+ g_object_unref(node);
+ } else {
+ gvir_config_object_delete_child(GVIR_CONFIG_OBJECT(hostdev),
+ "readonly", NULL);
+ }
+}
+
+/**
+ * gvir_config_domain_hostdev_get_readonly:
+ * @hostdev: the host device
+ *
+ * Returns: %TRUE if @hostdev is readonly, %FALSE otherwise.
+ */
+gboolean gvir_config_domain_hostdev_get_readonly(GVirConfigDomainHostdev *hostdev)
+{
+ return gvir_config_object_has_child(GVIR_CONFIG_OBJECT(hostdev),
+ "readonly");
+}
+
+/**
+ * gvir_config_domain_hostdev_set_shareable:
+ * @hostdev: the host device
+ * @shareable: the new shareable status
+ *
+ * Set whether or not @hostdev is shared between domains.
+ */
+void gvir_config_domain_hostdev_set_shareable(GVirConfigDomainHostdev *hostdev,
+ gboolean shareable)
+{
+ g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_HOSTDEV(hostdev));
+
+ if (shareable) {
+ GVirConfigObject *node;
+
+ node = gvir_config_object_replace_child(GVIR_CONFIG_OBJECT(hostdev),
+ "shareable");
+ g_object_unref(node);
+ } else {
+ gvir_config_object_delete_child(GVIR_CONFIG_OBJECT(hostdev),
+ "shareable", NULL);
+ }
+}
+
+/**
+ * gvir_config_domain_hostdev_get_shareable:
+ * @hostdev: the host device
+ *
+ * Returns: %TRUE if @hostdev is shared between domains, %FALSE otherwise.
+ */
+gboolean gvir_config_domain_hostdev_get_shareable(GVirConfigDomainHostdev *hostdev)
+{
+ return gvir_config_object_has_child(GVIR_CONFIG_OBJECT(hostdev),
+ "shareable");
+}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-hostdev.h b/libvirt-gconfig/libvirt-gconfig-domain-hostdev.h
new file mode 100644
index 0000000..1372552
--- /dev/null
+++ b/libvirt-gconfig/libvirt-gconfig-domain-hostdev.h
@@ -0,0 +1,76 @@
+/*
+ * libvirt-gconfig-domain-hostdev.h: libvirt domain hostdev configuration
+ *
+ * Copyright (C) 2016 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Zeeshan Ali (Khattak) <zeeshanak(a)gnome.org>
+ * Christophe Fergeau <cfergeau(a)redhat.com>
+ */
+
+#if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD)
+#error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly."
+#endif
+
+#ifndef __LIBVIRT_GCONFIG_DOMAIN_HOSTDEV_H__
+#define __LIBVIRT_GCONFIG_DOMAIN_HOSTDEV_H__
+
+G_BEGIN_DECLS
+
+#define GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV (gvir_config_domain_hostdev_get_type ())
+#define GVIR_CONFIG_DOMAIN_HOSTDEV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV, GVirConfigDomainHostdev))
+#define GVIR_CONFIG_DOMAIN_HOSTDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV, GVirConfigDomainHostdevClass))
+#define GVIR_CONFIG_IS_DOMAIN_HOSTDEV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV))
+#define GVIR_CONFIG_IS_DOMAIN_HOSTDEV_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV))
+#define GVIR_CONFIG_DOMAIN_HOSTDEV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_HOSTDEV, GVirConfigDomainHostdevClass))
+
+typedef struct _GVirConfigDomainHostdev GVirConfigDomainHostdev;
+typedef struct _GVirConfigDomainHostdevPrivate GVirConfigDomainHostdevPrivate;
+typedef struct _GVirConfigDomainHostdevClass GVirConfigDomainHostdevClass;
+
+struct _GVirConfigDomainHostdev
+{
+ GVirConfigDomainDevice parent;
+
+ GVirConfigDomainHostdevPrivate *priv;
+
+ /* Do not add fields to this struct */
+};
+
+struct _GVirConfigDomainHostdevClass
+{
+ GVirConfigDomainDeviceClass parent_class;
+
+ gpointer padding[20];
+};
+
+GType gvir_config_domain_hostdev_get_type(void);
+
+void gvir_config_domain_hostdev_set_boot_order(GVirConfigDomainHostdev *hostdev,
+ gint order);
+gint gvir_config_domain_hostdev_get_boot_order(GVirConfigDomainHostdev *hostdev);
+
+void gvir_config_domain_hostdev_set_readonly(GVirConfigDomainHostdev *hostdev,
+ gboolean readonly);
+gboolean gvir_config_domain_hostdev_get_readonly(GVirConfigDomainHostdev *hostdev);
+
+void gvir_config_domain_hostdev_set_shareable(GVirConfigDomainHostdev *hostdev,
+ gboolean shareable);
+gboolean gvir_config_domain_hostdev_get_shareable(GVirConfigDomainHostdev *hostdev);
+
+G_END_DECLS
+
+#endif /* __LIBVIRT_GCONFIG_DOMAIN_HOSTDEV_H__ */
diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h
index 4624003..cfa9dd3 100644
--- a/libvirt-gconfig/libvirt-gconfig.h
+++ b/libvirt-gconfig/libvirt-gconfig.h
@@ -67,6 +67,7 @@
#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-spice.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-vnc.h>
+#include <libvirt-gconfig/libvirt-gconfig-domain-hostdev.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-input.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-interface.h>
#include <libvirt-gconfig/libvirt-gconfig-domain-interface-bridge.h>
diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
index df6dd3a..3607554 100644
--- a/libvirt-gconfig/libvirt-gconfig.sym
+++ b/libvirt-gconfig/libvirt-gconfig.sym
@@ -734,7 +734,17 @@ global:
} LIBVIRT_GCONFIG_0.2.1;
LIBVIRT_GCONFIG_0.2.4 {
+global:
gvir_config_domain_graphics_spice_set_gl;
+
+ gvir_config_domain_hostdev_get_boot_order;
+ gvir_config_domain_hostdev_get_readonly;
+ gvir_config_domain_hostdev_get_shareable;
+ gvir_config_domain_hostdev_get_type;
+ gvir_config_domain_hostdev_set_boot_order;
+ gvir_config_domain_hostdev_set_readonly;
+ gvir_config_domain_hostdev_set_shareable;
+
gvir_config_domain_video_get_model;
gvir_config_domain_video_set_accel3d;
} LIBVIRT_GCONFIG_0.2.2;
--
2.7.4
8 years, 5 months
[libvirt] [libvirt-glib v8 1/5] gconfig: Add gvir_config_object_has_child
by Zeeshan Ali (Khattak)
From: Christophe Fergeau <cfergeau(a)redhat.com>
---
libvirt-gconfig/libvirt-gconfig-object-private.h | 2 ++
libvirt-gconfig/libvirt-gconfig-object.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
index e91c4ef..7a0d21f 100644
--- a/libvirt-gconfig/libvirt-gconfig-object-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
@@ -117,6 +117,8 @@ GVirConfigObject *gvir_config_object_get_child(GVirConfigObject *object,
GVirConfigObject *gvir_config_object_get_child_with_type(GVirConfigObject *object,
const gchar *child_name,
GType child_type);
+gboolean gvir_config_object_has_child(GVirConfigObject *object,
+ const gchar *child_name);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index bf328f3..6225de2 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -970,3 +970,16 @@ gvir_config_object_get_child(GVirConfigObject *object,
child_name,
GVIR_CONFIG_TYPE_OBJECT);
}
+
+G_GNUC_INTERNAL gboolean
+gvir_config_object_has_child(GVirConfigObject *object, const gchar *child_name)
+{
+ xmlNodePtr node;
+
+ g_return_val_if_fail(GVIR_CONFIG_IS_OBJECT(object), FALSE);
+ g_return_val_if_fail(child_name != NULL, FALSE);
+
+ node = gvir_config_xml_get_element(object->priv->node, child_name, NULL);
+
+ return (node != NULL);
+}
--
2.7.4
8 years, 5 months
[libvirt] [libvirt-glib v7 1/5] gconfig: Add gvir_config_object_has_child
by Zeeshan Ali (Khattak)
From: Christophe Fergeau <cfergeau(a)redhat.com>
---
libvirt-gconfig/libvirt-gconfig-object-private.h | 2 ++
libvirt-gconfig/libvirt-gconfig-object.c | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/libvirt-gconfig/libvirt-gconfig-object-private.h b/libvirt-gconfig/libvirt-gconfig-object-private.h
index e91c4ef..7a0d21f 100644
--- a/libvirt-gconfig/libvirt-gconfig-object-private.h
+++ b/libvirt-gconfig/libvirt-gconfig-object-private.h
@@ -117,6 +117,8 @@ GVirConfigObject *gvir_config_object_get_child(GVirConfigObject *object,
GVirConfigObject *gvir_config_object_get_child_with_type(GVirConfigObject *object,
const gchar *child_name,
GType child_type);
+gboolean gvir_config_object_has_child(GVirConfigObject *object,
+ const gchar *child_name);
G_END_DECLS
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index bf328f3..6225de2 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -970,3 +970,16 @@ gvir_config_object_get_child(GVirConfigObject *object,
child_name,
GVIR_CONFIG_TYPE_OBJECT);
}
+
+G_GNUC_INTERNAL gboolean
+gvir_config_object_has_child(GVirConfigObject *object, const gchar *child_name)
+{
+ xmlNodePtr node;
+
+ g_return_val_if_fail(GVIR_CONFIG_IS_OBJECT(object), FALSE);
+ g_return_val_if_fail(child_name != NULL, FALSE);
+
+ node = gvir_config_xml_get_element(object->priv->node, child_name, NULL);
+
+ return (node != NULL);
+}
--
2.7.4
8 years, 5 months
[libvirt] [PATCH v3] qemuhotplugtest: Add tests for ccw devices
by Tomasz Flendrich
There's a plan to rework the address handling, so testcases
that verify hotplugging ccw devices will help in avoiding
regression.
In this commit, some files are duplicated because of the way
qemuhotplug.c calculates the expected xml filenames.
I plan on changing that to explicitly stating the basis domain
xml, the device xml, and the expected xml.
---
Changes in v3:
* incorrect vde2 is removed in another .xml file, so that there are
duplicates of aliases
tests/qemuhotplugtest.c | 37 +++++++++++
.../qemuhotplug-ccw-virtio-1-explicit.xml | 8 +++
.../qemuhotplug-ccw-virtio-1-reverse.xml | 7 +++
.../qemuhotplug-ccw-virtio-2-explicit.xml | 8 +++
.../qemuhotplug-ccw-virtio-2.xml | 8 +++
.../qemuhotplug-ccw-virtio.xml | 8 +++
.../qemuhotplug-base-ccw-live+ccw-virtio.xml | 63 +++++++++++++++++++
...ive-with-2-ccw-virtio+ccw-virtio-1-explicit.xml | 73 ++++++++++++++++++++++
...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 73 ++++++++++++++++++++++
...qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml | 63 +++++++++++++++++++
...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 73 ++++++++++++++++++++++
...-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml | 73 ++++++++++++++++++++++
.../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 63 +++++++++++++++++++
.../qemuhotplug-base-ccw-live.xml | 53 ++++++++++++++++
14 files changed, 610 insertions(+)
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
create mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index f2e7567..0a5f068 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -73,6 +73,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_SCSI);
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE);
+ virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW);
if (event)
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_DEL_EVENT);
@@ -523,6 +524,42 @@ mymain(void)
"device_del", QMP_OK,
"chardev-remove", QMP_OK);
+ DO_TEST_ATTACH("base-ccw-live", "ccw-virtio", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+ DO_TEST_DETACH("base-ccw-live", "ccw-virtio", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, false,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ /* Attach a second device, then detach the first one. Then attach the first one again. */
+ DO_TEST_ATTACH("base-ccw-live-with-ccw-virtio", "ccw-virtio-2-explicit", false, true,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
+ DO_TEST_DETACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-explicit", false, true,
+ "device_del", QMP_OK,
+ "human-monitor-command", HMP(""));
+
+ DO_TEST_ATTACH("base-ccw-live-with-2-ccw-virtio", "ccw-virtio-1-reverse", false, false,
+ "human-monitor-command", HMP("OK\\r\\n"),
+ "device_add", QMP_OK);
+
qemuTestDriverFree(&driver);
return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
new file mode 100644
index 0000000..74bd6a9
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-explicit.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
new file mode 100644
index 0000000..d62e8a4
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
@@ -0,0 +1,7 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='hdb' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
new file mode 100644
index 0000000..93e38e2
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2-explicit.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
new file mode 100644
index 0000000..ef1d329
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-2.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw'/>
+</disk>
diff --git a/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
new file mode 100644
index 0000000..7cf469e
--- /dev/null
+++ b/tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio.xml
@@ -0,0 +1,8 @@
+<disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <address type='ccw'/>
+</disk>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
new file mode 100644
index 0000000..2a27e11
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live+ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
new file mode 100644
index 0000000..1683174
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk0'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
new file mode 100644
index 0000000..7d2c3ab
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk0'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hdb' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk1'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
new file mode 100644
index 0000000..0821028
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk0'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
new file mode 100644
index 0000000..a262b9f
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk0'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
new file mode 100644
index 0000000..a262b9f
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
@@ -0,0 +1,73 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='hda' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk0'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
new file mode 100644
index 0000000..2a27e11
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
@@ -0,0 +1,63 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' cache='none'/>
+ <source file='/dev/null'/>
+ <backingStore/>
+ <target dev='vde' bus='virtio'/>
+ <readonly/>
+ <shareable/>
+ <alias name='virtio-disk4'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
new file mode 100644
index 0000000..17a0dc2
--- /dev/null
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live.xml
@@ -0,0 +1,53 @@
+<domain type='kvm' id='7'>
+ <name>hotplug</name>
+ <uuid>d091ea82-29e6-2e34-3005-f02617b36e87</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/libexec/qemu-kvm</emulator>
+ <controller type='usb' index='0'>
+ <alias name='usb'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <alias name='ide0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <alias name='scsi0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'>
+ <alias name='pci'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <alias name='virtio-serial0'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </controller>
+ <input type='mouse' bus='ps2'>
+ <alias name='input0'/>
+ </input>
+ <input type='keyboard' bus='ps2'>
+ <alias name='input1'/>
+ </input>
+ <memballoon model='none'>
+ <alias name='balloon0'/>
+ </memballoon>
+ <panic model='s390'/>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
--
2.7.4 (Apple Git-66)
8 years, 5 months