[libvirt] [PATCH] libxl: add serial list support

2016-08-02 Thread Bob Liu
Add support for multi serial devices, after this patch virsh can be used to
connect different serial devices of running domains. E.g.
vish # console  --devname serial

Signed-off-by: Bob Liu 
---
 src/libxl/libxl_conf.c   | 25 ++---
 src/libxl/libxl_domain.c | 23 +++
 src/libxl/libxl_driver.c | 17 +
 3 files changed, 50 insertions(+), 15 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 146e08a..685a5ad 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -431,14 +431,25 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
 }
 
 if (def->nserials) {
-if (def->nserials > 1) {
-virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-   "%s",
-   _("Only one serial device is supported by 
libxl"));
-return -1;
+if (def->nserials == 1) {
+if (libxlMakeChrdevStr(def->serials[0], _info->u.hvm.serial) 
<
+0)
+return -1;
+} else {
+if (VIR_ALLOC_N(b_info->u.hvm.serial_list, def->nserials + 1) <
+0)
+return -1;
+
+for (i = 0; i < def->nserials; i++) {
+if (libxlMakeChrdevStr(def->serials[i],
+   _info->u.hvm.serial_list[i]) < 0)
+{
+libxl_string_list_dispose(_info->u.hvm.serial_list);
+return -1;
+}
+}
+b_info->u.hvm.serial_list[i] = NULL;
 }
-if (libxlMakeChrdevStr(def->serials[0], _info->u.hvm.serial) < 0)
-return -1;
 }
 
 if (def->nparallels) {
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 0e26b91..82fe9e8 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -989,6 +989,29 @@ libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void 
*for_callback)
 VIR_FREE(console);
 }
 }
+for (i = 0; i < vm->def->nserials; i++) {
+virDomainChrDefPtr chr = vm->def->serials[i];
+char *console = NULL;
+int ret;
+
+if (chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
+ignore_value(virAsprintf(>info.alias, "serial%zd", i));
+if (chr->source.data.file.path)
+continue;
+ret = libxl_console_get_tty(ctx, ev->domid,
+chr->target.port,
+LIBXL_CONSOLE_TYPE_SERIAL,
+);
+if (!ret) {
+VIR_FREE(chr->source.data.file.path);
+if (console && console[0] != '\0') {
+ignore_value(VIR_STRDUP(chr->source.data.file.path,
+console));
+}
+}
+VIR_FREE(console);
+}
+}
 virObjectUnlock(vm);
 libxl_event_free(ctx, ev);
 }
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index f153f69..a34eb02 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4450,13 +4450,6 @@ libxlDomainOpenConsole(virDomainPtr dom,
 
 virCheckFlags(VIR_DOMAIN_CONSOLE_FORCE, -1);
 
-if (dev_name) {
-/* XXX support device aliases in future */
-virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-   _("Named device aliases are not supported"));
-goto cleanup;
-}
-
 if (!(vm = libxlDomObjFromDomain(dom)))
 goto cleanup;
 
@@ -4472,8 +4465,16 @@ libxlDomainOpenConsole(virDomainPtr dom,
 }
 
 priv = vm->privateData;
+if (dev_name) {
+size_t i;
 
-if (vm->def->nconsoles) {
+for (i = 0; !chr && i < vm->def->nserials; i++) {
+if (STREQ(dev_name, vm->def->serials[i]->info.alias)) {
+chr = vm->def->serials[i];
+break;
+}
+}
+} else if (vm->def->nconsoles) {
 chr = vm->def->consoles[0];
 if (chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL)
 chr = vm->def->serials[0];
-- 
2.6.5

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


[libvirt] [PATCH] libxl: allow libxl to calculate shadow mem requirements

2016-08-02 Thread Jim Fehlig
Long, long ago before libxl_get_required_shadow_memory() was
made publicly available, its code was copied to the libxl driver
for calculating shadow memory requirements of HVM domains.

Long ago, libxl_get_required_shadow_memory() was exported in
libxl_utils.h and included in xen-devel packages everywhere.

Remove the copied code, which has become stale, and let libxl
provode a proper shadow memory value.

Signed-off-by: Jim Fehlig 
---

I ensured libxl_get_required_shadow_memory() was available
as far back as Xen 4.4, which is the minimum version supported
by the libxl driver.

 src/libxl/libxl_conf.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 1344604..5202ca1 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -493,15 +493,10 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
 }
 }
 
-/*
- * The following comment and calculation were taken directly from
- * libxenlight's internal function libxl_get_required_shadow_memory():
- *
- * 256 pages (1MB) per vcpu, plus 1 page per MiB of RAM for the P2M 
map,
- * plus 1 page per MiB of RAM to shadow the resident processes.
- */
-b_info->shadow_memkb = 4 * (256 * 
libxl_bitmap_count_set(_info->avail_vcpus) +
-2 * (b_info->max_memkb / 1024));
+/* Allow libxl to calculate shadow memory requirements */
+b_info->shadow_memkb =
+libxl_get_required_shadow_memory(b_info->max_memkb,
+ b_info->max_vcpus);
 } else {
 /*
  * For compatibility with the legacy xen toolstack, default to pygrub
-- 
2.1.4

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


[libvirt] [PATCH 0/2] Rework qemuhotplugtest

2016-08-02 Thread Tomasz Flendrich
This series requires another one:
https://www.redhat.com/archives/libvir-list/2016-July/msg01205.html


Tomasz Flendrich (2):
  qemuhotplugtest: handle xml files more precisely
  qemuhotplugtest: change indentation

 tests/qemuhotplugtest.c| 254 +++--
 .../qemuhotplug-ccw-virtio-1-reverse.xml   |   7 -
 ...ach.xml => qemuhotplug-qemu-agent-nosource.xml} |   1 -
 .../qemuhotplug-qemu-agent.xml |   1 +
 .../qemuhotplug-base+qemu-agent-detach.xml |  58 -
 .../qemuhotplug-base+qemu-agent.xml|  58 -
 ...plug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} |   0
 ... => qemuhotplug-base-ccw-live+ccw-virtio-2.xml} |   0
 ...ive-with-2-ccw-virtio+ccw-virtio-1-explicit.xml |  73 --
 ...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml |  73 --
 ...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml |  73 --
 .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml  |  63 -
 xml => qemuhotplug-base-config+qemu-agent.xml} |   0
 .../qemuhotplug-base-live+qemu-agent-detach.xml|  58 -
 ...-base-with-scsi-controller-live+disk-scsi-2.xml |  51 -
 15 files changed, 140 insertions(+), 630 deletions(-)
 delete mode 100644 
tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
 rename tests/qemuhotplugtestdevices/{qemuhotplug-qemu-agent-detach.xml => 
qemuhotplug-qemu-agent-nosource.xml} (66%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent-detach.xml
 delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent.xml
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
 => qemuhotplug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} (100%)
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml 
=> qemuhotplug-base-ccw-live+ccw-virtio-2.xml} (100%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-config+qemu-agent+config.xml => 
qemuhotplug-base-config+qemu-agent.xml} (100%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-live+qemu-agent-detach.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-controller-live+disk-scsi-2.xml

-- 
2.7.4 (Apple Git-66)

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


[libvirt] [PATCH 2/2] qemuhotplugtest: change indentation

2016-08-02 Thread Tomasz Flendrich
---
 tests/qemuhotplugtest.c | 96 -
 1 file changed, 64 insertions(+), 32 deletions(-)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index c6f055e..296994c 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -462,85 +462,106 @@ mymain(void)
 "}" \
 "}\r\n"
 
-DO_TEST_UPDATE_LIVE("graphics-spice", "graphics-spice-nochange", NULL, 
false, false, NULL);
+DO_TEST_UPDATE_LIVE("graphics-spice", "graphics-spice-nochange",
+NULL, false, false, NULL);
 
-DO_TEST_UPDATE_LIVE("graphics-spice-timeout", 
"graphics-spice-timeout-nochange", NULL, false, false,
+DO_TEST_UPDATE_LIVE("graphics-spice-timeout", 
"graphics-spice-timeout-nochange",
+NULL, false, false,
 "set_password", QMP_OK, "expire_password", QMP_OK);
 
-DO_TEST_UPDATE_LIVE("graphics-spice-timeout", 
"graphics-spice-timeout-password", NULL, false, false,
+DO_TEST_UPDATE_LIVE("graphics-spice-timeout", 
"graphics-spice-timeout-password",
+NULL, false, false,
 "set_password", QMP_OK, "expire_password", QMP_OK);
 
 DO_TEST_UPDATE_LIVE("graphics-spice", "graphics-spice-listen", NULL, true, 
false, NULL);
 
-DO_TEST_UPDATE_LIVE("graphics-spice-listen-network", 
"graphics-spice-listen-network-password", NULL, false, false,
+DO_TEST_UPDATE_LIVE("graphics-spice-listen-network", 
"graphics-spice-listen-network-password",
+NULL, false, false,
 "set_password", QMP_OK, "expire_password", QMP_OK);
 
-DO_TEST_UPDATE_LIVE("disk-cdrom", "disk-cdrom-nochange", NULL, false, 
false, NULL);
+DO_TEST_UPDATE_LIVE("disk-cdrom", "disk-cdrom-nochange",
+NULL, false, false, NULL);
 
 DO_TEST_ATTACH_LIVE("console-compat-2-live", "console-virtio",
 "console-compat-2-live+console-virtio", false, true,
 "chardev-add", "{\"return\": {\"pty\": 
\"/dev/pts/26\"}}",
 "device_add", QMP_OK);
-DO_TEST_DETACH_LIVE(NULL, "console-virtio", "console-compat-2-live", 
false, false,
+DO_TEST_DETACH_LIVE(NULL, "console-virtio",
+"console-compat-2-live", false, false,
 "device_del", QMP_OK,
 "chardev-remove", QMP_OK);
 
-DO_TEST_ATTACH_LIVE("base-live", "disk-virtio", "base-live+disk-virtio", 
false, true,
+DO_TEST_ATTACH_LIVE("base-live", "disk-virtio",
+"base-live+disk-virtio", false, true,
 "human-monitor-command", HMP("OK\\r\\n"),
 "device_add", QMP_OK);
-DO_TEST_DETACH_LIVE(NULL, "disk-virtio", "base-live", false, false,
+DO_TEST_DETACH_LIVE(NULL, "disk-virtio",
+"base-live", false, false,
 "device_del", QMP_OK,
 "human-monitor-command", HMP(""));
 
-DO_TEST_ATTACH_EVENT_LIVE("base-live", "disk-virtio", 
"base-live+disk-virtio", false, true,
+DO_TEST_ATTACH_EVENT_LIVE("base-live", "disk-virtio",
+  "base-live+disk-virtio", false, true,
   "human-monitor-command", HMP("OK\\r\\n"),
   "device_add", QMP_OK,
   "qom-list", QOM_OK);
-DO_TEST_DETACH_LIVE(NULL, "disk-virtio", "base-live", true, true,
+DO_TEST_DETACH_LIVE(NULL, "disk-virtio",
+"base-live", true, true,
 "device_del", QMP_OK,
 "qom-list", QOM_OK,
 "human-monitor-command", HMP(""));
-DO_TEST_DETACH_LIVE(NULL, "disk-virtio", "base-live", false, false,
+DO_TEST_DETACH_LIVE(NULL, "disk-virtio",
+"base-live", false, false,
 "device_del", QMP_DEVICE_DELETED("virtio-disk4") 
QMP_OK,
 "human-monitor-command", HMP(""),
 "qom-list", QOM_OK);
 
-DO_TEST_ATTACH_LIVE("base-live", "disk-usb", "base-live+disk-usb", false, 
true,
+DO_TEST_ATTACH_LIVE("base-live", "disk-usb",
+"base-live+disk-usb", false, true,
 "human-monitor-command", HMP("OK\\r\\n"),
 "device_add", QMP_OK);
-DO_TEST_DETACH_LIVE(NULL, "disk-usb", "base-live", false, false,
+DO_TEST_DETACH_LIVE(NULL, "disk-usb",
+"base-live", false, false,
 "device_del", QMP_OK,
 "human-monitor-command", HMP(""));
 
-DO_TEST_ATTACH_EVENT_LIVE("base-live", "disk-usb", "base-live+disk-usb", 
false, true,
+DO_TEST_ATTACH_EVENT_LIVE("base-live", "disk-usb",
+  "base-live+disk-usb", false, true,
 

[libvirt] [PATCH 1/2] qemuhotplugtest: handle xml files more precisely

2016-08-02 Thread Tomasz Flendrich
In qemuhotplugtest.c, the way xml files with domain and device
definitions were handled was very unintuitive. Because of this,
creating new tests was troublesome. Sometimes, you were forced
to create duplicates of files.

I modified the tests to explicitly state the three xml files:
the domain xml, the device xml that is attached/detached/updated,
and the expected xml. Thanks to this, a few duplicates are deleted.
Also, a few xml files that weren't used at all are deleted.
---
 tests/qemuhotplugtest.c| 222 ++---
 .../qemuhotplug-ccw-virtio-1-reverse.xml   |   7 -
 ...ach.xml => qemuhotplug-qemu-agent-nosource.xml} |   1 -
 .../qemuhotplug-qemu-agent.xml |   1 +
 .../qemuhotplug-base+qemu-agent-detach.xml |  58 --
 .../qemuhotplug-base+qemu-agent.xml|  58 --
 ...plug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} |   0
 ... => qemuhotplug-base-ccw-live+ccw-virtio-2.xml} |   0
 ...ive-with-2-ccw-virtio+ccw-virtio-1-explicit.xml |  73 ---
 ...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml |  73 ---
 ...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml |  73 ---
 .../qemuhotplug-base-ccw-live-with-ccw-virtio.xml  |  63 --
 xml => qemuhotplug-base-config+qemu-agent.xml} |   0
 .../qemuhotplug-base-live+qemu-agent-detach.xml|  58 --
 ...-base-with-scsi-controller-live+disk-scsi-2.xml |  51 -
 15 files changed, 108 insertions(+), 630 deletions(-)
 delete mode 100644 
tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
 rename tests/qemuhotplugtestdevices/{qemuhotplug-qemu-agent-detach.xml => 
qemuhotplug-qemu-agent-nosource.xml} (66%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent-detach.xml
 delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent.xml
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml
 => qemuhotplug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} (100%)
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml 
=> qemuhotplug-base-ccw-live+ccw-virtio-2.xml} (100%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
 rename 
tests/qemuhotplugtestdomains/{qemuhotplug-base-config+qemu-agent+config.xml => 
qemuhotplug-base-config+qemu-agent.xml} (100%)
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-live+qemu-agent-detach.xml
 delete mode 100644 
tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-controller-live+disk-scsi-2.xml

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index f26aedd..c6f055e 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -47,6 +47,7 @@ enum {
 struct qemuHotplugTestData {
 const char *domain_filename;
 const char *device_filename;
+const char *expected_filename;
 bool fail;
 const char *const *mon;
 int action;
@@ -232,10 +233,10 @@ testQemuHotplug(const void *data)
 struct qemuHotplugTestData *test = (struct qemuHotplugTestData *) data;
 char *domain_filename = NULL;
 char *device_filename = NULL;
-char *result_filename = NULL;
+char *expected_filename = NULL;
 char *domain_xml = NULL;
 char *device_xml = NULL;
-char *result_xml = NULL;
+char *expected_xml = NULL;
 const char *const *tmp;
 bool fail = test->fail;
 bool keep = test->keep;
@@ -250,44 +251,29 @@ testQemuHotplug(const void *data)
 if (virAsprintf(_filename, 
"%s/qemuhotplugtestdomains/qemuhotplug-%s.xml",
 abs_srcdir, test->domain_filename) < 0 ||
 virAsprintf(_filename, 
"%s/qemuhotplugtestdevices/qemuhotplug-%s.xml",
-abs_srcdir, test->device_filename) < 0)
+abs_srcdir, test->device_filename) < 0 ||
+virAsprintf(_filename, 
"%s/qemuhotplugtestdomains/qemuhotplug-%s.xml",
+abs_srcdir, test->expected_filename) < 0)
 goto cleanup;
 
-switch (impact) {
-case VIR_DOMAIN_AFFECT_LIVE:
-if (virAsprintf(_filename,
-"%s/qemuhotplugtestdomains/qemuhotplug-%s+%s.xml",
-abs_srcdir, test->domain_filename,
-test->device_filename) < 0)
-goto cleanup;
-break;
-case VIR_DOMAIN_AFFECT_CONFIG:
-if (virAsprintf(_filename,
-
"%s/qemuhotplugtestdomains/qemuhotplug-%s+%s+config.xml",
-abs_srcdir, test->domain_filename,
-test->device_filename) < 0)
-

Re: [libvirt] [PATCH 0/2] Add ability to set specific IOThread scheduler quota/period

2016-08-02 Thread Michal Privoznik
On 25.07.2016 23:42, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1356937
> 
> 
> John Ferlan (2):
>   conf: Add IOThread quota and period scheduler/cputune defs
>   qemu: Add support to get/set IOThread period and quota cgroup values
> 
>  docs/formatdomain.html.in  |  25 
>  docs/schemas/domaincommon.rng  |  10 ++
>  include/libvirt/libvirt-domain.h   |  32 ++
>  src/conf/domain_conf.c |  42 +++
>  src/conf/domain_conf.h |   2 +
>  src/qemu/qemu_command.c|   3 +-
>  src/qemu/qemu_driver.c | 127 
> -
>  src/qemu/qemu_process.c|   4 +-
>  tests/qemuxml2argvdata/qemuxml2argv-cputune.xml|   2 +
>  .../qemuxml2xmloutdata/qemuxml2xmlout-cputune.xml  |   2 +
>  tools/virsh.pod|   9 +-
>  11 files changed, 249 insertions(+), 9 deletions(-)
> 

ACK to both.

Michal

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


Re: [libvirt] [PATCH python 2/2] event-test: Add node device lifecycle event tests

2016-08-02 Thread Cole Robinson
On 08/01/2016 08:16 AM, Marc Hartmayer wrote:
> On Thu, Jul 28, 2016 at 02:14 PM +0200, Jovanka Gulicoska 
>  wrote:
>> ---
>>  examples/event-test.py | 16 
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/examples/event-test.py b/examples/event-test.py
>> index 1bcea07..e06ebc6 100755
>> --- a/examples/event-test.py
>> +++ b/examples/event-test.py
>> @@ -584,6 +584,20 @@ def myStoragePoolEventRefreshCallback(conn, pool, 
>> opaque):
>>  print("myStoragePoolEventRefreshCallback: Storage pool %s" % 
>> pool.name())
>>
>>  ##
>> +# Node decice events
>> +##
> 
> Only a small note. There's a typo s/decice/device.

Thanks! I fixed the typo before pushing

- Cole

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


Re: [libvirt] [PATCH 0/2] Add ability to set specific IOThread scheduler quota/period

2016-08-02 Thread John Ferlan
ping?

Thanks -

John

On 07/25/2016 05:42 PM, John Ferlan wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1356937
> 
> 
> John Ferlan (2):
>   conf: Add IOThread quota and period scheduler/cputune defs
>   qemu: Add support to get/set IOThread period and quota cgroup values
> 
>  docs/formatdomain.html.in  |  25 
>  docs/schemas/domaincommon.rng  |  10 ++
>  include/libvirt/libvirt-domain.h   |  32 ++
>  src/conf/domain_conf.c |  42 +++
>  src/conf/domain_conf.h |   2 +
>  src/qemu/qemu_command.c|   3 +-
>  src/qemu/qemu_driver.c | 127 
> -
>  src/qemu/qemu_process.c|   4 +-
>  tests/qemuxml2argvdata/qemuxml2argv-cputune.xml|   2 +
>  .../qemuxml2xmloutdata/qemuxml2xmlout-cputune.xml  |   2 +
>  tools/virsh.pod|   9 +-
>  11 files changed, 249 insertions(+), 9 deletions(-)
> 

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


Re: [libvirt] [PATCH 0/5] Introduce NVDIMM support

2016-08-02 Thread Richard W.M. Jones
On Mon, Aug 01, 2016 at 05:10:04PM +0200, Michal Privoznik wrote:
> NVDIMM was introduced to qemu in v2.6.0-rc0~248^2~25. So it's
> been a while since then.
> 
> It's not the next big thing, but it is very interesting feature
> enabling higher performance as reading/writing to the module (and
> subsequently to the file on the host) does not require a VMEXIT.
> It can be used to access host files directly bypassing page cache
> whilst doing so.

Looks good.  Main thing from the libguestfs point of view is it
supports setting the shared access to 'private', so we can use it as a
way to accelerate the appliance root disk, which might also be of
interest to other libvirt users.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

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


[libvirt] [PATCH python] Post-release version bump to 2.2.0

2016-08-02 Thread Cole Robinson
---
Pushed as trivial

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

diff --git a/setup.py b/setup.py
index 647529b..240e796 100755
--- a/setup.py
+++ b/setup.py
@@ -307,7 +307,7 @@ class my_clean(clean):
 _c_modules, _py_modules = get_module_lists()
 
 setup(name = 'libvirt-python',
-  version = '2.1.0',
+  version = '2.2.0',
   url = 'http://www.libvirt.org',
   maintainer = 'Libvirt Maintainers',
   maintainer_email = 'libvir-list@redhat.com',
-- 
2.7.4

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


[libvirt] [PATCH] remote: Fix indentation of the remote protocol structs check file

2016-08-02 Thread Peter Krempa
---

Pushed under the build-breaker rule.

 src/remote_protocol-structs | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs
index 0e66fc5..24401d1 100644
--- a/src/remote_protocol-structs
+++ b/src/remote_protocol-structs
@@ -2572,20 +2572,20 @@ struct remote_storage_pool_event_refresh_msg {
 remote_nonnull_storage_pool pool;
 };
 struct remote_connect_node_device_event_register_any_args {
- inteventID;
- remote_node_device dev;
+inteventID;
+remote_node_device dev;
 };
 struct remote_connect_node_device_event_register_any_ret {
- intcallbackID;
+intcallbackID;
 };
 struct remote_connect_node_device_event_deregister_any_args {
- intcallbackID;
+intcallbackID;
 };
 struct remote_node_device_event_lifecycle_msg {
- int callbackID;
- remote_nonnull_node_device  dev;
- int event;
- int detail;
+intcallbackID;
+remote_nonnull_node_device dev;
+intevent;
+intdetail;
 };
 struct remote_domain_fsfreeze_args {
 remote_nonnull_domain  dom;
-- 
2.9.2

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


Re: [libvirt] [PATCH] tests: Make schema test fail on XML schema errors

2016-08-02 Thread Ján Tomko

On Tue, Aug 02, 2016 at 09:19:07AM +0200, Peter Krempa wrote:

Failure to parse the schema file would not trigger a test suite failure.

In addition to making the test fail it's necessary to split up the
parsing of the schema file into a separate test.

This is necessary as the XML validator uses libvirt errors to report
problems parsing of the actual schema RNG needs to be split out into a
separate function and called via virTestRun which has the
infrastructure to report them.
---
tests/virschematest.c | 64 ---
1 file changed, 46 insertions(+), 18 deletions(-)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index a1901e7..dbd9f3b 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -114,24 +114,17 @@ testSchemaDir(const char *schema,


static int
-testSchemaDirs(const char *schema, ...)
+testSchemaDirs(const char *schema, virXMLValidatorPtr validator, ...)
{
-virXMLValidatorPtr validator = NULL;
va_list args;
int ret = 0;
-char *schema_path = NULL;
char *dir_path = NULL;
const char *dir;

-va_start(args, schema);
-
-if (virAsprintf(_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) 
< 0)
-goto cleanup;
-
-if (!(validator = virXMLValidatorInit(schema_path)))
-goto cleanup;
+va_start(args, validator);

while ((dir = va_arg(args, char *))) {



+printf("\nDERP: %s\n", dir);


ACK with this line removed.

Jan


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

Re: [libvirt] [PATCHv3 2b/9] qemu: Use qemuAliasFromDisk to generate drive alias

2016-08-02 Thread Ján Tomko

On Mon, Aug 01, 2016 at 08:29:10AM -0400, John Ferlan wrote:

The qemuDomainSnapshotCreateSingleDiskActive open coded generating the
disk drive alias. Let's use the common function.

Signed-off-by: John Ferlan 
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



ACK

Jan


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

Re: [libvirt] [PATCH v2 2/3] virsh: qemu-monitor-command: Don't print extra newline with --pretty

2016-08-02 Thread Ján Tomko

On Mon, Aug 01, 2016 at 01:34:56PM +0200, Peter Krempa wrote:

The prettified JSON string already contains a newline so don't print
another one. This allows to pipe the json output (in conjunction with
the --quiet option) to files without having to truncate them afterwards.
---
tools/virsh-domain.c | 1 +
1 file changed, 1 insertion(+)



ACK

Jan


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

Re: [libvirt] [PATCHv3 2c/9] qemu: Use qemuAliasFromDisk instead of qemuDeviceDriveHostAlias

2016-08-02 Thread Ján Tomko

On Mon, Aug 01, 2016 at 08:48:27AM -0400, John Ferlan wrote:

Since we already have a function that will generate the drivestr from
the alias, let's use it and remove the qemuDeviceDriveHostAlias.

Move the QEMU_DRIVE_HOST_PREFIX definition into qemu_alias.h.

Also alter qemuAliasFromDisk to use the QEMU_DRIVE_HOST_PREFIX instead
of "drive-%s".

Signed-off-by: John Ferlan 
---
src/qemu/qemu_alias.c| 13 +++--
src/qemu/qemu_alias.h|  2 ++
src/qemu/qemu_command.c  | 11 ---
src/qemu/qemu_command.h  |  1 -
src/qemu/qemu_hotplug.c  |  4 ++--
src/qemu/qemu_migration.c|  2 +-
src/qemu/qemu_monitor_json.c |  2 +-
src/qemu/qemu_monitor_text.c |  2 +-
8 files changed, 18 insertions(+), 19 deletions(-)



ACK

Jan


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

Re: [libvirt] [PATCHv3 2a/9] qemu: Remove generation of drive alias from qcow passphrase backends

2016-08-02 Thread Ján Tomko

On Mon, Aug 01, 2016 at 08:23:37AM -0400, John Ferlan wrote:

Rather than pass the disks[i]->info.alias to qemuMonitorSetDrivePassphrase
and then generate the "drive-%s" alias from that, let's use qemuAliasFromDisk
prior to the call to generate the drive alias and then pass that along
thus removing the need to generate the alias from the monitor code.

Signed-off-by: John Ferlan 
---

Mainly so it's more apparent/transparent what I was planning to do.
If you'd rather see the whole series again - that's not a problem...

src/qemu/qemu_monitor_json.c | 7 +--
src/qemu/qemu_monitor_text.c | 3 +--
src/qemu/qemu_process.c  | 2 +-
tests/qemumonitorjsontest.c  | 2 +-
4 files changed, 4 insertions(+), 10 deletions(-)



ACK

Jan


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

Re: [libvirt] Release of libvirt-2.1.0

2016-08-02 Thread Justin Clift
On 2 Aug 2016, at 09:57, Daniel Veillard  wrote:
>   Sorry I didn't push an rc2 on Friday, finishing my move, but not seeing any
> issue raised by rc1, I though it was better to push the final release now and 
> free
> up the tree for pending development. As a result 2.1.0 is tagged in git and I
> pushed signed tarbal and rpms to the usual place:
> 
>ftp://libvirt.org/libvirt/

It's working for OSX too. (whew!) :)

Libvirt 2.1.0 is now available through OSX Homebrew.

+ Justin

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi


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


Re: [libvirt] [PATCH v2 0/3] libxl hooks

2016-08-02 Thread Cedric Bosdonnat
On Tue, 2016-08-02 at 08:56 -0400, John Ferlan wrote:
> 
> On 07/28/2016 05:57 AM, Cédric Bosdonnat wrote:
> > Hey there!
> > 
> > Diffs to v1:
> >   * move the ret = 0 to the proper patch
> >   * fix typos as pointed by Joao
> >   * use ignore_value where needed
> > 
> > Cédric Bosdonnat (3):
> >   libxl: add a flag to mark guests as tainted by a hook
> >   libxl: fix segfault in libxlReconnectDomain
> >   libxl: add hooks support
> > 
> >  docs/hooks.html.in  | 53 ++--
> >  src/libxl/libxl_domain.c| 84 
> > +
> >  src/libxl/libxl_domain.h|  2 ++
> >  src/libxl/libxl_driver.c| 52 +---
> >  src/libxl/libxl_migration.c | 57 ++
> >  src/util/virhook.c  | 16 -
> >  src/util/virhook.h  | 13 +++
> >  7 files changed, 262 insertions(+), 15 deletions(-)
> > 
> 
> These patches were pushed, but are causing build failures (at least for
> me). I made sure to reset/clean my environment, but still many failures:

ouch! I build quite a number of times without seeing those... Not sure why.
Thanks for the fixes.

--
Cedric


> libxl/libxl_domain.c: In function 'libxlDomainCleanup':
> libxl/libxl_domain.c:1361:0: error: unterminated argument list invoking
> macro "ignore_value"
>  }
> 
> libxl/libxl_domain.c:808:9: error: 'ignore_value' undeclared (first use
> in this function)
>  ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name,
>  ^~~~
> libxl/libxl_domain.c:808:9: note: each undeclared identifier is reported
> only once for each function it appears in
> libxl/libxl_domain.c:808:9: error: expected ';' at end of input
> libxl/libxl_domain.c:808:9: error: expected declaration or statement at
> end of input
> libxl/libxl_domain.c:805:15: error: unused variable 'xml'
> [-Werror=unused-variable]
>  char *xml = virDomainDefFormat(vm->def, cfg->caps, 0);
>^~~
> libxl/libxl_domain.c:808:9: error: expected declaration or statement at
> end of input
>  ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name,
>  ^~~~
> cc1: all warnings being treated as errors
> Makefile:8671: recipe for target
> 'libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo' failed
> make[5]: *** [libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo] Error 1
> make[5]: *** Waiting for unfinished jobs
> libxl/libxl_driver.c: In function 'libxlDomainAttachDeviceLive':
> libxl/libxl_driver.c:3409:19: error: implicit declaration of function
> 'libxlDomainAttachControllerDevice' [-Werror=implicit-function-declaration]
>  ret = libxlDomainAttachControllerDevice(driver, vm,
> dev->data.controller);
>^
> libxl/libxl_driver.c:3409:13: error: nested extern declaration of
> 'libxlDomainAttachControllerDevice' [-Werror=nested-externs]
>  ret = libxlDomainAttachControllerDevice(driver, vm,
> dev->data.controller);
>  ^~~
> libxl/libxl_driver.c: In function 'libxlDomainDetachDeviceLive':
> libxl/libxl_driver.c:3830:19: error: implicit declaration of function
> 'libxlDomainDetachControllerDevice' [-Werror=implicit-function-declaration]
>  ret = libxlDomainDetachControllerDevice(driver, vm, dev);
>^
> libxl/libxl_driver.c:3830:13: error: nested extern declaration of
> 'libxlDomainDetachControllerDevice' [-Werror=nested-externs]
>  ret = libxlDomainDetachControllerDevice(driver, vm, dev);
>  ^~~
> cc1: all warnings being treated as errors
> Makefile:8678: recipe for target
> 'libxl/libvirt_driver_libxl_impl_la-libxl_driver.lo' failed
> 

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

Re: [libvirt] [PATCH v2] qemu: set fake reboot flag only in acpi mode

2016-08-02 Thread John Ferlan


On 07/16/2016 08:35 AM, John Ferlan wrote:
> 
> 
> On 07/14/2016 07:08 AM, Nikolay Shirokovskiy wrote:
>> First this fixes the same issue as e2b86f580. Only difference is
>> that reboot is done via shutdown function with reboot semantics.
>>
>> Second 8be502fd tells us that we need to always set fake reboot
>> flag if shutdown/reboot will trigger shutdown event. To put
>> it simple we need to set it false if agent is used.
>>
>> References:
>>
>> e2b86f580 - fixes guest shutdown becames reboot after API reboot thru agent
>> 8be502fd - fixes API shutdown thru agent becames reboot after API reboot
>>   thru acpi (more on 
>> https://www.redhat.com/archives/libvir-list/2015-April/msg00715.html)
> 
> s/becames/becomes/
> 
>> ---
>>  src/qemu/qemu_driver.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
> 
> This seems reasonable to me; however, I'd be interesting in getting
> Zhang Bo(Oscar)'s take on this too since that patch processing was being
> questioned in the v1 response:
> 
> http://www.redhat.com/archives/libvir-list/2016-July/msg00473.html
> 
> In any case, Zhang is CC'd on this just in case he hasn't been following
> the discussion...
> 

Now that the 2.1 release is out - I took the liberty of splitting the
patches (one for reboot and one for shutdown) and adjusting the commit
messages and pushed the changes.

John

> John
> 
> FWIW: I do think this needs to be two patches... One for each API... If
> they ever need to be backported to some release version, then it's
> easier to do so...  Besides there are two distinct changes - one to have
> shutdown follow e2b86f580 and the second to alter 8be502fd in order to
> also take into consideration the agent path.
> 
> 
> 
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 2089359..8855387 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -1997,9 +1997,9 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, 
>> unsigned int flags)
>>  useAgent = false;
>>  }
>>  
>> -qemuDomainSetFakeReboot(driver, vm, isReboot);
>>  
>>  if (useAgent) {
>> +qemuDomainSetFakeReboot(driver, vm, false);
>>  qemuDomainObjEnterAgent(vm);
>>  ret = qemuAgentShutdown(priv->agent, agentFlag);
>>  qemuDomainObjExitAgent(vm);
>> @@ -2018,6 +2018,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, 
>> unsigned int flags)
>>  goto endjob;
>>  }
>>  
>> +qemuDomainSetFakeReboot(driver, vm, isReboot);
>>  qemuDomainObjEnterMonitor(driver, vm);
>>  ret = qemuMonitorSystemPowerdown(priv->mon);
>>  if (qemuDomainObjExitMonitor(driver, vm) < 0)
>> @@ -2091,6 +2092,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
>>  }
>>  
>>  if (useAgent) {
>> +qemuDomainSetFakeReboot(driver, vm, false);
>>  qemuDomainObjEnterAgent(vm);
>>  ret = qemuAgentShutdown(priv->agent, agentFlag);
>>  qemuDomainObjExitAgent(vm);
>>
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

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


Re: [libvirt] [PATCH glib] Delete the manually written python binding

2016-08-02 Thread Christophe Fergeau

Acked-by: Christophe Fergeau 

On Tue, Aug 02, 2016 at 02:34:33PM +0100, Daniel P. Berrange wrote:
> The python binding only supports python2, only supports
> 1 single API in libvirt-glib and has not even been enabled
> in RPM builds since Fedora 15. Any distro these days should
> have gobject introspection and pygobject available, so
> there's no compelling reason to continue to have the python
> binding exist.
> 
> Signed-off-by: Daniel P. Berrange 
> ---
>  Makefile.am|  2 +-
>  autobuild.sh   |  6 ++--
>  cfg.mk |  3 --
>  configure.ac   | 87 
> --
>  libvirt-glib.spec.in   | 35 +--
>  mingw-libvirt-glib.spec.in |  3 +-
>  python/Makefile.am | 34 --
>  python/libvirt-glib.c  | 59 ---
>  python/libvirtglib.py  | 10 --
>  9 files changed, 5 insertions(+), 234 deletions(-)
>  delete mode 100644 python/Makefile.am
>  delete mode 100644 python/libvirt-glib.c
>  delete mode 100644 python/libvirtglib.py
> 
> diff --git a/Makefile.am b/Makefile.am
> index ae8b06d..459d544 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -1,5 +1,5 @@
>  
> -SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject python vapi examples 
> docs po tests
> +SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject vapi examples docs po 
> tests
>  
>  ACLOCAL_AMFLAGS = -I m4
>  
> diff --git a/autobuild.sh b/autobuild.sh
> index 053dc1f..9935de1 100755
> --- a/autobuild.sh
> +++ b/autobuild.sh
> @@ -56,8 +56,7 @@ if test -x /usr/bin/i686-w64-mingw32-gcc ; then
>  --host=i686-w64-mingw32 \
>  --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
>  --enable-werror \
> ---enable-introspection=no \
> ---without-python
> +--enable-introspection=no
>  
>make
>make install
> @@ -75,8 +74,7 @@ if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
>  --host=x86_64-w64-mingw32 \
>  --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
>  --enable-werror \
> ---enable-introspection=no \
> ---without-python
> +--enable-introspection=no
>  
>make
>make install
> diff --git a/cfg.mk b/cfg.mk
> index b322393..6dd34cf 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -115,9 +115,6 @@ exclude_file_name_regexp--sc_preprocessor_indentation = 
> ^*/*.[ch]
>  
>  exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
>  
> -exclude_file_name_regexp--sc_require_config_h = python/libvirt-glib.c
> -exclude_file_name_regexp--sc_require_config_h_first = python/libvirt-glib.c
> -
>  # XXX we shouldn't really ignore this, but the horrible enum rules...
>  exclude_file_name_regexp--sc_makefile_at_at_check = 
> libvirt-gobject/Makefile.am
>  
> diff --git a/configure.ac b/configure.ac
> index 8edde74..cc9b2aa 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -135,15 +135,11 @@ dnl Copied from libxml2 configure.in, but I removed 
> mingw changes
>  dnl for now since I'm not supporting mingw at present.  - RWMJ
>  CYGWIN_EXTRA_LDFLAGS=
>  CYGWIN_EXTRA_LIBADD=
> -CYGWIN_EXTRA_PYTHON_LIBADD=
>  MINGW_EXTRA_LDFLAGS=
>  case "$host" in
>*-*-cygwin*)
>  CYGWIN_EXTRA_LDFLAGS="-no-undefined"
>  CYGWIN_EXTRA_LIBADD="${INTLLIBS}"
> -if test "x$PYTHON_VERSION" != "x"; then
> -  CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config 
> -lpython${PYTHON_VERSION}"
> -fi
>  ;;
>*-*-mingw*)
>  MINGW_EXTRA_LDFLAGS="-no-undefined"
> @@ -151,7 +147,6 @@ case "$host" in
>  esac
>  AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
>  AC_SUBST([CYGWIN_EXTRA_LIBADD])
> -AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
>  AC_SUBST([MINGW_EXTRA_LDFLAGS])
>  
>  
> @@ -172,87 +167,6 @@ if test "${enable_coverage}" = yes; then
>COV_FLAGS=
>  fi
>  
> -dnl
> -dnl check for python
> -dnl
> -AC_ARG_WITH([python],
> -  AC_HELP_STRING([--with-python], [Build python bindings 
> @<:@default=yes@:>@]),[],[with_python=yes])
> -
> -PYTHON_VERSION=
> -PYTHON_INCLUDES=
> -PYTHON_SITE_PACKAGES=
> -PYTHON_TESTS=
> -pythondir=
> -if test "$with_python" != "no" ; then
> -if test "$with_python" = "yes" ; then
> -   with_python=""
> -fi
> -if test -x "$with_python/bin/python"
> -then
> -echo Found python in $with_python/bin/python
> -PYTHON="$with_python/bin/python"
> -else
> - if test -x "$with_python"
> - then
> - echo Found python in $with_python
> - PYTHON="$with_python"
> - else
> - if test -x "$PYTHON"
> - then
> - echo Found python in environment PYTHON=$PYTHON
> - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
> - else
> - AC_PATH_PROG([PYTHON], [python python2.6 python2.5 python2.4 
> python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
> - fi
> - fi
> -fi
> -if test "$PYTHON" != ""
> -

Re: [libvirt] [PATCH v2 2/3] libxl: fix segfault in libxlReconnectDomain

2016-08-02 Thread Michal Privoznik
On 28.07.2016 11:57, Cédric Bosdonnat wrote:
> In case of error, libxlReconnectDomain may call
> virDomainObjListRemoveLocked. However it has no local reference on
> the domain object, leading to segfault. Get a reference to the domain
> object at the start of the function and release it at the end to avoid
> problems.
> 
> This commit also factorizes code between the error and normal ends.
> ---
>  src/libxl/libxl_driver.c | 30 ++
>  1 file changed, 18 insertions(+), 12 deletions(-)

This fixes a real problem and is not strictly hook related. I don't
mind, but other's would. So you'd better switch this one with 1/3 and
push quickly :)

Michal

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


Re: [libvirt] [PATCH v2 3/3] libxl: add hooks support

2016-08-02 Thread Michal Privoznik
On 28.07.2016 11:57, Cédric Bosdonnat wrote:
> Introduce libxl hook and use it for start, prepare, started,
> stop, stopped, migrate events.
> ---
>  docs/hooks.html.in  | 53 ++--
>  src/libxl/libxl_domain.c| 74 
> +
>  src/libxl/libxl_driver.c| 22 ++
>  src/libxl/libxl_migration.c | 57 ++
>  src/util/virhook.c  | 16 +-
>  src/util/virhook.h  | 13 
>  6 files changed, 232 insertions(+), 3 deletions(-)
> 
> diff --git a/docs/hooks.html.in b/docs/hooks.html.in
> index d4f4ac3..11073cb 100644
> --- a/docs/hooks.html.in
> +++ b/docs/hooks.html.in
> @@ -17,8 +17,10 @@
>(since 0.8.0)
>A QEMU guest is started or stopped
>   (since 0.8.0)
> - An LXC guest is started or stopped
> +  An LXC guest is started or stopped
>   (since 0.8.0)
> +  A libxl-handled Xen guest is started or stopped
> + (since 2.1.0)
>A network is started or stopped or an interface is
>plugged/unplugged to/from the network
>(since 1.2.2)
> @@ -41,7 +43,7 @@
>  
>  
>  Script names
> -At present, there are three hook scripts that can be called:
> +At present, there are five hook scripts that can be called:
>  
>/etc/libvirt/hooks/daemon
>Executed when the libvirt daemon is started, stopped, or reloads
> @@ -50,6 +52,9 @@
>Executed when a QEMU guest is started, stopped, or 
> migrated
>/etc/libvirt/hooks/lxc
>Executed when an LXC guest is started or stopped
> +  /etc/libvirt/hooks/libxl
> +  Executed when a libxl-handled Xen guest is started, stopped, or
> +  migrated
>/etc/libvirt/hooks/network
>Executed when a network is started or stopped or an
>interface is plugged/unplugged to/from the network
> @@ -235,6 +240,50 @@
>
>  
>  
> +/etc/libvirt/hooks/libxl
> +
> +  Before a Xen guest is started using libxl driver, the libxl hook
> +script is called in three locations; if any location fails, the guest
> +is not started.  The first location, since
> +2.1.0, is before libvirt performs any resource
> +labeling, and the hook can allocate resources not managed by
> +libvirt.  This is called as:
> +/etc/libvirt/hooks/libxl guest_name prepare begin -
> +The second location, available Since
> +2.1.0, occurs after libvirt has finished labeling
> +all resources, but has not yet started the guest, called as:
> +/etc/libvirt/hooks/libxl guest_name start begin -
> +The third location, 2.1.0,
> +occurs after the domain has successfully started up:
> +/etc/libvirt/hooks/libxl guest_name started begin -
> +  
> +  When a libxl-handled Xen guest is stopped, the libxl hook script
> +is called in two locations, to match the startup.
> +First, since 2.1.0, the hook is
> +called before libvirt restores any labels:
> +/etc/libvirt/hooks/libxl guest_name stopped end -
> +Then, after libvirt has released all resources, the hook is
> +called again, since 2.1.0, to allow
> +any additional resource cleanup:
> +/etc/libvirt/hooks/libxl guest_name release end -
> +  Since 2.1.0, the libxl hook script
> +is also called at the beginning of incoming migration. It is called
> +as: /etc/libvirt/hooks/libxl guest_name migrate begin -
> +with domain XML sent to standard input of the script. In this case,
> +the script acts as a filter and is supposed to modify the domain
> +XML and print it out on its standard output. Empty output is
> +identical to copying the input XML without changing it. In case the
> +script returns failure or the output XML is not valid, incoming
> +migration will be canceled. This hook may be used, e.g., to change
> +location of disk images for incoming domains.
> +  Since 2.1.0, the libxl hook script
> +is also called when the libvirtd daemon restarts and reconnects
> +to previously running Xen domains. If the script fails, the
> +existing Xen domains will be killed off. It is called as:
> +/etc/libvirt/hooks/libxl guest_name reconnect begin -
> +  
> +
> +
>  /etc/libvirt/hooks/network
>  
>Since 1.2.2, before a network is 
> started,
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index 886b40f..d99f903 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -32,6 +32,7 @@
>  #include "viratomic.h"
>  #include "virfile.h"
>  #include "virerror.h"
> +#include "virhook.h"
>  #include "virlog.h"
>  #include "virstring.h"
>  #include "virtime.h"
> @@ -737,6 +738,17 @@ libxlDomainCleanup(libxlDriverPrivatePtr 

Re: [libvirt] [PATCH v2 0/3] libxl hooks

2016-08-02 Thread Michal Privoznik
On 28.07.2016 11:57, Cédric Bosdonnat wrote:
> Hey there!
> 
> Diffs to v1:
>   * move the ret = 0 to the proper patch
>   * fix typos as pointed by Joao
>   * use ignore_value where needed
> 
> Cédric Bosdonnat (3):
>   libxl: add a flag to mark guests as tainted by a hook
>   libxl: fix segfault in libxlReconnectDomain
>   libxl: add hooks support
> 
>  docs/hooks.html.in  | 53 ++--
>  src/libxl/libxl_domain.c| 84 
> +
>  src/libxl/libxl_domain.h|  2 ++
>  src/libxl/libxl_driver.c| 52 +---
>  src/libxl/libxl_migration.c | 57 ++
>  src/util/virhook.c  | 16 -
>  src/util/virhook.h  | 13 +++
>  7 files changed, 262 insertions(+), 15 deletions(-)
> 

D'oh, you've just pushed this. ACK then.

Michal

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

[libvirt] [PATCH glib] Delete the manually written python binding

2016-08-02 Thread Daniel P. Berrange
The python binding only supports python2, only supports
1 single API in libvirt-glib and has not even been enabled
in RPM builds since Fedora 15. Any distro these days should
have gobject introspection and pygobject available, so
there's no compelling reason to continue to have the python
binding exist.

Signed-off-by: Daniel P. Berrange 
---
 Makefile.am|  2 +-
 autobuild.sh   |  6 ++--
 cfg.mk |  3 --
 configure.ac   | 87 --
 libvirt-glib.spec.in   | 35 +--
 mingw-libvirt-glib.spec.in |  3 +-
 python/Makefile.am | 34 --
 python/libvirt-glib.c  | 59 ---
 python/libvirtglib.py  | 10 --
 9 files changed, 5 insertions(+), 234 deletions(-)
 delete mode 100644 python/Makefile.am
 delete mode 100644 python/libvirt-glib.c
 delete mode 100644 python/libvirtglib.py

diff --git a/Makefile.am b/Makefile.am
index ae8b06d..459d544 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
 
-SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject python vapi examples 
docs po tests
+SUBDIRS = libvirt-glib libvirt-gconfig libvirt-gobject vapi examples docs po 
tests
 
 ACLOCAL_AMFLAGS = -I m4
 
diff --git a/autobuild.sh b/autobuild.sh
index 053dc1f..9935de1 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -56,8 +56,7 @@ if test -x /usr/bin/i686-w64-mingw32-gcc ; then
 --host=i686-w64-mingw32 \
 --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
 --enable-werror \
---enable-introspection=no \
---without-python
+--enable-introspection=no
 
   make
   make install
@@ -75,8 +74,7 @@ if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
 --host=x86_64-w64-mingw32 \
 --prefix="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw" \
 --enable-werror \
---enable-introspection=no \
---without-python
+--enable-introspection=no
 
   make
   make install
diff --git a/cfg.mk b/cfg.mk
index b322393..6dd34cf 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -115,9 +115,6 @@ exclude_file_name_regexp--sc_preprocessor_indentation = 
^*/*.[ch]
 
 exclude_file_name_regexp--sc_prohibit_strcmp = ^*/*.[ch]
 
-exclude_file_name_regexp--sc_require_config_h = python/libvirt-glib.c
-exclude_file_name_regexp--sc_require_config_h_first = python/libvirt-glib.c
-
 # XXX we shouldn't really ignore this, but the horrible enum rules...
 exclude_file_name_regexp--sc_makefile_at_at_check = libvirt-gobject/Makefile.am
 
diff --git a/configure.ac b/configure.ac
index 8edde74..cc9b2aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,15 +135,11 @@ dnl Copied from libxml2 configure.in, but I removed mingw 
changes
 dnl for now since I'm not supporting mingw at present.  - RWMJ
 CYGWIN_EXTRA_LDFLAGS=
 CYGWIN_EXTRA_LIBADD=
-CYGWIN_EXTRA_PYTHON_LIBADD=
 MINGW_EXTRA_LDFLAGS=
 case "$host" in
   *-*-cygwin*)
 CYGWIN_EXTRA_LDFLAGS="-no-undefined"
 CYGWIN_EXTRA_LIBADD="${INTLLIBS}"
-if test "x$PYTHON_VERSION" != "x"; then
-  CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config 
-lpython${PYTHON_VERSION}"
-fi
 ;;
   *-*-mingw*)
 MINGW_EXTRA_LDFLAGS="-no-undefined"
@@ -151,7 +147,6 @@ case "$host" in
 esac
 AC_SUBST([CYGWIN_EXTRA_LDFLAGS])
 AC_SUBST([CYGWIN_EXTRA_LIBADD])
-AC_SUBST([CYGWIN_EXTRA_PYTHON_LIBADD])
 AC_SUBST([MINGW_EXTRA_LDFLAGS])
 
 
@@ -172,87 +167,6 @@ if test "${enable_coverage}" = yes; then
   COV_FLAGS=
 fi
 
-dnl
-dnl check for python
-dnl
-AC_ARG_WITH([python],
-  AC_HELP_STRING([--with-python], [Build python bindings 
@<:@default=yes@:>@]),[],[with_python=yes])
-
-PYTHON_VERSION=
-PYTHON_INCLUDES=
-PYTHON_SITE_PACKAGES=
-PYTHON_TESTS=
-pythondir=
-if test "$with_python" != "no" ; then
-if test "$with_python" = "yes" ; then
-   with_python=""
-fi
-if test -x "$with_python/bin/python"
-then
-echo Found python in $with_python/bin/python
-PYTHON="$with_python/bin/python"
-else
-   if test -x "$with_python"
-   then
-   echo Found python in $with_python
-   PYTHON="$with_python"
-   else
-   if test -x "$PYTHON"
-   then
-   echo Found python in environment PYTHON=$PYTHON
-   with_python=`$PYTHON -c "import sys; print sys.exec_prefix"`
-   else
-   AC_PATH_PROG([PYTHON], [python python2.6 python2.5 python2.4 
python2.3 python2.2 python2.1 python2.0 python1.6 python1.5])
-   fi
-   fi
-fi
-if test "$PYTHON" != ""
-then
-PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
-   echo Found Python version $PYTHON_VERSION
-fi
-if test "$PYTHON_VERSION" != ""
-then
-   if test -r $with_python/include/python$PYTHON_VERSION/Python.h && \
-  test -d $with_python/lib/python$PYTHON_VERSION/site-packages
-   then
-   

[libvirt] [PATCH 0/2] Fixes for broken build

2016-08-02 Thread John Ferlan
Pushed under the build breaker rule

John Ferlan (2):
  libxl: Fix broken build from libxlDomainCleanup
  libxl: Fix broken build attach/detach controller device

 src/libxl/libxl_domain.c | 2 +-
 src/libxl/libxl_driver.c | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.7.4

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


[libvirt] [PATCH 2/2] libxl: Fix broken build attach/detach controller device

2016-08-02 Thread John Ferlan
Commit id '44304c6eb' added the API libxlDomainAttachControllerDevice
inside a conditional LIBXL_HAVE_PVUSB, but called that function outside
the conditional in libxlDomainAttachDeviceLive.

Similarly, the API libxlDomainDetachControllerDevice was added inside a
conditional LIBXL_HAVE_PVUSB, but called outside the conditional in
libxlDomainDetachDeviceLive.

This patch adds the conditional LIBXL_HAVE_PVUSB around those two calls
from within the switch.

Signed-off-by: John Ferlan 
---
 src/libxl/libxl_driver.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index bd7ce6b..4957072 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3405,11 +3405,13 @@ libxlDomainAttachDeviceLive(libxlDriverPrivatePtr 
driver,
 dev->data.disk = NULL;
 break;
 
+#ifdef LIBXL_HAVE_PVUSB
 case VIR_DOMAIN_DEVICE_CONTROLLER:
 ret = libxlDomainAttachControllerDevice(driver, vm, 
dev->data.controller);
 if (!ret)
 dev->data.controller = NULL;
 break;
+#endif
 
 case VIR_DOMAIN_DEVICE_NET:
 ret = libxlDomainAttachNetDevice(driver, vm,
@@ -3826,9 +3828,11 @@ libxlDomainDetachDeviceLive(libxlDriverPrivatePtr driver,
 ret = libxlDomainDetachDeviceDiskLive(vm, dev);
 break;
 
+#ifdef LIBXL_HAVE_PVUSB
 case VIR_DOMAIN_DEVICE_CONTROLLER:
 ret = libxlDomainDetachControllerDevice(driver, vm, dev);
 break;
+#endif
 
 case VIR_DOMAIN_DEVICE_NET:
 ret = libxlDomainDetachNetDevice(driver, vm,
-- 
2.7.4

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


[libvirt] [PATCH 1/2] libxl: Fix broken build from libxlDomainCleanup

2016-08-02 Thread John Ferlan
Commit id '7d3b2eb5' missed a closing parenthesis on the ignore_value
macro, causing the failure

Signed-off-by: John Ferlan 
---
 src/libxl/libxl_domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index d99f903..57ef235 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -807,7 +807,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
 /* we can't stop the operation even if the script raised an error */
 ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name,
  VIR_HOOK_LIBXL_OP_RELEASE, VIR_HOOK_SUBOP_END,
- NULL, xml, NULL);
+ NULL, xml, NULL));
 VIR_FREE(xml);
 }
 
-- 
2.7.4

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


Re: [libvirt] [PATCH V2 3/7] libxl: support usb controller hotplug

2016-08-02 Thread John Ferlan


On 06/15/2016 02:00 AM, Chunyan Liu wrote:
> Support USB controller hot-plug and hot-unplug.
> 
>  #virsh attach-device dom usbctrl.xml
>  #virsh detach-device dom usbctrl.xml
>  usbctrl.xml example:
>  
> 
> Signed-off-by: Chunyan Liu 
> ---
>  src/libxl/libxl_driver.c | 144 
> +++
>  1 file changed, 144 insertions(+)
> 


Looks like this is also partially responsible for recent build failures
as libxlDomainAttachControllerDevice can be called from outside the
LIBXL_HAVE_PVUSB conditional... Similarly libxlDomainDetachDeviceLive
has the same issue

...

'libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo' failed
make[5]: *** [libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo] Error 1
make[5]: *** Waiting for unfinished jobs
libxl/libxl_driver.c: In function 'libxlDomainAttachDeviceLive':
libxl/libxl_driver.c:3409:19: error: implicit declaration of function
'libxlDomainAttachControllerDevice' [-Werror=implicit-function-declaration]
 ret = libxlDomainAttachControllerDevice(driver, vm,
dev->data.controller);
   ^
libxl/libxl_driver.c:3409:13: error: nested extern declaration of
'libxlDomainAttachControllerDevice' [-Werror=nested-externs]
 ret = libxlDomainAttachControllerDevice(driver, vm,
dev->data.controller);
 ^~~
libxl/libxl_driver.c: In function 'libxlDomainDetachDeviceLive':
libxl/libxl_driver.c:3830:19: error: implicit declaration of function
'libxlDomainDetachControllerDevice' [-Werror=implicit-function-declaration]
 ret = libxlDomainDetachControllerDevice(driver, vm, dev);
   ^
libxl/libxl_driver.c:3830:13: error: nested extern declaration of
'libxlDomainDetachControllerDevice' [-Werror=nested-externs]
 ret = libxlDomainDetachControllerDevice(driver, vm, dev);
 ^~~
cc1: all warnings being treated as errors
Makefile:8678: recipe for target
'libxl/libvirt_driver_libxl_impl_la-libxl_driver.lo' failed


John

> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index f507265..f614769 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -3006,6 +3006,60 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr 
> driver,
>  
>  #ifdef LIBXL_HAVE_PVUSB
>  static int
> +libxlDomainAttachControllerDevice(libxlDriverPrivatePtr driver,
> +  virDomainObjPtr vm,
> +  virDomainControllerDefPtr controller)
> +{
> +libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
> +const char *type = virDomainControllerTypeToString(controller->type);
> +libxl_device_usbctrl usbctrl;
> +int ret = -1;
> +
> +libxl_device_usbctrl_init();
> +
> +if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_USB) {
> +virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
> +   _("'%s' controller cannot be hot plugged."),
> +   type);
> +goto cleanup;
> +}
> +
> +if (controller->idx == -1)
> +controller->idx = virDomainControllerFindUnusedIndex(vm->def,
> + 
> controller->type);
> +
> +if (controller->opts.usbopts.ports == -1)
> +controller->opts.usbopts.ports = 8;
> +
> +if (virDomainControllerFind(vm->def, controller->type, controller->idx) 
> >= 0) {
> +virReportError(VIR_ERR_OPERATION_FAILED,
> +   _("target %s:%d already exists"),
> +   type, controller->idx);
> +goto cleanup;
> +}
> +
> +if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers + 1) < 0)
> +goto cleanup;
> +
> +if (libxlMakeUSBController(controller, ) < 0)
> +goto cleanup;
> +
> +if (libxl_device_usbctrl_add(cfg->ctx, vm->def->id, , 0) < 0) {
> +virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +   _("libxenlight failed to attach USB controller"));
> +goto cleanup;
> +}
> +
> +virDomainControllerInsertPreAlloced(vm->def, controller);
> +ret = 0;
> +
> + cleanup:
> +virObjectUnref(cfg);
> +libxl_device_usbctrl_dispose();
> +return ret;
> +}
> +
> +static int
>  libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver,
> virDomainObjPtr vm,
> virDomainHostdevDefPtr hostdev)
> @@ -3240,6 +3294,12 @@ libxlDomainAttachDeviceLive(libxlDriverPrivatePtr 
> driver,
>  dev->data.disk = NULL;
>  break;
>  
> +case VIR_DOMAIN_DEVICE_CONTROLLER:
> +ret = libxlDomainAttachControllerDevice(driver, vm, 
> dev->data.controller);
> +if (!ret)
> +dev->data.controller = NULL;
> +break;
> +

^^^

>  case VIR_DOMAIN_DEVICE_NET:
>  ret = libxlDomainAttachNetDevice(driver, 

Re: [libvirt] [PATCH 0/5] admin: Fix updating of the client limits

2016-08-02 Thread Erik Skultety
On 30/07/16 15:44, John Ferlan wrote:
> 
> 
> On 07/20/2016 06:53 AM, Erik Skultety wrote:
>> This series slightly refactors the code in virnetserver.c in order to resolve
>> https://bugzilla.redhat.com/show_bug.cgi?id=1357776. The problem resides in
>> updating of the client limits which even though updated, thus "permitting" 
>> new
>> connections to be established, do not re-enable polling for the socket file
>> descriptor which results in all new connections still queueing on the socket.
>>
>> Erik Skultety (5):
>>   rpc: virnetserver: Rename ClientSetProcessingControls to
>> ClientSetLimits
>>   rpc: virnetserver: Move virNetServerCheckLimits which is static up in
>> the file
>>   rpc: virnetserver: Add code to CheckLimits to handle suspending of
>> services
>>   admin: rpc: virnetserver: Fix updating of the client limits
>>   rpc: virnetserver: Remove dead code checking the client limits
>>
>>  daemon/admin_server.c  |  4 +--
>>  src/rpc/virnetserver.c | 97 
>> +++---
>>  src/rpc/virnetserver.h |  6 ++--
>>  3 files changed, 50 insertions(+), 57 deletions(-)
>>
> 
> ACK series, but consider my note in 5/5
> 

Adjusted and pushed, thanks.

Erik

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


Re: [libvirt] [PATCH v2 0/3] libxl hooks

2016-08-02 Thread John Ferlan


On 07/28/2016 05:57 AM, Cédric Bosdonnat wrote:
> Hey there!
> 
> Diffs to v1:
>   * move the ret = 0 to the proper patch
>   * fix typos as pointed by Joao
>   * use ignore_value where needed
> 
> Cédric Bosdonnat (3):
>   libxl: add a flag to mark guests as tainted by a hook
>   libxl: fix segfault in libxlReconnectDomain
>   libxl: add hooks support
> 
>  docs/hooks.html.in  | 53 ++--
>  src/libxl/libxl_domain.c| 84 
> +
>  src/libxl/libxl_domain.h|  2 ++
>  src/libxl/libxl_driver.c| 52 +---
>  src/libxl/libxl_migration.c | 57 ++
>  src/util/virhook.c  | 16 -
>  src/util/virhook.h  | 13 +++
>  7 files changed, 262 insertions(+), 15 deletions(-)
> 

These patches were pushed, but are causing build failures (at least for
me). I made sure to reset/clean my environment, but still many failures:

libxl/libxl_domain.c: In function 'libxlDomainCleanup':
libxl/libxl_domain.c:1361:0: error: unterminated argument list invoking
macro "ignore_value"
 }

libxl/libxl_domain.c:808:9: error: 'ignore_value' undeclared (first use
in this function)
 ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name,
 ^~~~
libxl/libxl_domain.c:808:9: note: each undeclared identifier is reported
only once for each function it appears in
libxl/libxl_domain.c:808:9: error: expected ';' at end of input
libxl/libxl_domain.c:808:9: error: expected declaration or statement at
end of input
libxl/libxl_domain.c:805:15: error: unused variable 'xml'
[-Werror=unused-variable]
 char *xml = virDomainDefFormat(vm->def, cfg->caps, 0);
   ^~~
libxl/libxl_domain.c:808:9: error: expected declaration or statement at
end of input
 ignore_value(virHookCall(VIR_HOOK_DRIVER_LIBXL, vm->def->name,
 ^~~~
cc1: all warnings being treated as errors
Makefile:8671: recipe for target
'libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo' failed
make[5]: *** [libxl/libvirt_driver_libxl_impl_la-libxl_domain.lo] Error 1
make[5]: *** Waiting for unfinished jobs
libxl/libxl_driver.c: In function 'libxlDomainAttachDeviceLive':
libxl/libxl_driver.c:3409:19: error: implicit declaration of function
'libxlDomainAttachControllerDevice' [-Werror=implicit-function-declaration]
 ret = libxlDomainAttachControllerDevice(driver, vm,
dev->data.controller);
   ^
libxl/libxl_driver.c:3409:13: error: nested extern declaration of
'libxlDomainAttachControllerDevice' [-Werror=nested-externs]
 ret = libxlDomainAttachControllerDevice(driver, vm,
dev->data.controller);
 ^~~
libxl/libxl_driver.c: In function 'libxlDomainDetachDeviceLive':
libxl/libxl_driver.c:3830:19: error: implicit declaration of function
'libxlDomainDetachControllerDevice' [-Werror=implicit-function-declaration]
 ret = libxlDomainDetachControllerDevice(driver, vm, dev);
   ^
libxl/libxl_driver.c:3830:13: error: nested extern declaration of
'libxlDomainDetachControllerDevice' [-Werror=nested-externs]
 ret = libxlDomainDetachControllerDevice(driver, vm, dev);
 ^~~
cc1: all warnings being treated as errors
Makefile:8678: recipe for target
'libxl/libvirt_driver_libxl_impl_la-libxl_driver.lo' failed

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

Re: [libvirt] [PATCH V2 7/7] qemuDomainDeviceDefPostParse: add USB controller model check

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> To sync with virDomainControllerModelUSB, we add two models
> in qemuControllerModelUSB 'qusb1' and 'qusb2', but those
> models are not supported in qemu driver. So add check in
> device post parse to report errors if 'qusb1' and 'qusb2'
> are specified.
> 
> Signed-off-by: Chunyan Liu 
> ---
>  src/qemu/qemu_domain.c | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index d1f8175..ed72393 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -2301,6 +2301,19 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
>  ARCH_IS_S390(def->os.arch))
>  dev->data.controller->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE;
>  
> +/* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */
> +if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
> +dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
> +(dev->data.controller->model == 
> VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1 ||
> + dev->data.controller->model == 
> VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2)) {
> +virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +   _("USB controller model type 'qusb1' or 'qusb2' "
> + "is not supported in %s"),
> +   virDomainVirtTypeToString(def->virtType));
> +goto cleanup;
> +}
> +
> +
>  /* set the default SCSI controller model for S390 arches */
>  if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
>  dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&

ACK and pushed

--
Cedric

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


Re: [libvirt] [PATCH V2 1/7] extend usb controller model to support xen pvusb

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> According to libxl implementation, it supports pvusb
> controller of version 1.1 and version 2.0, and it
> supports two types of backend, 'pvusb' (dom0 backend)
> and 'qusb' (qemu backend). But currently pvusb backend
> is not checked in yet.
> 
> To match libxl support, extend usb controller schema
> to support two more models: qusb1 (qusb, version 1.1)
> and 'qusb2' (qusb version 2.0).
> 
> Signed-off-by: Chunyan Liu 
> ---
> Changes:
>   drop pvusb1 and pvusb2 definition
> 
>  docs/formatdomain.html.in | 4 +++-
>  docs/schemas/domaincommon.rng | 2 ++
>  src/conf/domain_conf.c| 2 ++
>  src/conf/domain_conf.h| 2 ++
>  src/qemu/qemu_command.c   | 2 ++
>  5 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 82b6aae..b778705 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -3075,7 +3075,9 @@
>  A usb controller has an optional attribute
>  model, which is one of "piix3-uhci", "piix4-uhci",
>  "ehci", "ich9-ehci1", "ich9-uhci1", "ich9-uhci2", "ich9-uhci3",
> -"vt82c686b-uhci", "pci-ohci" or "nec-xhci".  Additionally,
> +"vt82c686b-uhci", "pci-ohci", "nec-xhci", "qusb1" (xen pvusb
> +with qemu backend, version 1.1) or "qusb2" (xen pvusb with qemu
> +backend, version 2.0). Additionally,
>   since 0.10.0, if the USB bus needs to
>   be explicitly disabled for the guest, model='none'
>   may be used.  Since 1.0.5, no default
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 2e07505..311c1bf 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -1780,6 +1780,8 @@
>pci-ohci
>nec-xhci
>none
> +  qusb1
> +  qusb2
>  
>
>  
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 9504e5f..5fb18cc 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -356,6 +356,8 @@ VIR_ENUM_IMPL(virDomainControllerModelUSB, 
> VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
>"vt82c686b-uhci",
>"pci-ohci",
>"nec-xhci",
> +  "qusb1",
> +  "qusb2",
>"none")
>  
>  VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 15f9c80..4c9e1e3 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -685,6 +685,8 @@ typedef enum {
>  VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI,
>  VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI,
>  VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI,
> +VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1,
> +VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2,
>  VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE,
>  
>  VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 48be399..1998384 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -133,6 +133,8 @@ VIR_ENUM_IMPL(qemuControllerModelUSB, 
> VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST,
>"vt82c686b-usb-uhci",
>"pci-ohci",
>"nec-usb-xhci",
> +  "qusb1",
> +  "qusb2",
>"none");
>  
>  VIR_ENUM_DECL(qemuDomainFSDriver)

Got a build failure in virDomainUSBAddressControllerModelToPorts. This function 
will
need to handle the new values. Other than that, ACK.

I'll push the patch with this more hunk:

--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1393,6 +1393,12 @@ 
virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont)
 return cont->opts.usbopts.ports;
 return 4;
 
+case VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1:
+case VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2:
+if (cont->opts.usbopts.ports != -1)
+return cont->opts.usbopts.ports;
+return 8;
+
 case VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE:
 case VIR_DOMAIN_CONTROLLER_MODEL_USB_LAST:
 break;

--
Cedric

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


Re: [libvirt] [PATCH V2 5/7] xenconfig: add conversion of usb controller config to and from xml

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:

Missing a commit description, even a short one to say we're adding
USB controller conversion to and from libxl's config files.

> Signed-off-by: Chunyan Liu 
> ---
> Changes:
>   drop pvusb1 and pvusb2 models
> 
>  src/xenconfig/xen_xl.c | 190 
> +
>  1 file changed, 190 insertions(+)
> 
> diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c
> index 5879c66..90213ec 100644
> --- a/src/xenconfig/xen_xl.c
> +++ b/src/xenconfig/xen_xl.c
> @@ -503,6 +503,110 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr 
> def)
>  }
>  
>  static int
> +xenParseXLUSBController(virConfPtr conf, virDomainDefPtr def)
> +{
> +virConfValuePtr list = virConfGetValue(conf, "usbctrl");
> +virDomainControllerDefPtr controller = NULL;
> +
> +if (list && list->type == VIR_CONF_LIST) {
> +list = list->list;
> +while (list) {
> +char type[8];
> +char version[4];
> +char ports[4];
> +char *key;
> +int usbctrl_version = 2; /* by default USB 2.0 */
> +int usbctrl_ports = 8; /* by default 8 ports */
> +int usbctrl_type = -1;
> +
> +type[0] = version[0] = ports[0] = '\0';
> +
> +if ((list->type != VIR_CONF_STRING) || (list->str == NULL))
> +goto skipusbctrl;
> +/* usbctrl=['type=pv,version=2,ports=8'] */
> +key = list->str;
> +while (key) {
> +char *data;
> +char *nextkey = strchr(key, ',');
> +
> +if (!(data = strchr(key, '=')))
> +goto skipusbctrl;
> +data++;
> +
> +if (STRPREFIX(key, "type=")) {
> +int len = nextkey ? (nextkey - data) : sizeof(type) - 1;
> +if (virStrncpy(type, data, len, sizeof(type)) == NULL) {
> +virReportError(VIR_ERR_INTERNAL_ERROR,
> +   _("type %s invalid"),
> +   data);
> +goto skipusbctrl;
> +}
> +} else if (STRPREFIX(key, "version=")) {
> +int len = nextkey ? (nextkey - data) : sizeof(version) - 
> 1;
> +if (virStrncpy(version, data, len, sizeof(version)) == 
> NULL) {
> +virReportError(VIR_ERR_INTERNAL_ERROR,
> +   _("version %s invalid"),
> +   data);
> +goto skipusbctrl;
> +}
> +if (virStrToLong_i(version, NULL, 16, _version) 
> < 0)
> +goto skipusbctrl;
> +} else if (STRPREFIX(key, "ports=")) {
> +int len = nextkey ? (nextkey - data) : sizeof(ports) - 1;
> +if (virStrncpy(ports, data, len, sizeof(ports)) == NULL) 
> {
> +virReportError(VIR_ERR_INTERNAL_ERROR,
> +   _("version %s invalid"),
> +   data);
> +goto skipusbctrl;
> +}
> +if (virStrToLong_i(ports, NULL, 16, _ports) < 0)
> +goto skipusbctrl;
> +}
> +
> +while (nextkey && (nextkey[0] == ',' ||
> +   nextkey[0] == ' ' ||
> +   nextkey[0] == '\t'))
> +nextkey++;
> +key = nextkey;
> +}
> +
> +if (type[0] == '\0') {
> +if (usbctrl_version == 1)
> +usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1;
> +else
> +usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2;
> +} else {
> +if (STREQLEN(type, "qusb", 4)) {
> +if (usbctrl_version == 1)
> +usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1;
> +else
> +usbctrl_type = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2;
> +} else {
> +goto skipusbctrl;
> +}
> +}
> +
> +if (!(controller = 
> virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB)))
> +return -1;
> +
> +controller->type = VIR_DOMAIN_CONTROLLER_TYPE_USB;
> +controller->model = usbctrl_type;
> +controller->opts.usbopts.ports = usbctrl_ports;
> +
> +if (VIR_APPEND_ELEMENT(def->controllers, def->ncontrollers, 
> controller) < 0) {
> +virDomainControllerDefFree(controller);
> +return -1;
> +}
> +
> +skipusbctrl:
> +list = list->next;
> +}
> +}

Re: [libvirt] [PATCH V2 6/7] xlconfigtest: add test for usb controller conversion

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> Signed-off-by: Chunyan Liu 
> ---
> Changes:
>   drop pvusb items
> 
>  tests/xlconfigdata/test-usbctrl.cfg | 13 +
>  tests/xlconfigdata/test-usbctrl.xml | 31 +++
>  tests/xlconfigtest.c|  1 +
>  3 files changed, 45 insertions(+)
>  create mode 100644 tests/xlconfigdata/test-usbctrl.cfg
>  create mode 100644 tests/xlconfigdata/test-usbctrl.xml
> 
> diff --git a/tests/xlconfigdata/test-usbctrl.cfg 
> b/tests/xlconfigdata/test-usbctrl.cfg
> new file mode 100644
> index 000..91e9460
> --- /dev/null
> +++ b/tests/xlconfigdata/test-usbctrl.cfg
> @@ -0,0 +1,13 @@
> +name = "XenGuest1"
> +uuid = "45b60f51-88a9-47a8-a3b3-5e66d71b2283"
> +maxmem = 512
> +memory = 512
> +vcpus = 1
> +localtime = 0
> +on_poweroff = "preserve"
> +on_reboot = "restart"
> +on_crash = "preserve"
> +vif = [ "mac=5a:36:0e:be:00:09" ]
> +bootloader = "/usr/bin/pygrub"
> +disk = [ 
> "format=qcow2,vdev=xvda,access=rw,backendtype=qdisk,target=/var/lib/xen/images/debian/disk.qcow2"
>  ]
> +usbctrl = [ "type=qusb,version=2,ports=6" ]
> diff --git a/tests/xlconfigdata/test-usbctrl.xml 
> b/tests/xlconfigdata/test-usbctrl.xml
> new file mode 100644
> index 000..3c03f37
> --- /dev/null
> +++ b/tests/xlconfigdata/test-usbctrl.xml
> @@ -0,0 +1,31 @@
> +
> +  XenGuest1
> +  45b60f51-88a9-47a8-a3b3-5e66d71b2283
> +  524288
> +  524288
> +  1
> +  /usr/bin/pygrub
> +  
> +linux
> +  
> +  
> +  preserve
> +  restart
> +  preserve
> +  
> +
> +  
> +  
> +  
> +
> +
> +
> +  
> +
> +
> +  
> +
> +
> +
> +  
> +
> diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
> index 4248da1..401e560 100644
> --- a/tests/xlconfigtest.c
> +++ b/tests/xlconfigtest.c
> @@ -278,6 +278,7 @@ mymain(void)
>  #endif
>  DO_TEST("vif-typename");
>  DO_TEST("usb");
> +DO_TEST("usbctrl");
>  
>  virObjectUnref(caps);
>  virObjectUnref(xmlopt);

ACK, but merged with the previous patch introducing the feature.

--
Cedric

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


Re: [libvirt] [PATCH V2 4/7] libxl: check available controller and port when hotplugging USB device

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> When hotplug a USB device, check if there is available controller

typos:
When hotplugging a USB device, check if there is an available controller

> and port, if not, automatically create a USB controller of version
> 2.0 and 8 ports.
> 
> Signed-off-by: Chunyan Liu 
> ---
>  src/libxl/libxl_driver.c | 32 
>  1 file changed, 32 insertions(+)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index f614769..d9d7e3c 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -3068,6 +3068,8 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr 
> driver,
>  libxl_device_usbdev usbdev;
>  virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
>  int ret = -1;
> +size_t i;
> +int ports = 0, usbdevs = 0;
>  
>  libxl_device_usbdev_init();
>  
> @@ -3075,6 +3077,36 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr 
> driver,
>  hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
>  goto cleanup;
>  
> +/* search for available controller:port */
> +for (i = 0; i < vm->def->ncontrollers; i++)
> +ports += vm->def->controllers[i]->opts.usbopts.ports;
> +
> +for (i = 0; i < vm->def->nhostdevs; i++) {
> +if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
> +hostdev->source.subsys.type == 
> VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
> +usbdevs++;
> +}
> +
> +if (ports <= usbdevs) {
> +/* no free ports, we will create a new usb controller */
> +virDomainControllerDefPtr controller;
> +
> +if (!(controller = 
> virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB)))
> +goto cleanup;
> +
> +controller->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2;
> +controller->idx = -1;
> +controller->opts.usbopts.ports = 8;
> +
> +if (libxlDomainAttachControllerDevice(driver, vm, controller) < 0) {
> +virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +   _("No available USB controller and port, and "
> + "failed to attach a new USB controller"));

Rewording: "and failed to attach a new one"

> +virDomainControllerDefFree(controller);
> +goto cleanup;
> +}
> +}
> +
>  if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
>  goto cleanup;
>  

ACK and pushed with the wording changes.

--
Cedric

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


Re: [libvirt] [PATCH V2 2/7] libxl: support USB controllers in creation time

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> To support USB Controller in xen guest domains, just add
> USB controller in domain config xml as following:
> 
> 
> Signed-off-by: Chunyan Liu 
> ---
> Changes:
>   drop pvusb1 and pvusb2 models
> 
>  src/libxl/libxl_conf.c | 84 
> ++
>  src/libxl/libxl_conf.h |  4 +++
>  2 files changed, 88 insertions(+)
> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 5989819..a7d91d3 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -1516,6 +1516,87 @@ int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg,
>  
>  #ifdef LIBXL_HAVE_PVUSB
>  int
> +libxlMakeUSBController(virDomainControllerDefPtr controller,
> +   libxl_device_usbctrl *usbctrl)
> +{
> +usbctrl->devid = controller->idx;
> +
> +if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_USB)
> +return -1;
> +
> +if (controller->model == -1) {
> +usbctrl->version = 2;
> +usbctrl->type = LIBXL_USBCTRL_TYPE_QUSB;
> +} else {
> +switch (controller->model) {
> +case VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1:
> +usbctrl->version = 1;
> +usbctrl->type = LIBXL_USBCTRL_TYPE_QUSB;
> +break;
> +
> +case VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2:
> +usbctrl->version = 2;
> +usbctrl->type = LIBXL_USBCTRL_TYPE_QUSB;
> +break;
> +
> +default:
> +virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +   _("unsupported usb model"));
> +return -1;
> +}
> +}
> +
> +if (controller->opts.usbopts.ports == -1)
> +usbctrl->ports = 8;
> +else
> +usbctrl->ports = controller->opts.usbopts.ports;
> +
> +return 0;
> +}
> +
> +static int
> +libxlMakeUSBControllerList(virDomainDefPtr def, libxl_domain_config 
> *d_config)
> +{
> +virDomainControllerDefPtr *l_controllers = def->controllers;
> +size_t ncontrollers = def->ncontrollers;
> +size_t nusbctrls = 0;
> +libxl_device_usbctrl *x_usbctrls;
> +size_t i;
> +
> +if (ncontrollers == 0)
> +return 0;
> +
> +if (VIR_ALLOC_N(x_usbctrls, ncontrollers) < 0)
> +return -1;
> +
> +for (i = 0; i < ncontrollers; i++) {
> +if (l_controllers[i]->type != VIR_DOMAIN_CONTROLLER_TYPE_USB)
> +continue;
> +
> +libxl_device_usbctrl_init(_usbctrls[nusbctrls]);
> +
> +if (libxlMakeUSBController(l_controllers[i],
> +   _usbctrls[nusbctrls]) < 0)
> +goto error;
> +
> +nusbctrls++;
> +}
> +
> +VIR_SHRINK_N(x_usbctrls, ncontrollers, ncontrollers - nusbctrls);
> +d_config->usbctrls = x_usbctrls;
> +d_config->num_usbctrls = nusbctrls;
> +
> +return 0;
> +
> + error:
> +for (i = 0; i < nusbctrls; i++)
> +libxl_device_usbctrl_dispose(_usbctrls[i]);
> +
> +VIR_FREE(x_usbctrls);
> +return -1;
> +}
> +
> +int
>  libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev)
>  {
>  virDomainHostdevSubsysUSBPtr usbsrc = >source.subsys.u.usb;
> @@ -1787,6 +1868,9 @@ libxlBuildDomainConfig(virPortAllocatorPtr 
> graphicsports,
>  return -1;
>  
>  #ifdef LIBXL_HAVE_PVUSB
> +if (libxlMakeUSBControllerList(def, d_config) < 0)
> +return -1;
> +
>  if (libxlMakeUSBList(def, d_config) < 0)
>  return -1;
>  #endif
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 8cb2b14..ed5a3de 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -186,6 +186,10 @@ libxlMakePCI(virDomainHostdevDefPtr hostdev, 
> libxl_device_pci *pcidev);
>  
>  # ifdef LIBXL_HAVE_PVUSB
>  int
> +libxlMakeUSBController(virDomainControllerDefPtr controller,
> +   libxl_device_usbctrl *usbctrl);
> +
> +int
>  libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev);
>  # endif
>  

ACK and pushed

--
Cedric

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


Re: [libvirt] [PATCH V2 3/7] libxl: support usb controller hotplug

2016-08-02 Thread Cedric Bosdonnat
On Wed, 2016-06-15 at 14:00 +0800, Chunyan Liu wrote:
> Support USB controller hot-plug and hot-unplug.
> 
>  #virsh attach-device dom usbctrl.xml
>  #virsh detach-device dom usbctrl.xml
>  usbctrl.xml example:
>  
> 
> Signed-off-by: Chunyan Liu 
> ---
>  src/libxl/libxl_driver.c | 144 
> +++
>  1 file changed, 144 insertions(+)
> 
> diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
> index f507265..f614769 100644
> --- a/src/libxl/libxl_driver.c
> +++ b/src/libxl/libxl_driver.c
> @@ -3006,6 +3006,60 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr 
> driver,
>  
>  #ifdef LIBXL_HAVE_PVUSB
>  static int
> +libxlDomainAttachControllerDevice(libxlDriverPrivatePtr driver,
> +  virDomainObjPtr vm,
> +  virDomainControllerDefPtr controller)
> +{
> +libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
> +const char *type = virDomainControllerTypeToString(controller->type);
> +libxl_device_usbctrl usbctrl;
> +int ret = -1;
> +
> +libxl_device_usbctrl_init();
> +
> +if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_USB) {
> +virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
> +   _("'%s' controller cannot be hot plugged."),
> +   type);
> +goto cleanup;
> +}
> +
> +if (controller->idx == -1)
> +controller->idx = virDomainControllerFindUnusedIndex(vm->def,
> + 
> controller->type);
> +
> +if (controller->opts.usbopts.ports == -1)
> +controller->opts.usbopts.ports = 8;
> +
> +if (virDomainControllerFind(vm->def, controller->type, controller->idx) 
> >= 0) {
> +virReportError(VIR_ERR_OPERATION_FAILED,
> +   _("target %s:%d already exists"),
> +   type, controller->idx);
> +goto cleanup;
> +}
> +
> +if (VIR_REALLOC_N(vm->def->controllers, vm->def->ncontrollers + 1) < 0)
> +goto cleanup;
> +
> +if (libxlMakeUSBController(controller, ) < 0)
> +goto cleanup;
> +
> +if (libxl_device_usbctrl_add(cfg->ctx, vm->def->id, , 0) < 0) {
> +virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> +   _("libxenlight failed to attach USB controller"));
> +goto cleanup;
> +}
> +
> +virDomainControllerInsertPreAlloced(vm->def, controller);
> +ret = 0;
> +
> + cleanup:
> +virObjectUnref(cfg);
> +libxl_device_usbctrl_dispose();
> +return ret;
> +}
> +
> +static int
>  libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver,
> virDomainObjPtr vm,
> virDomainHostdevDefPtr hostdev)
> @@ -3240,6 +3294,12 @@ libxlDomainAttachDeviceLive(libxlDriverPrivatePtr 
> driver,
>  dev->data.disk = NULL;
>  break;
>  
> +case VIR_DOMAIN_DEVICE_CONTROLLER:
> +ret = libxlDomainAttachControllerDevice(driver, vm, 
> dev->data.controller);
> +if (!ret)
> +dev->data.controller = NULL;
> +break;
> +
>  case VIR_DOMAIN_DEVICE_NET:
>  ret = libxlDomainAttachNetDevice(driver, vm,
>   dev->data.net);
> @@ -3270,6 +3330,7 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, 
> virDomainDeviceDefPtr dev)
>  virDomainDiskDefPtr disk;
>  virDomainNetDefPtr net;
>  virDomainHostdevDefPtr hostdev;
> +virDomainControllerDefPtr controller;
>  virDomainHostdevDefPtr found;
>  char mac[VIR_MAC_STRING_BUFLEN];
>  
> @@ -3287,6 +3348,21 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, 
> virDomainDeviceDefPtr dev)
>  dev->data.disk = NULL;
>  break;
>  
> +case VIR_DOMAIN_DEVICE_CONTROLLER:
> +controller = dev->data.controller;
> +if (controller->idx != -1 &&
> +virDomainControllerFind(vmdef, controller->type,
> +controller->idx) >= 0) {
> +virReportError(VIR_ERR_OPERATION_INVALID, "%s",
> +   _("Target already exists"));
> +return -1;
> +}
> +
> +if (virDomainControllerInsert(vmdef, controller) < 0)
> +return -1;
> +dev->data.controller = NULL;
> +break;
> +
>  case VIR_DOMAIN_DEVICE_NET:
>  net = dev->data.net;
>  if (virDomainHasNet(vmdef, net)) {
> @@ -3425,6 +3501,57 @@ libxlDomainDetachHostPCIDevice(libxlDriverPrivatePtr 
> driver,
>  
>  #ifdef LIBXL_HAVE_PVUSB
>  static int
> +libxlDomainDetachControllerDevice(libxlDriverPrivatePtr driver,
> +  virDomainObjPtr vm,
> +  virDomainDeviceDefPtr dev)
> +{
> +int idx, ret = -1;
> +

Re: [libvirt] [PATCH] qemu: only report errno in trace message on failure

2016-08-02 Thread Michal Privoznik
On 02.08.2016 12:48, Daniel P. Berrange wrote:
> Avoid reporting a stale errno value when the syscall succeeds,
> instead always pass 0.
> 
> Signed-off-by: Daniel P. Berrange 
> ---
>  src/qemu/qemu_monitor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
> index 58c04d5..6c9695e 100644
> --- a/src/qemu/qemu_monitor.c
> +++ b/src/qemu/qemu_monitor.c
> @@ -528,12 +528,12 @@ qemuMonitorIOWrite(qemuMonitorPtr mon)
>  
>  PROBE(QEMU_MONITOR_IO_WRITE,
>"mon=%p buf=%s len=%zu ret=%d errno=%d",
> -  mon, buf, len, done, errno);
> +  mon, buf, len, done, done < 0 ? errno : 0);
>  
>  if (mon->msg->txFD != -1) {
>  PROBE(QEMU_MONITOR_IO_SEND_FD,
>"mon=%p fd=%d ret=%d errno=%d",
> -  mon, mon->msg->txFD, done, errno);
> +  mon, mon->msg->txFD, done, done < 0 ? errno : 0);
>  }
>  
>  if (done < 0) {
> 

ACK

Michal

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


[libvirt] [PATCH] Post-release version bump to 2.2.0

2016-08-02 Thread Michal Privoznik
Signed-off-by: Michal Privoznik 
---

Pushed under trivial rule.

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

diff --git a/configure.ac b/configure.ac
index 2c81c95..8d7d63e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General 
Public
 dnl License along with this library.  If not, see
 dnl .
 
-AC_INIT([libvirt], [2.1.0], [libvir-list@redhat.com], [], [http://libvirt.org])
+AC_INIT([libvirt], [2.2.0], [libvir-list@redhat.com], [], [http://libvirt.org])
 AC_CONFIG_SRCDIR([src/libvirt.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
-- 
2.8.4

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


[libvirt] [PATCH] qemu: only report errno in trace message on failure

2016-08-02 Thread Daniel P. Berrange
Avoid reporting a stale errno value when the syscall succeeds,
instead always pass 0.

Signed-off-by: Daniel P. Berrange 
---
 src/qemu/qemu_monitor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 58c04d5..6c9695e 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -528,12 +528,12 @@ qemuMonitorIOWrite(qemuMonitorPtr mon)
 
 PROBE(QEMU_MONITOR_IO_WRITE,
   "mon=%p buf=%s len=%zu ret=%d errno=%d",
-  mon, buf, len, done, errno);
+  mon, buf, len, done, done < 0 ? errno : 0);
 
 if (mon->msg->txFD != -1) {
 PROBE(QEMU_MONITOR_IO_SEND_FD,
   "mon=%p fd=%d ret=%d errno=%d",
-  mon, mon->msg->txFD, done, errno);
+  mon, mon->msg->txFD, done, done < 0 ? errno : 0);
 }
 
 if (done < 0) {
-- 
2.7.4

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


Re: [libvirt] [PATCH 2/5] Introduce SMM feature

2016-08-02 Thread Laszlo Ersek
On 08/02/16 10:58, Michal Privoznik wrote:
> On 01.08.2016 21:10, Laszlo Ersek wrote:
>> On 08/01/16 19:05, Gerd Hoffmann wrote:
>>>   Hi,
>>>
 If it does, then the host kernel should be 4.4 or later. (If we want to
 capture version numbers, then for each minor release, the latest patch
 level should be required: 4.4.16, 4.5.7, 4.6.5, 4.7.0, because there
 have been a number of KVM tweaks and stable backports for SMM support.)
>>>
>>> Better check /dev/kvm for the KVM_CAP_X86_SMM capability, otherwise the
>>> rhel-7 kernel is out even though smm is backported.
>>>
>>> Probably libvirt already has checks for other caps so it should be easy.
>>
>> The problem is that KVM_CAP_X86_SMM does not guarantee that all the
>> tricky bugfixes are present in the host kernel.
>>
>>
> 
> Moreover, libvirt does not validate nor check guest kernel. And the only
> /dev/kvm/ caps we check are:
> 
> KVM_CAP_IOMMU - to see if legacy PCI passthrough works
> 
> KVM_CAP_PPC_SMT -
> KVM_CAP_MAX_VCPUS -
> KVM_CAP_NR_VCPUS  - for some vCPUs counts
> 
> I don't think libvirt should check for KVM_CAP_x86_SMM. I mean, if we go
> down the rabbit hole, libvirt would have to check everything. The buck
> has to stop somewhere.

I agree.

Thanks
Laszlo

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


Re: [libvirt] [PATCH 2/5] Introduce SMM feature

2016-08-02 Thread Michal Privoznik
On 01.08.2016 21:10, Laszlo Ersek wrote:
> On 08/01/16 19:05, Gerd Hoffmann wrote:
>>   Hi,
>>
>>> If it does, then the host kernel should be 4.4 or later. (If we want to
>>> capture version numbers, then for each minor release, the latest patch
>>> level should be required: 4.4.16, 4.5.7, 4.6.5, 4.7.0, because there
>>> have been a number of KVM tweaks and stable backports for SMM support.)
>>
>> Better check /dev/kvm for the KVM_CAP_X86_SMM capability, otherwise the
>> rhel-7 kernel is out even though smm is backported.
>>
>> Probably libvirt already has checks for other caps so it should be easy.
> 
> The problem is that KVM_CAP_X86_SMM does not guarantee that all the
> tricky bugfixes are present in the host kernel.
> 
>

Moreover, libvirt does not validate nor check guest kernel. And the only
/dev/kvm/ caps we check are:

KVM_CAP_IOMMU - to see if legacy PCI passthrough works

KVM_CAP_PPC_SMT -
KVM_CAP_MAX_VCPUS -
KVM_CAP_NR_VCPUS  - for some vCPUs counts

I don't think libvirt should check for KVM_CAP_x86_SMM. I mean, if we go
down the rabbit hole, libvirt would have to check everything. The buck
has to stop somewhere.

Michal

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


[libvirt] Release of libvirt-2.1.0

2016-08-02 Thread Daniel Veillard
   Sorry I didn't push an rc2 on Friday, finishing my move, but not seeing any
issue raised by rc1, I though it was better to push the final release now and 
free
up the tree for pending development. As a result 2.1.0 is tagged in git and I
pushed signed tarbal and rpms to the usual place:

ftp://libvirt.org/libvirt/


  I didn't gave as much eyeballing to this release as usual, but this is still
a fairly big one with more than 300 commits. It is heavilly pushed toward
improvements of the code base, some major changes and fixes in the vz driver
and less bug fixes than the usual ratio:


Documentation:
- docs: Add Kimchi as Web Application (Ramon Medeiros)
- docs: Update docs to reflect LUKS secret changes (John Ferlan)
- docs: remove outdated suggestion to make patches with "diff -urp"/"git diff" 
(Laine Stump)

Portability:
- Fix RPM spec for wireshark on Fedora < 24 (Daniel P. Berrange)
- libvirt.spec.in: Adapt to newest wireshark plugindir (Michal Privoznik)
- virt-wireshark: Properly substract wireshark prefix (Michal Privoznik)
- virConfGetValueSSizeT: Fix build on 32 bits (Michal Privoznik)
- tests: command: Fix build on ppc64/aarch64 (Andrea Bolognani)
- libvirt.spec.in: require systemd-container on >= f24 (Daniel P. Berrange)
- build: drop hack for old mingw ssize_t (Eric Blake)
- build: virrandommock.c not needed on mingw (Eric Blake)
- maint: update to latest gnulib (Martin Kletzander)
- mingw-libvirt.spec.in: add perl + perl(Getopt::Long) BRs (Daniel P. Berrange)
- mingw-libvirt.spec.in: fix packaging of admin API and other bugs (Daniel P. 
Berrange)

Bug Fixes:
- storage: Document wiping formatted volume types (Martin Kletzander)
- qemu: remove panic dev models s390 and pseries when migrating (Boris 
Fiuczynski)
- schema: fix resolved interfaces of network type (Nikolay Shirokovskiy)
- qemu: fix domain id after domainCreateWithFlags() (Sascha Silbe)
- tests: qemu: Don't leak security manager object (Peter Krempa)
- qemu: Need to free fileprops in error path (John Ferlan)
- iscsi: Establish connection to target via static target login (John Ferlan)
- tools: Make use of the correct environment variables (Erik Skultety)
- qemu: Adjust the cur_ballon on coldplug/unplug of dimms (Shivaprasad G Bhat)
- virconf: Fix config file path construction (Erik Skultety)
- util: qemu: Don't generate any extra commas in virQEMUBuildCommandLineJSON 
(Peter Krempa)
- tests: qemuxml2xml: Avoid crash when processing an XML that fails to parse 
(Peter Krempa)
- conf: events: handle NULL uuid (Jovanka Gulicoska)
- lxc: Don't crash by forgetting to ref transient domains (Martin Kletzander)
- vz: handle gracefully races on undefining domain (Nikolay Shirokovskiy)
- qemu: Disallow usage of luks encryption if aes secret not possible (John 
Ferlan)
- storage: Fix error path (John Ferlan)
- lxc: errors after the handshake won't be reported (Cédric Bosdonnat)
- vsh: Properly initialize res (John Ferlan)
- conf: Need to check for glisten before accessing (John Ferlan)
- tests: Need to check return of virGetLastError (John Ferlan)
- tools: Fix comparison in virLoginShellGetShellArgv (John Ferlan)
- util: Fix incorrect VIR_FREE in virConfGetValueStringList (John Ferlan)
- fs: Fix '<' comparison of value produced by logical not '!' (Erik Skultety)
- security: compilation error due to wrong parameter for vah_add_path(). (Julio 
Faracco)
- vz: don't fail unregister on sending event error (Nikolay Shirokovskiy)
- vz: dont remove domain from list on client object error (Nikolay Shirokovskiy)
- vz: restore accidentally removed locks around close callback calls (Nikolay 
Shirokovskiy)
- vz: fixed null-pointer dereference in applying graphic params (Olga Krishtal)
- vz: fix destination domain synchronization (Nikolay Shirokovskiy)
- vz: fix memory leaks in prlsdkLoadDomains (Nikolay Shirokovskiy)
- vz: fix missed defined domain event (Nikolay Shirokovskiy)
- vz: don't pass empty and unused fields in migration cookie (Nikolay 
Shirokovskiy)
- qemu: Fix migration from old libvirt (Jiri Denemark)
- qemu: Drop default channel path during migration (Jiri Denemark)
- qemu: Copy complete domain def in qemuDomainDefFormatBuf (Jiri Denemark)
- conf: Make really sure we don't access non-existing vCPUs again (Martin 
Kletzander)
- conf: Make really sure we don't access non-existing vCPUs (Martin Kletzander)
- qemu: getAutoDumpPath() return value should be dumpfile not domname. (Yan Fu)
- systemd: fix ready notification on abstract socket (Jim Fehlig)
- virCommandExec: Report error if execve fails (Michal Privoznik)
- storage: dir: adapts .wipeVol for ploop volumes (Olga Krishtal)
- virconf: fix off-by-1 when appending \n to config file (Daniel P. Berrange)
- qemuxml2argvmock: Don't leak @netdef->ifname (Michal Privoznik)
- qemuxml2argvtest: Don't leak dummy monitor (Michal Privoznik)
- qemuDomainObjPrivateFree: Free @masterKey too (Michal Privoznik)
- qemuBuildCpuCommandLine: Don't leak @buf (Michal Privoznik)
- 

[libvirt] [PATCH] tests: Make schema test fail on XML schema errors

2016-08-02 Thread Peter Krempa
Failure to parse the schema file would not trigger a test suite failure.

In addition to making the test fail it's necessary to split up the
parsing of the schema file into a separate test.

This is necessary as the XML validator uses libvirt errors to report
problems parsing of the actual schema RNG needs to be split out into a
separate function and called via virTestRun which has the
infrastructure to report them.
---
 tests/virschematest.c | 64 ---
 1 file changed, 46 insertions(+), 18 deletions(-)

diff --git a/tests/virschematest.c b/tests/virschematest.c
index a1901e7..dbd9f3b 100644
--- a/tests/virschematest.c
+++ b/tests/virschematest.c
@@ -114,24 +114,17 @@ testSchemaDir(const char *schema,


 static int
-testSchemaDirs(const char *schema, ...)
+testSchemaDirs(const char *schema, virXMLValidatorPtr validator, ...)
 {
-virXMLValidatorPtr validator = NULL;
 va_list args;
 int ret = 0;
-char *schema_path = NULL;
 char *dir_path = NULL;
 const char *dir;

-va_start(args, schema);
-
-if (virAsprintf(_path, "%s/docs/schemas/%s", abs_topsrcdir, schema) 
< 0)
-goto cleanup;
-
-if (!(validator = virXMLValidatorInit(schema_path)))
-goto cleanup;
+va_start(args, validator);

 while ((dir = va_arg(args, char *))) {
+printf("\nDERP: %s\n", dir);
 if (virAsprintf(_path, "%s/%s", abs_srcdir, dir) < 0) {
 ret = -1;
 goto cleanup;
@@ -142,24 +135,59 @@ testSchemaDirs(const char *schema, ...)
 }

  cleanup:
-virXMLValidatorFree(validator);
-VIR_FREE(schema_path);
 VIR_FREE(dir_path);
 va_end(args);
 return ret;
 }


+struct testSchemaFileData {
+virXMLValidatorPtr validator;
+const char *schema;
+};
+
+static int
+testSchemaGrammar(const void *opaque)
+{
+struct testSchemaFileData *data = (struct testSchemaFileData *) opaque;
+char *schema_path;
+int ret = -1;
+
+if (virAsprintf(_path, "%s/docs/schemas/%s",
+abs_topsrcdir, data->schema) < 0)
+return -1;
+
+if (!(data->validator = virXMLValidatorInit(schema_path)))
+goto cleanup;
+
+ret = 0;
+
+ cleanup:
+VIR_FREE(schema_path);
+return ret;
+}
+
+
 static int
 mymain(void)
 {
 int ret = 0;
-
-#define DO_TEST(schema, ...) \
-do { \
-if (testSchemaDirs(schema, __VA_ARGS__, NULL) < 0)   \
-ret = -1;\
-} while (0)  \
+struct testSchemaFileData data;
+
+#define DO_TEST(sch, ...)  
\
+do {   
\
+data.schema = sch; 
\
+if (virTestRun("test schema grammar file: " sch,   
\
+   testSchemaGrammar, ) == 0) {   
\
+if (testSchemaDirs(sch, data.validator, __VA_ARGS__, NULL) < 0)
\
+ret = -1;  
\
+   
\
+virXMLValidatorFree(data.validator);   
\
+data.validator = NULL; 
\
+} else {   
\
+ret = -1;  
\
+}  
\
+} while (0)

 DO_TEST("capability.rng", "capabilityschemadata", "xencapsdata");
 DO_TEST("domain.rng", "domainschemadata", "qemuargv2xmldata",
-- 
2.9.2

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


Re: [libvirt] [PATCH] Fix unbalanced quotation marks in messages

2016-08-02 Thread Ján Tomko

On Tue, Aug 02, 2016 at 10:00:24AM +0300, Yuri Chornoivan wrote:

Hi,

Thanks for reviewing this minor patch that fixes some glitches found while
translating libvirt.

Best regards,
Yuri



From 0b3c80adeaa7f109074b54a154d68567ea1e7cc0 Mon Sep 17 00:00:00 2001

From: Yuri Chornoivan 
Date: Tue, 2 Aug 2016 09:48:37 +0300
Subject: [PATCH] Fix unbalanced quotation marks

---
src/conf/domain_conf.c | 4 ++--
tools/virsh-pool.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)



ACK and pushed

Jan


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

[libvirt] [PATCH] Fix unbalanced quotation marks in messages

2016-08-02 Thread Yuri Chornoivan
Hi,

Thanks for reviewing this minor patch that fixes some glitches found while 
translating libvirt.

Best regards,
Yuri>From 0b3c80adeaa7f109074b54a154d68567ea1e7cc0 Mon Sep 17 00:00:00 2001
From: Yuri Chornoivan 
Date: Tue, 2 Aug 2016 09:48:37 +0300
Subject: [PATCH] Fix unbalanced quotation marks

---
 src/conf/domain_conf.c | 4 ++--
 tools/virsh-pool.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a56e0f5..7f876de 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8265,14 +8265,14 @@ virDomainControllerDefParseXML(xmlNodePtr node,
 
 if (max_sectors && virStrToLong_ui(max_sectors, NULL, 10, >max_sectors) < 0) {
 virReportError(VIR_ERR_XML_ERROR,
-   _("Malformed 'max_sectors' value %s'"), max_sectors);
+   _("Malformed 'max_sectors' value %s"), max_sectors);
 goto error;
 }
 
 if (ioeventfd &&
 (def->ioeventfd = virTristateSwitchTypeFromString(ioeventfd)) < 0) {
 virReportError(VIR_ERR_XML_ERROR,
-   _("Malformed 'ioeventfd' value %s'"), ioeventfd);
+   _("Malformed 'ioeventfd' value %s"), ioeventfd);
 goto error;
 }
 
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index 6045331..4489272 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -1973,7 +1973,7 @@ vshEventGenericPrint(virConnectPtr conn ATTRIBUTE_UNUSED,
 if (virTimeStringNowRaw(timestamp) < 0)
 timestamp[0] = '\0';
 
-vshPrint(data->ctl, _("%s: event '%s'' for storage pool %s\n"),
+vshPrint(data->ctl, _("%s: event '%s' for storage pool %s\n"),
  timestamp,
  data->cb->name,
  virStoragePoolGetName(pool));
-- 
2.7.4

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