Re: [libvirt] [PATCH 1/1] CI: add code coverage analysis

2017-05-27 Thread Claudio André

Em 26/05/2017 04:12, Martin Kletzander escreveu:

Oh, so it's saved in your profile on the travis website.  That makes
sense.  I was just wondering where this environment variable gets
defined, that's it.  And I didn't check the documentation because I
didn't like the fact that coveralls.io wanted _write_ access to my
commit messages and repositories, so I didn't sign up.  And their
documentation seems pretty sparse when you're not logged in.


Agreed. coveralls.io is a nice tool with a list of respectable clients, 
but it is far from the maturity of, e.g., Travis.


Claudio

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


Re: [libvirt] [PATCH] CI: show the log in case of failure

2017-05-27 Thread Claudio André

Em 26/05/2017 04:15, Martin Kletzander escreveu:

On Thu, May 25, 2017 at 07:54:13PM -0300, Claudio André wrote:


The workers available in Travis are really old. That said, I plan to
workaround your finding and propose a patch:
- to build and test libvirt using a more updated distro (using
`services: docker`, of course).


Good to hear that.  I didn't know you can do that.


- and, if accepted, add ASAN (AddressSanitizer) to CI.



What addresses would you like to sanitize?


Sorry, I was talking about this: 
https://github.com/google/sanitizers/wiki/AddressSanitizer


It detects memory errors like leaks, overflows, use after free, etc. 
I'll propose to add it to CI so it will "analyze/audit" every new push.
- Since it is available in recent gcc and clang, I'll propose to enable 
it (add the compilation flag) for both compilers.
- Support it will mean: change configure.ac to allow the flag. Discuss, 
get feedback,  And later, automate (a very useful) check in CI.


Claudio

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


[libvirt] Entering freeze for libvirt-3.4.0

2017-05-27 Thread Daniel Veillard
  So as planned I tagged the release candidate 1 in git and pushed signed
tarball and rpms to the usual place:

   ftp://libvirt.org/libvirt/


  Everything seems to work fine for me with RC1 on my limited testing
but as usual please give it some attention to find out issues and check
portability on the various platforms.

  If everything woks well, I will push the RC2 on Tuesday and then we can roll
out 3.4.0 and get out of the freeze next Thursday,

   but in the meantime, please give it a try !

 Thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/

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


[libvirt] [libvirt-sandbox PATCH] docker: Don't ignore qemu-img errors

2017-05-27 Thread Guido Günther
---
 libvirt-sandbox/image/sources/docker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libvirt-sandbox/image/sources/docker.py 
b/libvirt-sandbox/image/sources/docker.py
index 43e9c32..aa5675e 100755
--- a/libvirt-sandbox/image/sources/docker.py
+++ b/libvirt-sandbox/image/sources/docker.py
@@ -662,7 +662,7 @@ class DockerSource(base.Source):
 cmd.append("-o")
 cmd.append("backing_fmt=qcow2,backing_file=%s" % diskfile)
 cmd.append(tempfile)
-subprocess.call(cmd)
+subprocess.check_call(cmd)
 return tempfile
 
 def get_command(self, template, templatedir, userargs):
-- 
2.11.0

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


[libvirt] [libvirt-sandbox PATCH] Drop library/ from template name and image path

2017-05-27 Thread Guido Günther
If one pastes from the output of virt-sansbox-image

  $ virt-sandbox-image list
  docker:/library/ubuntu?tag=17.04
  docker:/library/debian?tag=latest

verbatim

  $ virt-sandbox-image run -c qemu:///session docker:/library/debian?tag=latest

This fails like

  /home//.local/share/libvirt/images/library/debian:qbeilwxard.qcow2: 
Could not create file: No such file or directory
  Unable to start sandbox: Failed to create domain: XML error: name 
library/debian:qbeilwxard cannot contain '/'
  /usr/bin/virt-sandbox-image: [Errno 2] No such file or directory: 
'/home//.local/share/libvirt/images/library/debian:qbeilwxard.qcow2'

so strip of any leading components.
---
This might not be the correct fix but I hope you get the idea.

 libvirt-sandbox/image/cli.py| 2 +-
 libvirt-sandbox/image/sources/docker.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libvirt-sandbox/image/cli.py b/libvirt-sandbox/image/cli.py
index 3a5ccfa..0f27a16 100644
--- a/libvirt-sandbox/image/cli.py
+++ b/libvirt-sandbox/image/cli.py
@@ -96,7 +96,7 @@ def run(args):
 name = args.name
 if name is None:
 randomid = ''.join(random.choice(string.lowercase) for i in range(10))
-name = tmpl.path[1:] + ":" + randomid
+name = tmpl.path[1:].split('/')[-1] + ":" + randomid
 
 diskfile = source.get_disk(template=tmpl,
templatedir=template_dir,
diff --git a/libvirt-sandbox/image/sources/docker.py 
b/libvirt-sandbox/image/sources/docker.py
index aa5675e..6ca086c 100755
--- a/libvirt-sandbox/image/sources/docker.py
+++ b/libvirt-sandbox/image/sources/docker.py
@@ -655,7 +655,7 @@ class DockerSource(base.Source):
 def get_disk(self, template, templatedir, imagedir, sandboxname):
 image = DockerImage.from_template(template)
 configfile, diskfile = self._get_template_data(image, templatedir)
-tempfile = imagedir + "/" + sandboxname + ".qcow2"
+tempfile = imagedir + "/" + sandboxname.split('/')[-1] + ".qcow2"
 if not os.path.exists(imagedir):
 os.makedirs(imagedir)
 cmd = ["qemu-img","create","-q","-f","qcow2"]
-- 
2.11.0

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


[libvirt] [libvirt-sandbox PATCH] mkinitrd: Add missing fscrypto module

2017-05-27 Thread Guido Günther
---
 libvirt-sandbox/libvirt-sandbox-builder-machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libvirt-sandbox/libvirt-sandbox-builder-machine.c 
b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
index bdec490..7204f71 100644
--- a/libvirt-sandbox/libvirt-sandbox-builder-machine.c
+++ b/libvirt-sandbox/libvirt-sandbox-builder-machine.c
@@ -186,6 +186,7 @@ static gchar 
*gvir_sandbox_builder_machine_mkinitrd(GVirSandboxConfig *config,
 
 /* In case ext4 is built as a module, include it and its deps
  * for the root mount */
+gvir_sandbox_config_initrd_add_module(initrd, "fscrypto.ko");
 gvir_sandbox_config_initrd_add_module(initrd, "mbcache.ko");
 gvir_sandbox_config_initrd_add_module(initrd, "jbd2.ko");
 gvir_sandbox_config_initrd_add_module(initrd, "crc16.ko");
-- 
2.11.0

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


[libvirt] [PATCH] qemu: mkdir memory_backing_dir on startup

2017-05-27 Thread Michal Privoznik
In 48d9e6cdcc and friends we've allowed users to back guest
memory by a file inside the host. And in order to keep things
manageable the memory_backing_dir variable was introduced to
qemu.conf to specify the directory where the files are kept.
However, libvirt's policy is that directories are created on
domain startup if they don't exist. We've missed this one.

Signed-off-by: Michal Privoznik 
---
 src/qemu/qemu_driver.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 67f54282a..fcab7ddf8 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -706,6 +706,11 @@ qemuStateInitialize(bool privileged,
  cfg->nvramDir);
 goto error;
 }
+if (virFileMakePath(cfg->memoryBackingDir) < 0) {
+virReportSystemError(errno, _("Failed to create memory backing dir 
%s"),
+ cfg->memoryBackingDir);
+goto error;
+}
 
 qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
 
@@ -830,6 +835,13 @@ qemuStateInitialize(bool privileged,
  (int) cfg->group);
 goto error;
 }
+if (chown(cfg->memoryBackingDir, cfg->user, cfg->group) < 0) {
+virReportSystemError(errno,
+ _("unable to set ownership of '%s' to %d:%d"),
+ cfg->memoryBackingDir, (int) cfg->user,
+ (int) cfg->group);
+goto error;
+}
 
 run_uid = cfg->user;
 run_gid = cfg->group;
-- 
2.13.0

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


Re: [libvirt] [libvirt-php PATCH] use proper arginfo for libvirt_domain_create

2017-05-27 Thread Michal Privoznik
On 05/26/2017 04:32 PM, Dawid Zamirski wrote:
> this function takes only resource argument.
> ---
>  src/libvirt-php.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libvirt-php.c b/src/libvirt-php.c
> index bfc9b7d..99d6397 100644
> --- a/src/libvirt-php.c
> +++ b/src/libvirt-php.c
> @@ -629,7 +629,7 @@ static zend_function_entry libvirt_functions[] = {
>  PHP_FE(libvirt_domain_lookup_by_uuid,arginfo_libvirt_conn_uuid)
>  PHP_FE(libvirt_domain_lookup_by_uuid_string, arginfo_libvirt_conn_uuid)
>  PHP_FE(libvirt_domain_destroy,   arginfo_libvirt_conn)
> -PHP_FE(libvirt_domain_create,arginfo_libvirt_conn_xml)
> +PHP_FE(libvirt_domain_create,arginfo_libvirt_conn)
>  PHP_FE(libvirt_domain_resume,arginfo_libvirt_conn)
>  PHP_FE(libvirt_domain_core_dump, 
> arginfo_libvirt_domain_core_dump)
>  PHP_FE(libvirt_domain_shutdown,  arginfo_libvirt_conn)
> 

ACKed and pushed. Thanks.

Michal

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


[libvirt] libvirt-php changing release strategy

2017-05-27 Thread Michal Privoznik
Dear list,

as you've noticed, libvirt changed the versioning strategy and slowly
other subprojects are adapting it too. I mean, the version number is
changed right after the release and not just before it. It makes sense
and therefore I'm letting you know that libvirt-php is adapting this
scheme too:

commit 3bdbd3175d159a96731bbb95bfd4bbeff7952f16
Author: Michal Privoznik 
AuthorDate: Sat May 27 11:25:47 2017 +0200
Commit: Michal Privoznik 
CommitDate: Sat May 27 11:25:47 2017 +0200

Post-release version bump to 0.5.4

Signed-off-by: Michal Privoznik 



Michal

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


[libvirt] [PATCH] tools: make setvcpus --maximum imply --config

2017-05-27 Thread Chen Hanxiao
From: Chen Hanxiao 

 Currently --maximum was possible if and only if
 --config was specified.

 This patch makes setvcpus --maximum imply --config.

Signed-off-by: Chen Hanxiao 
---
 tools/virsh-domain.c | 7 ---
 tools/virsh.pod  | 9 +
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 5c42021..04ef816 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6819,8 +6819,8 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
 VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
 VSH_EXCLUSIVE_OPTIONS_VAR(current, config);
 VSH_EXCLUSIVE_OPTIONS_VAR(guest, config);
-
-VSH_REQUIRE_OPTION_VAR(maximum, config);
+VSH_EXCLUSIVE_OPTIONS_VAR(maximum, live);
+VSH_EXCLUSIVE_OPTIONS_VAR(maximum, current);
 
 if (config)
 flags |= VIR_DOMAIN_AFFECT_CONFIG;
@@ -6829,7 +6829,8 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
 if (guest)
 flags |= VIR_DOMAIN_VCPU_GUEST;
 if (maximum)
-flags |= VIR_DOMAIN_VCPU_MAXIMUM;
+flags |= VIR_DOMAIN_VCPU_MAXIMUM |
+ VIR_DOMAIN_AFFECT_CONFIG;
 if (hotpluggable)
 flags |= VIR_DOMAIN_VCPU_HOTPLUGGABLE;
 
diff --git a/tools/virsh.pod b/tools/virsh.pod
index e7c513b..bc8b539 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2501,10 +2501,11 @@ flag. Vcpus added to live domains supporting vcpu 
unplug are automatically
 marked as hotpluggable.
 
 The I<--maximum> flag controls the maximum number of virtual cpus that can
-be hot-plugged the next time the domain is booted.  As such, it must only be
-used with the I<--config> flag, and not with the I<--live> or the I<--current>
-flag. Note that it may not be possible to change the maximum vcpu count if
-the processor topology is specified for the guest.
+be hot-plugged the next time the domain is booted.  As such, it implies
+I<--config> be set. Also it can be used with the I<--config> flag,
+but not with the I<--live> or the I<--current> flag. Note that it may not
+be possible to change the maximum vcpu count if the processor topology
+is specified for the guest.
 
 =item B I I [I<--enable>] | [I<--disable>]
 [[I<--live>] [I<--config>] | [I<--current>]]
-- 
2.7.4


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