Michal Privoznik | 31 Mar 13:59 2015
Picon

[libvirt] [PATCH v2 0/3] A few NUMA fixes

diff to v1:
-reworked to follow Jan's review. Hopefully.

Michal Privoznik (3):
  vircgroup: Introduce virCgroupControllerAvailable
  qemuProcessHook: Call virNuma*() iff needed
  virLXCControllerSetupResourceLimits: Call virNuma*() iff needed

 src/libvirt_private.syms |  1 +
 src/lxc/lxc_controller.c | 22 ++++++++++++++++------
 src/qemu/qemu_process.c  | 21 +++++++++++++++++----
 src/util/vircgroup.c     | 19 +++++++++++++++++++
 src/util/vircgroup.h     |  1 +
 tests/vircgrouptest.c    | 31 +++++++++++++++++++++++++++++++
 6 files changed, 85 insertions(+), 10 deletions(-)

--

-- 
2.0.5

John Ferlan | 31 Mar 01:16 2015
Picon

[libvirt] [PATCH 0/3] storage: handle scsi/iscsi error paths better

Adjust error path logic for processing LU's in order to better ascertain
the correct cause for failure. The first two patches are merely setting
for the third one which determines that the pool definition used a non
existent path in the configuration thus no 'real' targets were able to
be created.

John Ferlan (3):
  iscsi: Check for presence of error before creating new one
  scsi: Adjust return values from processLU
  scsi: Check for invalid target.path after processLU failure

 src/storage/storage_backend_iscsi.c |  5 +++--
 src/storage/storage_backend_scsi.c  | 13 +++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

--

-- 
2.1.0

Peter Krempa | 30 Mar 21:01 2015
Picon

[libvirt] [PATCHv2] qemu: Fix issues with maxMemory in qemuDomainSetMemoryFlags()

From: Luyao Huang <lhuang <at> redhat.com>

qemuDomainSetMemoryFlags() would allow to set the initial memory greater
than the <maxMemory> field. While the configuration would not work as
memory hotplug requires NUMA to be enabled and the
qemuDomainSetMemoryFlags() API does not work on NUMA guests this just
fixes a corner case.

The fix is still worth though as it allows to induce an invalid
configuration and make the VM vanish on libvirt restart.

Additionally this tweaks error message to be more accurate.

Signed-off-by: Luyao Huang <lhuang <at> redhat.com>
Signed-off-by: Peter Krempa <pkrempa <at> redhat.com>
---
Version 2 tweaks the error messages to be (possibly) more descriptive.

 src/qemu/qemu_driver.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6700fc9..d15931c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
 <at>  <at>  -2319,11 +2319,19  <at>  <at>  static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
              * is no way to change the individual node sizes with this API */
             if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) {
                 virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                               _("maximum memory size of a domain with NUMA "
(Continue reading)

Peter Krempa | 30 Mar 20:50 2015
Picon

[libvirt] [PATCH 0/2] qemu: Finish fixing of interlocking domain ops with blockjobs

Peter Krempa (1):
  qemu: snapshot: Check for block jobs individually

Shanzhi Yu (1):
  conf: Rename virDomainHasDiskMirror and detect block jobs properly

 src/conf/domain_conf.c    | 25 ++++++++++++++++++++-----
 src/conf/domain_conf.h    |  3 ++-
 src/libvirt_private.syms  |  2 +-
 src/qemu/qemu_driver.c    | 19 +++++++++++--------
 src/qemu/qemu_migration.c |  2 +-
 5 files changed, 35 insertions(+), 16 deletions(-)

--

-- 
2.2.2

Peter Krempa | 30 Mar 17:41 2015
Picon

[libvirt] [PATCH] qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase

The block copy API takes the speed in bytes/s rather than MiB/s that was
the prior approach in virDomainBlockRebase. We correctly converted the
speed to bytes/s in the old API but we still called the common helper
virDomainBlockCopyCommon with the unadjusted variable.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1207122
---
 src/qemu/qemu_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4d05221..6700fc9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
 <at>  <at>  -16811,7 +16811,7  <at>  <at>  qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,
     flags &= (VIR_DOMAIN_BLOCK_REBASE_SHALLOW |
               VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT);
     ret = qemuDomainBlockCopyCommon(vm, dom->conn, path, dest,
-                                    bandwidth, 0, 0, flags, true);
+                                    speed, 0, 0, flags, true);
     dest = NULL;

  cleanup:
--

-- 
2.2.2

Michal Privoznik | 30 Mar 14:07 2015
Picon

[libvirt] [PATCH] virDomainShutdown*: Describe blocking behaviour

The description to both virDomainShutdown() and
virDomainShutdownFlags() is quite misleading when it comes to
blocking behaviour of these two APIs. Firstly, we support many
shutdown methods, from signalizing an ACPI event, through sending
a signal to guest agent assisted shutdown. Some of these methods
make the API return immediately, while others block the API until
domain is actually shut of. And since virDomainShutdown() is
equivalent to calling virDomainShutdownFlags(0), it's up to each
driver which methods to try. So the bare virDomainShutdown() may
block or may return immediately at the same time. I know, it's
confusing, but at least let users know.

Signed-off-by: Michal Privoznik <mprivozn <at> redhat.com>
---
 src/libvirt-domain.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index f1608dc..03b342f 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
 <at>  <at>  -1474,9 +1474,12  <at>  <at>  virDomainScreenshot(virDomainPtr domain,
  * 'on_poweroff' XML setting resulting in a domain that reboots instead of
  * shutting down. For guests that react to a shutdown request, the differences
  * from virDomainDestroy() are that the guests disk storage will be in a
- * stable state rather than having the (virtual) power cord pulled, and
- * this command returns as soon as the shutdown request is issued rather
- * than blocking until the guest is no longer running.
+ * stable state rather than having the (virtual) power cord pulled. It's up to
+ * hypervisor's driver implementation what methods of
(Continue reading)

Raymond Durand | 30 Mar 13:03 2015
Picon

[libvirt] ceph rbd key

Is there a way that qemu takes the key of ceph rbd from a file rather than reading it from the file cinder.conf?

Going from something like rbd_secret_uuid=UUID key
to something like rbd_secret_uuid=/path/to/key
(to restrict the access rights to the file and avoid the secret_uuid to be readable from anyone with ps kind of command)

Regards,

<div><div dir="ltr">
<div>
<div>
<div>Is there a way that qemu takes the key of ceph rbd from a file rather than reading it from the file cinder.conf?<br><br>Going from something like rbd_secret_uuid=UUID key<br>
</div>to something like rbd_secret_uuid=/path/to/key<br>
</div>
<div>(to restrict the access rights to the file and avoid the secret_uuid to be readable from anyone with ps kind of command)<br>
</div>
<div><br></div>
</div>Regards,<br><div><br></div>
</div></div>
Ján Tomko | 30 Mar 13:02 2015
Picon

[libvirt] [PATCH] Strip control codes in virBufferEscapeString

These cannot be represented in XML.

We have been stripping them, but only if the string had
characters that needed escaping: <>"'&

Extend the strcspn check to include control codes, and strip
them even if we don't do any escaping.

https://bugzilla.redhat.com/show_bug.cgi?id=1184131
https://bugzilla.redhat.com/show_bug.cgi?id=1066564
---
 src/util/virbuffer.c | 14 +++++++++++---
 tests/virbuftest.c   | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 706dbfa..3d13c90 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
 <at>  <at>  -438,6 +438,13  <at>  <at>  virBufferEscapeString(virBufferPtr buf, const char *format, const char *str)
     int len;
     char *escaped, *out;
     const char *cur;
+    const char forbidden_characters[] = {
+        0x01,   0x02,   0x03,   0x04,   0x05,   0x06,   0x07,   0x08,
+        /*\t*/  /*\n*/  0x0B,   0x0C,   /*\r*/  0x0E,   0x0F,   0x10,
+        0x11,   0x12,   0x13,   0x14,   0x15,   0x16,   0x17,   0x18,
+        0x19,   '"',    '&',    '\'',   '<',    '>',
+        '\0'
+    };

     if ((format == NULL) || (buf == NULL) || (str == NULL))
         return;
 <at>  <at>  -446,7 +453,7  <at>  <at>  virBufferEscapeString(virBufferPtr buf, const char *format, const char *str)
         return;

     len = strlen(str);
-    if (strcspn(str, "<>&'\"") == len) {
+    if (strcspn(str, forbidden_characters) == len) {
         virBufferAsprintf(buf, format, str);
         return;
     }
 <at>  <at>  -490,8 +497,7  <at>  <at>  virBufferEscapeString(virBufferPtr buf, const char *format, const char *str)
             *out++ = 'o';
             *out++ = 's';
             *out++ = ';';
-        } else if (((unsigned char)*cur >= 0x20) || (*cur == '\n') || (*cur == '\t') ||
-                   (*cur == '\r')) {
+        } else if (!strchr(forbidden_characters, *cur)) {
             /*
              * default case, just copy !
              * Note that character over 0x80 are likely to give problem
 <at>  <at>  -499,6 +505,8  <at>  <at>  virBufferEscapeString(virBufferPtr buf, const char *format, const char *str)
              * it's hard to handle properly we have to assume it's UTF-8 too
              */
             *out++ = *cur;
+        } else {
+            /* silently ignore control characters */
         }
         cur++;
     }
diff --git a/tests/virbuftest.c b/tests/virbuftest.c
index 21cb18b..10398d5 100644
--- a/tests/virbuftest.c
+++ b/tests/virbuftest.c
 <at>  <at>  -349,6 +349,39  <at>  <at>  testBufAddStr(const void *opaque ATTRIBUTE_UNUSED)

 
 static int
+testBufEscapeStr(const void *opaque ATTRIBUTE_UNUSED)
+{
+    const struct testBufAddStrData *data = opaque;
+    virBuffer buf = VIR_BUFFER_INITIALIZER;
+    char *actual;
+    int ret = -1;
+
+    virBufferAddLit(&buf, "<c>\n");
+    virBufferAdjustIndent(&buf, 2);
+    virBufferEscapeString(&buf, "<el>%s</el>\n", data->data);
+    virBufferAdjustIndent(&buf, -2);
+    virBufferAddLit(&buf, "</c>");
+
+    if (!(actual = virBufferContentAndReset(&buf))) {
+        TEST_ERROR("buf is empty");
+        goto cleanup;
+    }
+
+    if (STRNEQ_NULLABLE(actual, data->expect)) {
+        TEST_ERROR("testBufEscapeStr(): Strings don't match:\n");
+        virtTestDifference(stderr, data->expect, actual);
+        goto cleanup;
+    }
+
+    ret = 0;
+
+ cleanup:
+    VIR_FREE(actual);
+    return ret;
+}
+
+
+static int
 mymain(void)
 {
     int ret = 0;
 <at>  <at>  -379,6 +412,22  <at>  <at>  mymain(void)
     DO_TEST_ADD_STR("<a/>\n", "<c>\n  <a/>\n</c>");
     DO_TEST_ADD_STR("<b>\n  <a/>\n</b>\n", "<c>\n  <b>\n    <a/>\n  </b>\n</c>");

+#define DO_TEST_ESCAPE(data, expect)                                   \
+    do {                                                               \
+        struct testBufAddStrData info = { data, expect };              \
+        if (virtTestRun("Buf: EscapeStr", testBufEscapeStr, &info) < 0)   \
+            ret = -1;                                                  \
+    } while (0)
+
+    DO_TEST_ESCAPE("<td></td><td></td>",
+                   "<c>\n  <el>&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;</el>\n</c>");
+    DO_TEST_ESCAPE("\007\"&&\"\x15",
+                   "<c>\n  <el>&quot;&amp;&amp;&quot;</el>\n</c>");
+    DO_TEST_ESCAPE(",,'..',,",
+                   "<c>\n  <el>,,&apos;..&apos;,,</el>\n</c>");
+    DO_TEST_ESCAPE("\x01\x01\x02\x03\x05\x08",
+                   "<c>\n  <el></el>\n</c>");
+
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }

--

-- 
2.0.5

Luyao Huang | 30 Mar 12:05 2015
Picon

[libvirt] [PATCH4/3] qemu: add cpu feature check for host-passthrough

Signed-off-by: Luyao Huang <lhuang <at> redhat.com>
---
I forgot this place.

 src/qemu/qemu_process.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 79f763e..5f418a9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
 <at>  <at>  -4070,11 +4070,6  <at>  <at>  qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver,
     bool ret = false;
     size_t i;

-    /* no features are passed to QEMU with -cpu host
-     * so it makes no sense to verify them */
-    if (def->cpu && def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
-        return true;
-
     switch (arch) {
     case VIR_ARCH_I686:
     case VIR_ARCH_X86_64:
--

-- 
1.8.3.1

Peter Krempa | 30 Mar 11:26 2015
Picon

[libvirt] [PATCH 0/3] For 1.2.14: Fix regression in synchronous block job ABORT/PIVOT

When a block job is terminated via the synchronous API the backing chain would
be updated in a separate thread and thus allowed applications to get outdated
data. This broke live snapshot merge on oVirt.

Since the commit breaking this (see patch 3/3) was not released yet I'm asking
to merge this during the freeze.

Peter Krempa (3):
  qemu: processBlockJob: Don't unlock  <at> vm twice
  qemu: Extract internals of processBlockJobEvent into a helper
  qemu: blockjob: Synchronously update backing chain in XML on
    ABORT/PIVOT

 src/conf/domain_conf.c  |  16 +++-
 src/conf/domain_conf.h  |   6 ++
 src/qemu/qemu_driver.c  | 246 ++++++++++++++++++++++++------------------------
 src/qemu/qemu_process.c |  38 +++++---
 4 files changed, 169 insertions(+), 137 deletions(-)

--

-- 
2.2.2

Luyao Huang | 30 Mar 10:49 2015
Picon

[libvirt] [PATCH 0/3] fix some issue around host-passthough cpu model

We support add feature in host-passthough cpu model, but there are
some place need fix.

Luyao Huang (3):
  cpu:x86: fix cannot keep cpu feature after migrate/restore
  qemu: add a check for non-migratable cpu flags
  docs: fix a small xml error in docs

 docs/formatdomain.html.in | 2 +-
 src/cpu/cpu_x86.c         | 9 ++++-----
 src/qemu/qemu_migration.c | 2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

--

-- 
1.8.3.1


Gmane