Re: [libvirt] [PATCH] tools: make wireshark build quiet

2017-08-04 Thread Laine Stump
On 08/04/2017 01:12 PM, Daniel P. Berrange wrote:
> Use $(AM_V_GEN) when running wireshark related tools

ACK.

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


[libvirt] [PATCH v2] Rewrite the way mockable functions are handled.

2017-08-04 Thread Daniel P. Berrange
Currently any mockable functions are marked with attributes
noinline, noclone and weak. This prevents the compiler from
optimizing away the impl of these functions.

It has an unfortunate side effect with the libtool convenience
libraries, if executables directly link to them. For example
virlockd, virlogd both link to libvirt_util.la  When this is
done, the linker does not consider weak symbols as being
undefined, so it never copies them into the final executable.

In this new approach, we stop annotating the headers entirely.
Instead we create a weak function alias in the source.

   int fooImpl(void) {
  ..the real code..
   }

   int foo(void) __attribute__((noinline, noclone, weak, alias("fooImpl"))

If any functions in the same file call "foo", this prevents the
optimizer from inlining any part of fooImpl. When linking to the
libtool convenience static library, we also get all the symbols
present. Finally the test suite can just directly define a
'foo' function in its source, removing the need to use LD_PRELOAD
(though removal of LD_PRELOADS is left for a future patch).

Signed-off-by: Daniel P. Berrange 
---

Changed in v2:

 - Use macro magic to define the alias

 build-aux/mock-noinline.pl  | 22 +++
 src/check-symfile.pl|  2 +-
 src/internal.h  | 36 +-
 src/qemu/qemu_capabilities.c|  7 ++--
 src/qemu/qemu_capspriv.h|  2 +-
 src/rpc/virnetsocket.c  | 43 --
 src/rpc/virnetsocket.h  |  6 +--
 src/util/vircommand.c   |  4 +-
 src/util/vircommand.h   |  2 +-
 src/util/vircrypto.c|  3 +-
 src/util/vircrypto.h|  2 +-
 src/util/virfile.c  |  3 +-
 src/util/virfile.h  |  2 +-
 src/util/virhashcode.c  |  3 +-
 src/util/virhashcode.h  |  3 +-
 src/util/virhostcpu.c   | 12 --
 src/util/virhostcpu.h   |  4 +-
 src/util/virmacaddr.c   |  5 ++-
 src/util/virmacaddr.h   |  2 +-
 src/util/virnetdev.c| 25 -
 src/util/virnetdev.h|  9 ++---
 src/util/virnetdevip.c  | 19 +-
 src/util/virnetdevip.h  |  2 +-
 src/util/virnetdevopenvswitch.c |  7 ++--
 src/util/virnetdevopenvswitch.h |  2 +-
 src/util/virnetdevtap.c | 40 +++-
 src/util/virnetdevtap.h |  6 +--
 src/util/virnuma.c  | 81 -
 src/util/virnuma.h  | 16 
 src/util/virrandom.c| 14 ---
 src/util/virrandom.h|  6 +--
 src/util/virscsi.c  | 11 +++---
 src/util/virscsi.h  |  2 +-
 src/util/virscsivhost.c |  3 +-
 src/util/virscsivhost.h |  2 +-
 src/util/virtpm.c   |  3 +-
 src/util/virtpm.h   |  2 +-
 src/util/virutil.c  | 24 
 src/util/virutil.h  | 10 ++---
 src/util/viruuid.c  |  4 +-
 src/util/viruuid.h  |  2 +-
 41 files changed, 257 insertions(+), 196 deletions(-)

diff --git a/build-aux/mock-noinline.pl b/build-aux/mock-noinline.pl
index eafe20d2e..cac46b767 100644
--- a/build-aux/mock-noinline.pl
+++ b/build-aux/mock-noinline.pl
@@ -8,12 +8,12 @@ my %mocked;
 $noninlined{"virEventAddTimeout"} = 1;
 
 foreach my $arg (@ARGV) {
-if ($arg =~ /\.h$/) {
-#print "Scan header $arg\n";
-&scan_annotations($arg);
-} elsif ($arg =~ /mock\.c$/) {
+if ($arg =~ /mock\.c$/) {
 #print "Scan mock $arg\n";
 &scan_overrides($arg);
+} elsif ($arg =~ /\.c$/) {
+#print "Scan header $arg\n";
+&scan_annotations($arg);
 }
 }
 
@@ -35,18 +35,8 @@ sub scan_annotations {
 
 my $func;
 while () {
-if (/^\s*(\w+)\(/ || /^(?:\w+\*?\s+)+(?:\*\s*)?(\w+)\(/) {
-my $name = $1;
-if ($name !~ /ATTRIBUTE/) {
-$func = $name;
-}
-} elsif (/^\s*$/) {
-$func = undef;
-}
-if (/ATTRIBUTE_NOINLINE/) {
-if (defined $func) {
-$noninlined{$func} = 1;
-}
+if (/VIR_MOCKABLE\((\w+)\)/) {
+$noninlined{$1} = 1;
 }
 }
 
diff --git a/src/check-symfile.pl b/src/check-symfile.pl
index d59a213eb..3b062d0a4 100755
--- a/src/check-symfile.pl
+++ b/src/check-symfile.pl
@@ -52,7 +52,7 @@ foreach my $elflib (@elflibs) {
 open NM, "-|", "nm", $elflib or die "cannot run 'nm $elflib': $!";
 
 while () {
-next unless /^\S+\s(?:[TBD])\s(\S+)\s*$/;
+next unless /^\S+\s(?:[TBDW])\s(\S+)\s*$/;
 
 $gotsyms{$1} = 1;
 }
diff --git a/src/internal.h b/src/internal.h
index c29f20f02..6838f7798 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -113,16 +113,6 @@
 # endif
 
 /**
- * ATTRIBUTE_NOINLINE:
- *
- * Force compiler not to inline a method. Should be used if
- * the method need to be overridable by test mocks.
- */
-# ifndef

[libvirt] [PATCH] tools: make wireshark build quiet

2017-08-04 Thread Daniel P. Berrange
Use $(AM_V_GEN) when running wireshark related tools

Signed-off-by: Daniel P. Berrange 
---
 tools/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile.am b/tools/Makefile.am
index 345521457..ffa8c3e19 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -439,7 +439,7 @@ wireshark/src/packet-libvirt.c: 
wireshark/src/packet-libvirt.h \
wireshark/src/libvirt/protocol.h
 
 wireshark/src/plugin.c: wireshark/src/packet-libvirt.c
-   cd wireshark/src && \
+   $(AM_V_GEN)cd wireshark/src && \
$(abs_top_srcdir)/tools/wireshark/util/make-dissector-reg \
. plugin packet-libvirt.c
 
@@ -451,7 +451,7 @@ WS_DISSECTOR_PROTO_FILES  = \
 
 wireshark/src/libvirt/protocol.h: wireshark/util/genxdrstub.pl \
$(WS_DISSECTOR_PROTO_FILES)
-   $(MKDIR_P) wireshark/src/libvirt
+   $(AM_V_GEN)$(MKDIR_P) wireshark/src/libvirt && \
cd wireshark/src && \
LIBVIRT_VERSION=$(LIBVIRT_VERSION) \
  $(PERL) $(abs_top_srcdir)/tools/wireshark/util/genxdrstub.pl \
-- 
2.13.3

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


Re: [libvirt] [PATCH v3] libxl: Add a test suite for libxl_domain_config generator

2017-08-04 Thread Jim Fehlig

On 08/03/2017 06:29 AM, Joao Martins wrote:

On Tue, Aug 01, 2017 at 03:17:51PM +0200, Marek Marczykowski-Górecki wrote:

From: Jim Fehlig 

The libxl library allows a libxl_domain_config object to be serialized
from/to a JSON string. Use this to allow testing of the XML to
libxl_domain_config conversion process. Test XML is converted to
libxl_domain_config, which is then serialized to json. A json template
corresponding to the test XML is converted to a libxl_domain_config
object using libxl_domain_config_from_json(), and then serialized
back to json using libxl_domain_config_to_json(). The two json
docs are then compared.

Using libxl to convert the json template to a libxl_domain_config
object and then back to json provides a simple way to account for
any changes or additions to the json representation across Xen
releases.

Signed-off-by: Jim Fehlig 
[update to v3.5.0-rc1, improve error reporting, use /bin/true emulator]
Signed-off-by: Marek Marczykowski-Górecki 


I've been looking at this series for the past days, and taking into
account the comments that Jim mentioned yesterday are ammended, and this
looks good to me:

Reviewed-by: Joao Martins 


Thanks, I've pushed it now.


It adds a really nice piece of testing infra for libxl_domain_configs.
Maybe in the future more tests could be added in (in addition to the
CPUID one that Marek has planned).


Agreed. Testing of the libxl_domain_config generation code was long overdue.

Regards,
Jim

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

[libvirt] [PATCH] tests: add further XML namespace test

2017-08-04 Thread Daniel P. Berrange
Validate that we can pass QEMU command line options using a default
namespace, instead of a prefixed namespace

Signed-off-by: Daniel P. Berrange 
---
 .../qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.args | 27 +++
 .../qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml  | 30 ++
 tests/qemuxml2argvtest.c   |  1 +
 3 files changed, 58 insertions(+)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.args
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.args 
b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.args
new file mode 100644
index 0..9650e7478
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.args
@@ -0,0 +1,27 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+NS=ns \
+BAR='' \
+/usr/bin/qemu-system-i686 \
+-name QEMUGuest1 \
+-S \
+-M pc \
+-m 214 \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-nographic \
+-nodefaults \
+-chardev 
socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=readline \
+-no-acpi \
+-boot c \
+-usb \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 \
+-unknown parameter
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml 
b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml
new file mode 100644
index 0..491fc2d80
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-qemu-ns-alt.xml
@@ -0,0 +1,30 @@
+
+  QEMUGuest1
+  c7a5fdbd-edaf-9455-926a-d65c16db1809
+  219136
+  219136
+  1
+  
+hvm
+
+  
+  
+  destroy
+  restart
+  destroy
+  
+/usr/bin/qemu-system-i686
+
+  
+  
+  
+
+
+  
+  
+
+
+
+
+  
+
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index aa83013a2..655c89bc3 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1558,6 +1558,7 @@ mymain(void)
 
 DO_TEST("qemu-ns", NONE);
 DO_TEST("qemu-ns-no-env", NONE);
+DO_TEST("qemu-ns-alt", NONE);
 
 DO_TEST("smp", NONE);
 
-- 
2.13.3

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


Re: [libvirt] [PATCH] docs: make website responsive for mobile devices

2017-08-04 Thread Pavel Hrdina
On Fri, Aug 04, 2017 at 04:07:51PM +0100, Daniel P. Berrange wrote:
> On Fri, Aug 04, 2017 at 04:56:30PM +0200, Peter Krempa wrote:
> > On Fri, Aug 04, 2017 at 13:31:04 +0100, Daniel Berrange wrote:
> > > The website does not look good in a mobile device as the text is
> > > far too small and the layout assumes a wide screen.
> > 
> > So can we finally change the "Learn" to "Documentation" now that this
> > patch will fix the mobile devices, which was AFAIK the reason not to do
> > that?
> 
> Still not enough room for "Documentation" when in portrait mode on my
> phone. At most we could do "Docs"

+1 for "Docs", my previous attempt was not successful :)



Pavel


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

Re: [libvirt] [PATCH] docs: make website responsive for mobile devices

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 05:35:05PM +0200, Pavel Hrdina wrote:
> On Fri, Aug 04, 2017 at 04:07:51PM +0100, Daniel P. Berrange wrote:
> > On Fri, Aug 04, 2017 at 04:56:30PM +0200, Peter Krempa wrote:
> > > On Fri, Aug 04, 2017 at 13:31:04 +0100, Daniel Berrange wrote:
> > > > The website does not look good in a mobile device as the text is
> > > > far too small and the layout assumes a wide screen.
> > > 
> > > So can we finally change the "Learn" to "Documentation" now that this
> > > patch will fix the mobile devices, which was AFAIK the reason not to do
> > > that?
> > 
> > Still not enough room for "Documentation" when in portrait mode on my
> > phone. At most we could do "Docs"
> 
> +1 for "Docs", my previous attempt was not successful :)
> 
> 

Since I'm in the minority opinion here, my v2 changes it to "Docs"


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

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


[libvirt] [PATCH] Remove bogus warning about vir$OBJECTGetConnect functions

2017-08-04 Thread Daniel P. Berrange
The API docs for the various vir$OBJECTGetConnect functions
contain a warning

  WARNING: When writing libvirt bindings in other languages, do
  not use this function.  Instead, store the connection and
  the domain object together.

There is no reason why language bindings should not use this
method, and indeed the Perl, Python, and Go bindings all use
these methods.

This warning was originally added back in

  commit 3edb4bc9fb1b451599df58420d61ffd73633cead
  Author: Daniel Veillard 
  Date:   Tue Jul 24 15:32:55 2007 +

* libvirt.spec.in NEWS docs/* po/*: preparing release 0.3.1
* src/libvirt.c python/generator.py: some cleanup and warnings
  from Richard W.M. Jones

IIUC, the rational was that these APIs do not need to be
directly exposed to the non-C language, as the language
can expose the same concept itself by storing the original
virConnectPtr object alongside the virDomainPtr.  There's
no reason to mandate such an approach though - it is valid
for languages to expose this directly if that suits their
needs better.

Signed-off-by: Daniel P. Berrange 
---
 src/libvirt-domain-snapshot.c | 6 --
 src/libvirt-domain.c  | 4 
 src/libvirt-interface.c   | 4 
 src/libvirt-network.c | 4 
 src/libvirt-secret.c  | 3 ---
 src/libvirt-storage.c | 8 
 6 files changed, 29 deletions(-)

diff --git a/src/libvirt-domain-snapshot.c b/src/libvirt-domain-snapshot.c
index b7c566fec..953a586e5 100644
--- a/src/libvirt-domain-snapshot.c
+++ b/src/libvirt-domain-snapshot.c
@@ -57,9 +57,6 @@ virDomainSnapshotGetName(virDomainSnapshotPtr snapshot)
  * reference counter on the domain is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do not use this
- * function.  Instead, store the domain and the snapshot object together.
- *
  * Returns the domain or NULL.
  */
 virDomainPtr
@@ -83,9 +80,6 @@ virDomainSnapshotGetDomain(virDomainSnapshotPtr snapshot)
  * reference counter on the connection is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do not use this
- * function.  Instead, store the connection and the snapshot object together.
- *
  * Returns the connection or NULL.
  */
 virConnectPtr
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 4033ae8e6..87fca29c4 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -115,10 +115,6 @@ virConnectNumOfDomains(virConnectPtr conn)
  * reference counter on the connection is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do
- * not use this function.  Instead, store the connection and
- * the domain object together.
- *
  * Returns the virConnectPtr or NULL in case of failure.
  */
 virConnectPtr
diff --git a/src/libvirt-interface.c b/src/libvirt-interface.c
index 3d1a5ff8d..7c8996c58 100644
--- a/src/libvirt-interface.c
+++ b/src/libvirt-interface.c
@@ -35,10 +35,6 @@ VIR_LOG_INIT("libvirt.interface");
  * reference counter on the connection is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do
- * not use this function.  Instead, store the connection and
- * the interface object together.
- *
  * Returns the virConnectPtr or NULL in case of failure.
  */
 virConnectPtr
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index 3136f27ee..5c5a0ee22 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -36,10 +36,6 @@ VIR_LOG_INIT("libvirt.network");
  * reference counter on the connection is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do
- * not use this function.  Instead, store the connection and
- * the network object together.
- *
  * Returns the virConnectPtr or NULL in case of failure.
  */
 virConnectPtr
diff --git a/src/libvirt-secret.c b/src/libvirt-secret.c
index 8a99c8c26..d9244c252 100644
--- a/src/libvirt-secret.c
+++ b/src/libvirt-secret.c
@@ -34,9 +34,6 @@ VIR_LOG_INIT("libvirt.secret");
  * Provides the connection pointer associated with a secret.  The reference
  * counter on the connection is not increased by this call.
  *
- * WARNING: When writing libvirt bindings in other languages, do not use this
- * function.  Instead, store the connection and the secret object together.
- *
  * Returns the virConnectPtr or NULL in case of failure.
  */
 virConnectPtr
diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c
index 35f9926d5..2cefc3c91 100644
--- a/src/libvirt-storage.c
+++ b/src/libvirt-storage.c
@@ -36,10 +36,6 @@ VIR_LOG_INIT("libvirt.storage");
  * reference counter on the connection is not increased by this
  * call.
  *
- * WARNING: When writing libvirt bindings in other languages, do
- * not use this function.  Instead, store the connection and
- * the pool object together.
- *
  * Returns the virConnectPtr or NULL in case of failure.
  */
 virConnectPtr
@@ -1254,10 +1250,6 @@ virS

[libvirt] [PATCH v2] docs: make website responsive for mobile devices

2017-08-04 Thread Daniel P. Berrange
The website does not look good in a mobile device as the text is
far too small and the layout assumes a wide screen.

Make the style dynamically adapt based on viewport size, so a
mobile device gets a layout more suited to its dimensions,
also changing "Learn" to "Docs"

Signed-off-by: Daniel P. Berrange 
---
 docs/main.css   |  1 +
 docs/mobile.css | 94 +
 docs/page.xsl   | 36 +-
 3 files changed, 130 insertions(+), 1 deletion(-)
 create mode 100644 docs/mobile.css

diff --git a/docs/main.css b/docs/main.css
index 95d5d325d..71f7b7a6a 100644
--- a/docs/main.css
+++ b/docs/main.css
@@ -1,3 +1,4 @@
 @import url(fonts/stylesheet.css);
 @import url(generic.css);
 @import url(libvirt.css);
+@import url(mobile.css);
diff --git a/docs/mobile.css b/docs/mobile.css
new file mode 100644
index 0..85ca49752
--- /dev/null
+++ b/docs/mobile.css
@@ -0,0 +1,94 @@
+@media (max-width: 1000px) {
+#home {
+   width: 100%;
+   display: block;
+   margin: 0px;
+   background: white url(logos/logo-banner-dark-256.png) no-repeat center 
center;
+   height: 94px;
+}
+#home a {
+   width: 100%;
+}
+#search {
+   width: 100%;
+   display: block;
+   margin: 0px;
+   background: white;
+   padding: 0px;
+}
+#search form {
+   padding: 5px;
+}
+body.index h1 {
+   display: none;
+}
+#jumplinks {
+   padding: 0px;
+   display: block;
+   width: 100%;
+   text-align: center;
+   margin: 0px;
+   height: 1.3em;
+   font-size: 1em;
+   border-top: 3px solid rgb(60, 133, 124);
+   border-bottom: 3px solid rgb(60, 133, 124);
+}
+#jumplinks ul {
+   display: block;
+   padding: 0px;
+   margin: 0px;
+}
+#jumplinks li {
+   margin: 0px;
+   padding-left: 0.5em;
+   padding-right: 0.5em;
+}
+#nav {
+   border: 0px;
+}
+
+#search.navhide {
+   display: none !IMPORTANT;
+}
+#home.navhide {
+   position: fixed;
+   top: 0px;
+   z-index: 9001;
+   width: 6em;
+   display: block;
+   margin: 0px;
+   background: inherit;
+   height: 1.3em;
+   border-top: 3px solid rgb(60, 133, 124);
+   border-bottom: 3px solid rgb(60, 133, 124);
+   font-size: 1em;
+   text-indent: 0px;
+   font-weight: bold;
+   padding-left: 1em;
+}
+#home.navhide a {
+   color: white;
+   text-decoration: none;
+}
+#home.navhide a:hover {
+   color: rgb(255, 230, 0);
+}
+#jumplinks.navhide {
+   position: fixed;
+   text-align: right;
+   top: 0px;
+   z-index: 9000;
+   background: rgb(0, 95, 97);
+}
+#jumplinks.navhide ul {
+   z-index: 9001;
+}
+#body {
+   margin-top: 180px;
+}
+div.panel {
+   width: 80%;
+   float: none;
+   margin-bottom: 2em;
+}
+}
diff --git a/docs/page.xsl b/docs/page.xsl
index 7ca4e7bf4..3a64a06c5 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -88,6 +88,7 @@
   
   
 
+
 
 
 
@@ -97,6 +98,39 @@
 libvirt: 
 
 
+
+
+  
+   shrinkOn) {
+  if (home.className != "navhide") {
+  body.className = "navhide"
+  home.className = "navhide"
+  links.className = "navhide"
+  search.className = "navhide"
+  }
+  } else {
+  if (home.className == "navhide") {
+  body.className = ""
+  home.className = ""
+  links.className = ""
+  search.className = ""
+  }
+  }
+  });
+  }
+  window.onload = init();
+   ]]>
+  
+
   
   
 
@@ -117,7 +151,7 @@
 
   Download
   Contribute
-  Learn
+  Docs
 
   
   
-- 
2.13.3

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


Re: [libvirt] [PATCH] rpm: conditionalize dep on perl for perl-interpretor split in F27

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 04:37:37PM +0200, Michal Privoznik wrote:
> On 08/02/2017 11:52 AM, Daniel P. Berrange wrote:
> > Signed-off-by: Daniel P. Berrange 
> > ---
> >  libvirt.spec.in   | 4 
> >  mingw-libvirt.spec.in | 4 
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/libvirt.spec.in b/libvirt.spec.in
> > index b074bd171..8abecae22 100644
> > --- a/libvirt.spec.in
> > +++ b/libvirt.spec.in
> > @@ -292,7 +292,11 @@ BuildRequires: libtool
> >  BuildRequires: /usr/bin/pod2man
> >  %endif
> >  BuildRequires: git
> > +%if 0%{?fedora} >= 27
> > +BuildRequires: perl-interpretor
> 
> s/interpretor/interpreter/

Sigh, I guess this time i *should* have cut+paste ;-)

> 
> > +%else
> >  BuildRequires: perl
> > +%endif
> >  BuildRequires: python
> >  %if %{with_systemd}
> >  BuildRequires: systemd-units
> > diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
> > index 4efa0ddbf..553d14022 100644
> > --- a/mingw-libvirt.spec.in
> > +++ b/mingw-libvirt.spec.in
> > @@ -59,7 +59,11 @@ BuildRequires:  pkgconfig
> >  # Need native version for msgfmt
> >  BuildRequires:  gettext
> >  BuildRequires:  python
> > +%if 0%{?fedora} >= 27
> > +BuildRequires:  perl-interpretor
> 
> again.
> 
> > +%else
> >  BuildRequires:  perl
> > +%endif
> >  BuildRequires:  perl(Getopt::Long)
> >  %if 0%{?enable_autotools}
> >  BuildRequires: autoconf
> > 
> 
> ACK with that fixed.
> 
> Michal

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

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


Re: [libvirt] [PATCH v2 1/4] cpu: define sub-leaf 0 for leaf 7 in cpu_map.xml

2017-08-04 Thread Jiri Denemark
On Tue, Jul 04, 2017 at 05:03:44 +0200, Marek Marczykowski-Górecki wrote:
> CPUID leaf 7 is sub-leaf aware. Add missing attribute.
> 
> Signed-off-by: Marek Marczykowski-Górecki 
> ---
> Changes since v1:
>  - format ecx_in='0x00'
> ---
>  src/cpu/cpu_map.xml | 58 +++---
>  1 file changed, 29 insertions(+), 29 deletions(-)

ACK, I pushed this patch since it's not really related to the rest of
this series.

Jirka

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


Re: [libvirt] [PATCH] docs: make website responsive for mobile devices

2017-08-04 Thread Daniel P. Berrange
On Fri, Aug 04, 2017 at 04:56:30PM +0200, Peter Krempa wrote:
> On Fri, Aug 04, 2017 at 13:31:04 +0100, Daniel Berrange wrote:
> > The website does not look good in a mobile device as the text is
> > far too small and the layout assumes a wide screen.
> 
> So can we finally change the "Learn" to "Documentation" now that this
> patch will fix the mobile devices, which was AFAIK the reason not to do
> that?

Still not enough room for "Documentation" when in portrait mode on my
phone. At most we could do "Docs"

> 
> > 
> > Make the style dynanically adapt based on viewport size, so a
> > mobile device gets a layout more suited to its dimensions.
> > 
> > Signed-off-by: Daniel P. Berrange 
> > ---
> >  docs/main.css   |  1 +
> >  docs/mobile.css | 95 
> > +
> >  docs/page.xsl   | 34 +
> >  3 files changed, 130 insertions(+)
> >  create mode 100644 docs/mobile.css
> 
> docs/mobile.css:1:
> maint.mk: Prohibited empty first line
> make: *** [cfg.mk:939: sc_prohibit_empty_first_line] Error 1

Opps will fix.


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

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


Re: [libvirt] [PATCH] docs: make website responsive for mobile devices

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 13:31:04 +0100, Daniel Berrange wrote:
> The website does not look good in a mobile device as the text is
> far too small and the layout assumes a wide screen.

So can we finally change the "Learn" to "Documentation" now that this
patch will fix the mobile devices, which was AFAIK the reason not to do
that?

> 
> Make the style dynanically adapt based on viewport size, so a
> mobile device gets a layout more suited to its dimensions.
> 
> Signed-off-by: Daniel P. Berrange 
> ---
>  docs/main.css   |  1 +
>  docs/mobile.css | 95 
> +
>  docs/page.xsl   | 34 +
>  3 files changed, 130 insertions(+)
>  create mode 100644 docs/mobile.css

docs/mobile.css:1:
maint.mk: Prohibited empty first line
make: *** [cfg.mk:939: sc_prohibit_empty_first_line] Error 1



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

Re: [libvirt] [PATCH 5/8] virVMXParseConfig: Don't leak def->videos

2017-08-04 Thread Ján Tomko

On Fri, Aug 04, 2017 at 04:22:33PM +0200, Michal Privoznik wrote:

This function calls virDomainDefAddImplicitDevices() which adds
implicit video device to domain definition. However, later in the
process the function just ignores this and overwrites the @videos
array without prior free.



We should not be calling virDomainDefAddImplicitDevices before
all the explicit devices are added to the domain definition.

What is the point of adding a device just to free it a few lines later?

Jan


Signed-off-by: Michal Privoznik 
---
src/vmx/vmx.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)



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

Re: [libvirt] [PATCH 1/8] virDomainDefFree: Don't leak initenv name and value

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:29 +0200, Michal Privoznik wrote:
> When parsing boot options from domain XML in
> virDomainDefParseBootOptions() initenv id stored to:

In this function there's a very shady approach to extract the contents
of the XML element.

> 
> def->os.initenv[i]->name
> def->os.initenv[i]->value
> 
> But these are never freed.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/conf/domain_conf.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 640f29d3e..8168dc52f 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -2931,8 +2931,11 @@ void virDomainDefFree(virDomainDefPtr def)
>  for (i = 0; def->os.initargv && def->os.initargv[i]; i++)
>  VIR_FREE(def->os.initargv[i]);
>  VIR_FREE(def->os.initargv);
> -for (i = 0; def->os.initenv && def->os.initenv[i]; i++)
> +for (i = 0; def->os.initenv && def->os.initenv[i]; i++) {
> +VIR_FREE(def->os.initenv[i]->name);
> +VIR_FREE(def->os.initenv[i]->value);
>  VIR_FREE(def->os.initenv[i]);

ACK to this though


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

Re: [libvirt] [PATCH 8/8] virdbustest: Don't leak @out_strv1

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:36 +0200, Michal Privoznik wrote:
> In testMessageSingleArrayRef the string is doubly referenced.
> Therefore we have to free also the first pointer to the string.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  tests/virdbustest.c | 1 +
>  1 file changed, 1 insertion(+)

ACK


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

Re: [libvirt] [PATCH 7/8] qemuhotplugtest: Don't leak @vm

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:35 +0200, Michal Privoznik wrote:
> Some tests take already prepared domain from previous tests. In
> this case, the domain is freed by the first test that doesn't
> keep the domain. However, if there's no such test case domain is
> leaked.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  tests/qemuhotplugtest.c | 1 +
>  1 file changed, 1 insertion(+)

ACK


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

Re: [libvirt] [PATCH 4/8] qemuDomainObjPrivateFree: Free @machineName

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:32 +0200, Michal Privoznik wrote:
> We're storing the machine name in @priv but free it just in
> qemuProcessStop, Therefore this may leak.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/qemu/qemu_domain.c | 1 +
>  1 file changed, 1 insertion(+)

ACK


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

Re: [libvirt] [PATCH 6/8] virTestCompareToFile: Don't access memory we don't own

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:34 +0200, Michal Privoznik wrote:
> After reading the contents of a file some cleanup is performed.
> However, the check for it might access a byte outside of the
> string - if the file is empty in the first place. Then strlen()
> is zero.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  tests/testutils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/testutils.c b/tests/testutils.c
> index 71692f1fa..4bb6140ec 100644
> --- a/tests/testutils.c
> +++ b/tests/testutils.c
> @@ -796,6 +796,7 @@ virTestCompareToFile(const char *strcontent,
>  goto failure;
>  
>  if (filecontent &&
> +strlen(filecontent) > 0 &&

I'd store the length in a variable ...

>  filecontent[strlen(filecontent) - 1] == '\n' &&

... so that it's not evaluated twice.

>  strcontent[strlen(strcontent) - 1] != '\n') {
>  if (virAsprintf(&fixedcontent, "%s\n", strcontent) < 0)

ACK with that.


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

Re: [libvirt] [PATCH 3/8] virNodeDevCapCCWParseXML: Free temporary variables

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:31 +0200, Michal Privoznik wrote:
> Again, we are using @cssid, @ssid and @devno to store some
> temporary strings, but never free it.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/conf/node_device_conf.c | 3 +++
>  1 file changed, 3 insertions(+)

ACK


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

Re: [libvirt] [PATCH 2/8] virDomainDefParseXML: Free @tmp

2017-08-04 Thread Peter Krempa
On Fri, Aug 04, 2017 at 16:22:30 +0200, Michal Privoznik wrote:
> When parsing  feature we're using @tmp to store some
> temporary string but never free it.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/conf/domain_conf.c | 1 +
>  1 file changed, 1 insertion(+)

ACK


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

Re: [libvirt] [PATCH] rpm: conditionalize dep on perl for perl-interpretor split in F27

2017-08-04 Thread Michal Privoznik
On 08/02/2017 11:52 AM, Daniel P. Berrange wrote:
> Signed-off-by: Daniel P. Berrange 
> ---
>  libvirt.spec.in   | 4 
>  mingw-libvirt.spec.in | 4 
>  2 files changed, 8 insertions(+)
> 
> diff --git a/libvirt.spec.in b/libvirt.spec.in
> index b074bd171..8abecae22 100644
> --- a/libvirt.spec.in
> +++ b/libvirt.spec.in
> @@ -292,7 +292,11 @@ BuildRequires: libtool
>  BuildRequires: /usr/bin/pod2man
>  %endif
>  BuildRequires: git
> +%if 0%{?fedora} >= 27
> +BuildRequires: perl-interpretor

s/interpretor/interpreter/

> +%else
>  BuildRequires: perl
> +%endif
>  BuildRequires: python
>  %if %{with_systemd}
>  BuildRequires: systemd-units
> diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
> index 4efa0ddbf..553d14022 100644
> --- a/mingw-libvirt.spec.in
> +++ b/mingw-libvirt.spec.in
> @@ -59,7 +59,11 @@ BuildRequires:  pkgconfig
>  # Need native version for msgfmt
>  BuildRequires:  gettext
>  BuildRequires:  python
> +%if 0%{?fedora} >= 27
> +BuildRequires:  perl-interpretor

again.

> +%else
>  BuildRequires:  perl
> +%endif
>  BuildRequires:  perl(Getopt::Long)
>  %if 0%{?enable_autotools}
>  BuildRequires: autoconf
> 

ACK with that fixed.

Michal

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


Re: [libvirt] [PATCH 5/8] virVMXParseConfig: Don't leak def->videos

2017-08-04 Thread Michal Privoznik
On 08/04/2017 04:22 PM, Michal Privoznik wrote:
> This function calls virDomainDefAddImplicitDevices() which adds
> implicit video device to domain definition. However, later in the
> process the function just ignores this and overwrites the @videos
> array without prior free.
> 
> Signed-off-by: Michal Privoznik 
> ---
>  src/vmx/vmx.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
> index 96507f10f..858bc090d 100644
> --- a/src/vmx/vmx.c
> +++ b/src/vmx/vmx.c
> @@ -1305,6 +1305,7 @@ virVMXParseConfig(virVMXContext *ctx,
>  long long sharedFolder_maxNum = 0;
>  int cpumasklen;
>  char *namespaceData;
> +size_t i;
>  
>  if (ctx->parseFileName == NULL) {
>  virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
> @@ -1761,11 +1762,13 @@ virVMXParseConfig(virVMXContext *ctx,
>  /* FIXME */
>  
>  /* def:videos */
> -if (VIR_ALLOC_N(def->videos, 1) < 0)
> -goto cleanup;
> -
> +for (i = 0; i < def->nvideos; i++)
> +virDomainVideoDefFree(def->videos[i]);
>  def->nvideos = 0;
>  
> +if (VIR_REALLOC_N(def->videos, 1) < 0)
> +goto cleanup;
> +
>  if (virVMXParseSVGA(conf, &def->videos[def->nvideos]) < 0)
>  goto cleanup;
>  
> 

Oh, forgot to push this into the commit:

diff --git i/src/vmx/vmx.c w/src/vmx/vmx.c
index 858bc090d..d111b1ef1 100644
--- i/src/vmx/vmx.c
+++ w/src/vmx/vmx.c
@@ -3035,7 +3035,7 @@ virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr 
*def)
 int result = -1;
 long long svga_vramSize = 0;
 
-if (def == NULL || *def != NULL) {
+if (def == NULL) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
 return -1;
 }

Consider it squashed in locally.

Michal

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


[libvirt] [PATCH 5/8] virVMXParseConfig: Don't leak def->videos

2017-08-04 Thread Michal Privoznik
This function calls virDomainDefAddImplicitDevices() which adds
implicit video device to domain definition. However, later in the
process the function just ignores this and overwrites the @videos
array without prior free.

Signed-off-by: Michal Privoznik 
---
 src/vmx/vmx.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 96507f10f..858bc090d 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1305,6 +1305,7 @@ virVMXParseConfig(virVMXContext *ctx,
 long long sharedFolder_maxNum = 0;
 int cpumasklen;
 char *namespaceData;
+size_t i;
 
 if (ctx->parseFileName == NULL) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
@@ -1761,11 +1762,13 @@ virVMXParseConfig(virVMXContext *ctx,
 /* FIXME */
 
 /* def:videos */
-if (VIR_ALLOC_N(def->videos, 1) < 0)
-goto cleanup;
-
+for (i = 0; i < def->nvideos; i++)
+virDomainVideoDefFree(def->videos[i]);
 def->nvideos = 0;
 
+if (VIR_REALLOC_N(def->videos, 1) < 0)
+goto cleanup;
+
 if (virVMXParseSVGA(conf, &def->videos[def->nvideos]) < 0)
 goto cleanup;
 
-- 
2.13.0

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


[libvirt] [PATCH 3/8] virNodeDevCapCCWParseXML: Free temporary variables

2017-08-04 Thread Michal Privoznik
Again, we are using @cssid, @ssid and @devno to store some
temporary strings, but never free it.

Signed-off-by: Michal Privoznik 
---
 src/conf/node_device_conf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 82f02fa6c..726bf042c 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -792,6 +792,9 @@ virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt,
 
  out:
 ctxt->node = orignode;
+VIR_FREE(cssid);
+VIR_FREE(ssid);
+VIR_FREE(devno);
 return ret;
 }
 
-- 
2.13.0

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


[libvirt] [PATCH 6/8] virTestCompareToFile: Don't access memory we don't own

2017-08-04 Thread Michal Privoznik
After reading the contents of a file some cleanup is performed.
However, the check for it might access a byte outside of the
string - if the file is empty in the first place. Then strlen()
is zero.

Signed-off-by: Michal Privoznik 
---
 tests/testutils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/testutils.c b/tests/testutils.c
index 71692f1fa..4bb6140ec 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -796,6 +796,7 @@ virTestCompareToFile(const char *strcontent,
 goto failure;
 
 if (filecontent &&
+strlen(filecontent) > 0 &&
 filecontent[strlen(filecontent) - 1] == '\n' &&
 strcontent[strlen(strcontent) - 1] != '\n') {
 if (virAsprintf(&fixedcontent, "%s\n", strcontent) < 0)
-- 
2.13.0

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


[libvirt] [PATCH 2/8] virDomainDefParseXML: Free @tmp

2017-08-04 Thread Michal Privoznik
When parsing  feature we're using @tmp to store some
temporary string but never free it.

Signed-off-by: Michal Privoznik 
---
 src/conf/domain_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 8168dc52f..3cdb5e348 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17892,6 +17892,7 @@ virDomainDefParseXML(xmlDocPtr xml,
 }
 def->ioapic = value;
 def->features[val] = VIR_TRISTATE_SWITCH_ON;
+VIR_FREE(tmp);
 }
 ctxt->node = node;
 break;
-- 
2.13.0

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


[libvirt] [PATCH 4/8] qemuDomainObjPrivateFree: Free @machineName

2017-08-04 Thread Michal Privoznik
We're storing the machine name in @priv but free it just in
qemuProcessStop, Therefore this may leak.

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

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fe27e1122..40608554c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1722,6 +1722,7 @@ qemuDomainObjPrivateFree(void *data)
 virBitmapFree(priv->autoNodeset);
 virBitmapFree(priv->autoCpuset);
 
+VIR_FREE(priv->machineName);
 VIR_FREE(priv->libDir);
 VIR_FREE(priv->channelTargetDir);
 
-- 
2.13.0

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


[libvirt] [PATCH 7/8] qemuhotplugtest: Don't leak @vm

2017-08-04 Thread Michal Privoznik
Some tests take already prepared domain from previous tests. In
this case, the domain is freed by the first test that doesn't
keep the domain. However, if there's no such test case domain is
leaked.

Signed-off-by: Michal Privoznik 
---
 tests/qemuhotplugtest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 79f032690..23a498617 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -855,6 +855,7 @@ mymain(void)
 DO_TEST_CPU_INDIVIDUAL("ppc64-modern-individual", "17", true, true, true);
 
 qemuTestDriverFree(&driver);
+virObjectUnref(data.vm);
 return (ret == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
-- 
2.13.0

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


[libvirt] [PATCH 8/8] virdbustest: Don't leak @out_strv1

2017-08-04 Thread Michal Privoznik
In testMessageSingleArrayRef the string is doubly referenced.
Therefore we have to free also the first pointer to the string.

Signed-off-by: Michal Privoznik 
---
 tests/virdbustest.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index 3be9cf17e..b7ddd7791 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -323,6 +323,7 @@ static int testMessageSingleArrayRef(const void *args 
ATTRIBUTE_UNUSED)
  cleanup:
 if (out_strv1)
 VIR_FREE(out_strv1[0]);
+VIR_FREE(out_strv1);
 virDBusMessageUnref(msg);
 return ret;
 }
-- 
2.13.0

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


[libvirt] [PATCH 0/8] Couple of memleak fixes

2017-08-04 Thread Michal Privoznik
*** BLURB HERE ***

Michal Privoznik (8):
  virDomainDefFree: Don't leak initenv name and value
  virDomainDefParseXML: Free @tmp
  virNodeDevCapCCWParseXML: Free temporary variables
  qemuDomainObjPrivateFree: Free @machineName
  virVMXParseConfig: Don't leak def->videos
  virTestCompareToFile: Don't access memory we don't own
  qemuhotplugtest: Don't leak @vm
  virdbustest: Don't leak @out_strv1

 src/conf/domain_conf.c  | 6 +-
 src/conf/node_device_conf.c | 3 +++
 src/qemu/qemu_domain.c  | 1 +
 src/vmx/vmx.c   | 9 ++---
 tests/qemuhotplugtest.c | 1 +
 tests/testutils.c   | 1 +
 tests/virdbustest.c | 1 +
 7 files changed, 18 insertions(+), 4 deletions(-)

-- 
2.13.0

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


[libvirt] [PATCH 1/8] virDomainDefFree: Don't leak initenv name and value

2017-08-04 Thread Michal Privoznik
When parsing boot options from domain XML in
virDomainDefParseBootOptions() initenv id stored to:

def->os.initenv[i]->name
def->os.initenv[i]->value

But these are never freed.

Signed-off-by: Michal Privoznik 
---
 src/conf/domain_conf.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 640f29d3e..8168dc52f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2931,8 +2931,11 @@ void virDomainDefFree(virDomainDefPtr def)
 for (i = 0; def->os.initargv && def->os.initargv[i]; i++)
 VIR_FREE(def->os.initargv[i]);
 VIR_FREE(def->os.initargv);
-for (i = 0; def->os.initenv && def->os.initenv[i]; i++)
+for (i = 0; def->os.initenv && def->os.initenv[i]; i++) {
+VIR_FREE(def->os.initenv[i]->name);
+VIR_FREE(def->os.initenv[i]->value);
 VIR_FREE(def->os.initenv[i]);
+}
 VIR_FREE(def->os.initdir);
 VIR_FREE(def->os.inituser);
 VIR_FREE(def->os.initgroup);
-- 
2.13.0

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


[libvirt] [PATCH] docs: make website responsive for mobile devices

2017-08-04 Thread Daniel P. Berrange
The website does not look good in a mobile device as the text is
far too small and the layout assumes a wide screen.

Make the style dynanically adapt based on viewport size, so a
mobile device gets a layout more suited to its dimensions.

Signed-off-by: Daniel P. Berrange 
---
 docs/main.css   |  1 +
 docs/mobile.css | 95 +
 docs/page.xsl   | 34 +
 3 files changed, 130 insertions(+)
 create mode 100644 docs/mobile.css

diff --git a/docs/main.css b/docs/main.css
index 95d5d325d..71f7b7a6a 100644
--- a/docs/main.css
+++ b/docs/main.css
@@ -1,3 +1,4 @@
 @import url(fonts/stylesheet.css);
 @import url(generic.css);
 @import url(libvirt.css);
+@import url(mobile.css);
diff --git a/docs/mobile.css b/docs/mobile.css
new file mode 100644
index 0..0fc1e9d71
--- /dev/null
+++ b/docs/mobile.css
@@ -0,0 +1,95 @@
+
+@media (max-width: 1000px) {
+#home {
+   width: 100%;
+   display: block;
+   margin: 0px;
+   background: white url(logos/logo-banner-dark-256.png) no-repeat center 
center;
+   height: 94px;
+}
+#home a {
+   width: 100%;
+}
+#search {
+   width: 100%;
+   display: block;
+   margin: 0px;
+   background: white;
+   padding: 0px;
+}
+#search form {
+   padding: 5px;
+}
+body.index h1 {
+   display: none;
+}
+#jumplinks {
+   padding: 0px;
+   display: block;
+   width: 100%;
+   text-align: center;
+   margin: 0px;
+   height: 1.3em;
+   font-size: 1em;
+   border-top: 3px solid rgb(60, 133, 124);
+   border-bottom: 3px solid rgb(60, 133, 124);
+}
+#jumplinks ul {
+   display: block;
+   padding: 0px;
+   margin: 0px;
+}
+#jumplinks li {
+   margin: 0px;
+   padding-left: 0.5em;
+   padding-right: 0.5em;
+}
+#nav {
+   border: 0px;
+}
+
+#search.navhide {
+   display: none !IMPORTANT;
+}
+#home.navhide {
+   position: fixed;
+   top: 0px;
+   z-index: 9001;  
+   width: 6em;
+   display: block;
+   margin: 0px;
+   background: inherit;
+   height: 1.3em;
+   border-top: 3px solid rgb(60, 133, 124);
+   border-bottom: 3px solid rgb(60, 133, 124);
+   font-size: 1em;
+   text-indent: 0px;
+   font-weight: bold;
+   padding-left: 1em;
+}
+#home.navhide a {
+   color: white;
+   text-decoration: none;
+}
+#home.navhide a:hover {
+   color: rgb(255, 230, 0);
+}
+#jumplinks.navhide {
+   position: fixed;
+   text-align: right;
+   top: 0px;
+   z-index: 9000;
+   background: rgb(0, 95, 97);
+}
+#jumplinks.navhide ul {
+   z-index: 9001;
+}
+#body {
+   margin-top: 180px;
+}
+div.panel {
+   width: 80%;
+   float: none;
+   margin-bottom: 2em;
+}
+}
diff --git a/docs/page.xsl b/docs/page.xsl
index 7ca4e7bf4..0f762be7d 100644
--- a/docs/page.xsl
+++ b/docs/page.xsl
@@ -88,6 +88,7 @@
   
   
 
+
 
 
 
@@ -97,6 +98,39 @@
 libvirt: 
 
 
+
+
+  
+   shrinkOn) {
+  if (home.className != "navhide") {
+  body.className = "navhide"
+  home.className = "navhide"
+  links.className = "navhide"
+  search.className = "navhide"
+  }
+  } else {
+  if (home.className == "navhide") {
+  body.className = ""
+  home.className = ""
+  links.className = ""
+  search.className = ""
+  }
+  }
+  });
+  }
+  window.onload = init();
+   ]]>
+  
+
   
   
 
-- 
2.13.3

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


Re: [libvirt] [PATCH] qemu: Honour

2017-08-04 Thread Michal Privoznik
On 08/03/2017 06:38 PM, Philipp Hahn wrote:
> Hello,
> 
> Am 03.08.2017 um 09:36 schrieb Michal Privoznik:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1476866
>>
>> For some reason, we completely ignore  setting for
>> domains. The implementation is simply not there. It never was.
>> However, things are slightly more complicated. QEMU sends us two
>> RESET events on domain reboot. Fortunately, the event contains
>> this 'guest' field telling us who initiated the reboot. And since
>> we don't want to destroy the domain if the reset is initiated by
>> a user, we have to ignore those events. Whatever, just look at
>> the code.
> 
> White you are at "QEMU reset": From Xen I remember that on reboot a new
> qemu-dm (Device Model) is created - if I remember correctly - for both
> PV and HV.
> For QEMU the old qemu process is reused and the reset is done by SeaBios
> inside the VM. If would be cool if there was an option to kill the old
> qemu process and start a new qemu process (with an updated
> configuration) on reboot.
> I sometimes have the situation where the libvirt part is done by one
> group of admins, while the guest OS and everything within in VM is done
> by some other group of persons. Currently they always have to coordinate
> a time, where the internal group does initiate the guest OS shutdown and
> the libvirt admins then updates the configuration and starts the VM again.
> It would be nice if I could update the config "just now" and then tell
> the OS group "just do the reboot when your schedule permits it - you
> will then get your updates configuration automatically."
> 
> Or is this already there and I missed it?

I think this patch enables exactly that. The VM admins don't start the
domains by hand but probably have some SW that starts configured domains
whenever not running. E.g. if one domain crashes, the mgmt SW starts it
up again. With such SW in place this patch is exactly what's been missing.
Alternatively, we can introduce new  target, say "reinit"
that would kill the qemu process and start a new one instead.

Michal

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