[libvirt] [PATCH 0/1] update copyright notice
by David Kiarie
these patche follows up a very co-operative review on a preview patch or
lack of thereof.
i have updated this to reflect the exact name i use in person.
David Kiarie (1):
src/xenconfig: update copyright notice
src/xenconfig/xen_xl.c | 1 +
src/xenconfig/xen_xl.h | 1 +
tests/xlconfigtest.c | 1 +
3 files changed, 3 insertions(+)
--
2.20.1
5 years, 10 months
[libvirt] [PATCH] qemu: fix memory leak in qemuBuildDiskDeviceStr
by Ján Tomko
Commit a1dce962 added the allocated scsiVPDDeviceId without freeing it.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f511193fca..74f34af292 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1890,7 +1890,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def,
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
const char *contAlias;
char *backendAlias = NULL;
- char *scsiVPDDeviceId = NULL;
+ VIR_AUTOFREE(char *) scsiVPDDeviceId = NULL;
int controllerModel;
if (qemuCheckDiskConfig(disk, qemuCaps) < 0)
--
2.19.2
5 years, 10 months
[libvirt] [PATCH 0/7] Introduce automatic clearing for virBuffer
by Peter Krempa
First 4 patches clean up existing mess.
Note that this series both fixes and then deletes virBufferEscapeN.
The split is deliberate, so that if somebody needs virBufferEscapeN
in the future they can revert the removal and get a working version.
Peter Krempa (7):
util: buffer: Remove misleading AUTOPTR func for 'virBuffer'
util: buf: Fix memory leak in virBufferEscapeN
tests: buf: Fix debug messages in 'testBufEscapeRegex'
util: buf: Remove virBufferEscapeN
util: alloc: Introduce 'VIR_AUTOCLEAN' macros for clearing stack'd
structs
util: buffer: Introduce VIR_AUTOCLEAN function for virBuffer
qemu: domain: Use VIR_AUTOCLEAN for virBuffer
src/libvirt_private.syms | 1 -
src/qemu/qemu_domain.c | 27 +++-------
src/util/viralloc.h | 32 +++++++++++-
src/util/virbuffer.c | 107 ---------------------------------------
src/util/virbuffer.h | 7 ++-
tests/virbuftest.c | 57 +++++----------------
6 files changed, 56 insertions(+), 175 deletions(-)
--
2.20.1
5 years, 10 months
[libvirt] [PATCHv2 0/2] network: add netmask to dhcp range of dnsmasq conf file for IPv4
by Laine Stump
I sent V1 of this patch way back in October:
https://www.redhat.com/archives/libvir-list/2018-October/msg00889.html
but then self-NACKed it because I had written the patch to add the
network prefix to dhcp-range, but IPv4 requires the netmask rather
than range. Unfortunately, when I modified the patch accordingly the
getnameinfo() function began failing, I couldn't immediately see why,
and I had to pack everything up and go to KVM Forum. After that, I
promptly forgot to look back at it.
Today I finally revisited the problem (after the person who originally
found it sent a reminder), and discovered the failure of getnameinfo()
was due to a bug in a function that I added to the virSocketAddr
library in 2010!
Laine Stump (2):
util: set missing data length in virSocketAddrPrefixToNetmask()
network: add netmask to dhcp range of dnsmasq conf file for IPv4
src/network/bridge_driver.c | 27 +++++++++++++++----
src/util/virsocketaddr.c | 2 ++
.../dhcp6-nat-network.conf | 2 +-
.../networkxml2confdata/isolated-network.conf | 2 +-
.../nat-network-dns-srv-record-minimal.conf | 2 +-
.../nat-network-dns-srv-record.conf | 2 +-
.../nat-network-dns-txt-record.conf | 2 +-
.../networkxml2confdata/nat-network-mtu.conf | 2 +-
.../nat-network-name-with-quotes.conf | 2 +-
tests/networkxml2confdata/nat-network.conf | 2 +-
.../networkxml2confdata/netboot-network.conf | 2 +-
.../netboot-proxy-network.conf | 2 +-
.../networkxml2confdata/ptr-domains-auto.conf | 2 +-
13 files changed, 35 insertions(+), 16 deletions(-)
--
2.20.1
5 years, 10 months
[libvirt] [PATCH 0/7] bulk snapshot list/redefine (incremental backup saga)
by Eric Blake
While looking at my work on incremental backups, Nir raised a good
point: if we want to recreate a set of known checkpoints on one
machine that will be taking over a domain from another machine,
my initial proposal required making multiple API calls to list the
XML for each checkpoint on the source, and then more API calls to
redefine each checkpoint on the destination; it also had the drawback
that the list has to be presented in topological order (the API won't
let you define a child checkpoint if the parent is not defined first).
He asked if I could instead add bulk APIs, for getting the XML for
all checkpoints at once, and then for redefining all checkpoints at
once.
Since my checkpoint code borrows heavily from concepts in the snapshot
code, I chose to tackle the problem by starting with this series, which
does the same thing for snapshots as what I plan to do for checkpoints.
That is, since this patch series adds virDomainGetXMLDesc(,
VIR_DOMAIN_XML_SNAPSHOTS) and virDomainSnapshotCreateXML(,
VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST), the checkpoint series
will add virDOmainGetXMLDesc(, VIR_DOMAIN_XML_CHECKPOINTS) and
virDomainCheckpointCreateXML(, VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_LIST)
with very similar code.
Note that I'm posting the series now to start review; the bulk
query is fully implemented (patch 6), while the bulk redefine still
needs more work (patch 7 defines the API, but the actual implementation
is trickier, so I'll be posting additional patches later once I get
them working). Patch 1 is a revision of work posted previously in a
different series where all other patches of that series are now on
mainline. Also available at:
https://repo.or.cz/libvirt/ericb.git/shortlog/refs/tags/snapshot-bulk-v1
Eric Blake (7):
domain: Document VIR_DOMAIN_XML_MIGRATABLE
snapshot: Give virDomainSnapshotDefFormat its own flags
snapshot: Refactor virDomainSnapshotDefFormat
snapshot: Add virDomainSnapshotObjListFormat
domain: Expand virDomainDefFormatInternal with snapshots
domain: Add VIR_DOMAIN_XML_SNAPSHOTS flag
snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST flag
include/libvirt/libvirt-domain-snapshot.h | 3 +
include/libvirt/libvirt-domain.h | 1 +
src/conf/domain_conf.h | 8 ++
src/conf/snapshot_conf.h | 18 ++-
src/conf/domain_conf.c | 71 ++++++++--
src/conf/snapshot_conf.c | 162 ++++++++++++++++------
src/esx/esx_driver.c | 1 -
src/libvirt-domain-snapshot.c | 21 ++-
src/libvirt-domain.c | 14 ++
src/libvirt_private.syms | 2 +
src/network/bridge_driver.c | 3 +-
src/qemu/qemu_domain.c | 24 +++-
src/qemu/qemu_driver.c | 7 +-
src/test/test_driver.c | 10 +-
src/vbox/vbox_common.c | 5 +-
src/vz/vz_driver.c | 3 +-
tests/domainsnapshotxml2xmltest.c | 16 ++-
tools/virsh-domain.c | 7 +
tools/virsh-snapshot.c | 13 ++
19 files changed, 293 insertions(+), 96 deletions(-)
--
2.20.1
5 years, 10 months
[libvirt] [PATCH] snapshot: Saner use of uuid
by Eric Blake
Most of the code base is fairly consistent about using the name
'uuidstr' when dealing with a formatted human-readable form, and
'uuid' when dealing with the smaller raw bytes form. Fix
snapshot_conf to comply, as well as reducing the scope of a human
string to only the error message that needs it.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing this one under the trivial rule.
src/conf/snapshot_conf.h | 2 +-
src/conf/snapshot_conf.c | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index cc25164261..7a175dfc96 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -111,7 +111,7 @@ virDomainSnapshotDefPtr virDomainSnapshotDefParseNode(xmlDocPtr xml,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);
void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def);
-char *virDomainSnapshotDefFormat(const char *domain_uuid,
+char *virDomainSnapshotDefFormat(const char *uuidstr,
virDomainSnapshotDefPtr def,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index 1afc7de30c..489c25f511 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -688,7 +688,7 @@ virDomainSnapshotDiskDefFormat(virBufferPtr buf,
char *
-virDomainSnapshotDefFormat(const char *domain_uuid,
+virDomainSnapshotDefFormat(const char *uuidstr,
virDomainSnapshotDefPtr def,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
@@ -744,10 +744,10 @@ virDomainSnapshotDefFormat(const char *domain_uuid,
if (def->dom) {
if (virDomainDefFormatInternal(def->dom, caps, flags, &buf, xmlopt) < 0)
goto error;
- } else if (domain_uuid) {
+ } else if (uuidstr) {
virBufferAddLit(&buf, "<domain>\n");
virBufferAdjustIndent(&buf, 2);
- virBufferAsprintf(&buf, "<uuid>%s</uuid>\n", domain_uuid);
+ virBufferAsprintf(&buf, "<uuid>%s</uuid>\n", uuidstr);
virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</domain>\n");
}
@@ -1224,11 +1224,8 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
int ret = -1;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true;
- char uuidstr[VIR_UUID_STRING_BUFLEN];
virDomainSnapshotObjPtr other;
- virUUIDFormat(domain->uuid, uuidstr);
-
/* Prevent circular chains */
if (def->parent) {
if (STREQ(def->name, def->parent)) {
@@ -1274,6 +1271,9 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
if (def->dom &&
memcmp(def->dom->uuid, domain->uuid, VIR_UUID_BUFLEN)) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(domain->uuid, uuidstr);
virReportError(VIR_ERR_INVALID_ARG,
_("definition for snapshot %s must use uuid %s"),
def->name, uuidstr);
--
2.20.1
5 years, 10 months
[libvirt] [jenkins-ci PATCH] lcitool: Don't import crypt
by Andrea Bolognani
It hasn't been needed since dbe55924f90d, and flake8 rightfully
complains about that.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
guests/lcitool | 1 -
1 file changed, 1 deletion(-)
diff --git a/guests/lcitool b/guests/lcitool
index 759eff6..e8263da 100755
--- a/guests/lcitool
+++ b/guests/lcitool
@@ -17,7 +17,6 @@
# with this program. If not, see <https://www.gnu.org/licenses/>.
import argparse
-import crypt
import fnmatch
import json
import os
--
2.20.1
5 years, 10 months
[libvirt] libvirt 'make cov' vs gnulib 'make coverage'
by Cole Robinson
Recently I've played with libvirt coverage/gcov/lcov support. The
libvirt specific way to enable it is:
./configure --enable-test-coverage
make check
make cov
firefox coverage/index.html
However it looks like gnulib provides an automagic way to get similar
output. The process is:
make coverage
firefox doc/coverage/index.html
'make coverage' is composed of these 3 additional commands:
make init-coverage # clear lcov counters
make build-coverage # 'make check' with coverage flags, generate
# lcov metadata
make gen-coverage # generate the html report
It seems like we can just drop our custom coverage implementation.
* Less code for us
* The gnulib implementation is more flexible with the split commands
* libvirt impl needs an explicit directory list. right now gnulib output
reports info for the tools/ dir but libvirt's doesn't
* gnulib impl doesn't require a reconfigure
* seems like libvirt impl never calls lcov --zerocounters which AFAICT
means that every 'make check' run adds to the coverage stats. so if
you wanted to check for coverage changes across commits we require a
make clean in between to zero out the stats for testing. gnulib
init-coverage takes care of that.
Anyone know a reason not to rip this out? If not I'll send a patch
Thanks,
Cole
5 years, 10 months
[libvirt] [PATCH v3 00/17] qemu: virtio-{non-}transitional support
by Cole Robinson
v2 libvirt patches:
https://www.redhat.com/archives/libvir-list/2019-January/msg00877.html
v1 libvirt patches:
https://www.redhat.com/archives/libvir-list/2019-January/msg00593.html
Previous incomplete RFC here:
https://www.redhat.com/archives/libvir-list/2019-January/msg00346.html
qemu patches, queued for qemu 4.0.0:
https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00923.html
Previous libvirt discussion around this:
https://www.redhat.com/archives/libvir-list/2018-August/msg01073.html
Changes since v2:
* Some prep patches merged
* filesystem model dropped the -9p naming, now uses virtio-{non-}transitional
like other devices
* Now uses a single capability QEMU_CAPS_VIRTIO_PCI_NON_TRANSITIONAL
which is set whenever any of the -transitional or -non-transitional
devices are present.
* Add a formatdomain section 'Virtio transitional devices' and reference
it from each relevant device section
* if virtio-transitional specified, and qemu is too old but has the
disable_X options, convert it to explicit
disable-legacy=off,disable-modern=off
* Misc small changes pointed out in review
Thanks,
Cole
Cole Robinson (17):
qemu: command: Add qemuCaps to BuildVirtioStr
qemu: capabilities: Add virtio/vhost {non-}transitional
conf: Add <disk model='virtio-{non-}transitional'/>
qemu: Support disk model=virtio-{non-}transitional
qemu: Support interface model=virtio-{non-}transitional
conf: Add <hostdev model='virtio-{non-}transitional'/>
qemu: Support hostdev model=virtio-{non-}transitional
qemu: Support rng model=virtio-{non-}transitional
conf: Add <filesystem model='virtio-{non-}transitional'/>
qemu: Support filesystem model=virtio-{non-}transitional
qemu: Support memballoon model=virtio-{non-}transitional
qemu: Support vsock model=virtio-{non-}transitional
conf: Add <input model='virtio-{non-}transitional'/>
qemu: Support input model=virtio-{non-}transitional
qemu: Support virtio-serial controller model=virtio-{non-}transitional
qemu: Support scsi controller model=virtio-{non-}transitional
qemu: domcaps: Report disk <enum name="model">
docs/formatdomain.html.in | 97 ++++++++-
docs/schemas/domaincommon.rng | 61 +++++-
src/conf/domain_capabilities.c | 1 +
src/conf/domain_capabilities.h | 1 +
src/conf/domain_conf.c | 184 ++++++++++++++++--
src/conf/domain_conf.h | 63 ++++++
src/libvirt_private.syms | 4 +
src/libxl/libxl_conf.c | 2 +
src/qemu/qemu_capabilities.c | 31 +++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 150 ++++++++++++--
src/qemu/qemu_domain.c | 17 +-
src/qemu/qemu_domain_address.c | 110 +++++++++--
src/vbox/vbox_common.c | 2 +
src/vmx/vmx.c | 5 +-
.../bhyve_basic.x86_64.xml | 1 +
.../bhyve_fbuf.x86_64.xml | 1 +
.../bhyve_uefi.x86_64.xml | 1 +
tests/domaincapsschemadata/full.xml | 6 +
.../domaincapsschemadata/libxl-xenfv-usb.xml | 1 +
.../domaincapsschemadata/libxl-xenpv-usb.xml | 1 +
.../qemu_1.7.0.x86_64.xml | 3 +
.../qemu_2.12.0-virt.aarch64.xml | 5 +
.../qemu_2.12.0.ppc64.xml | 5 +
.../qemu_2.12.0.s390x.xml | 5 +
.../qemu_2.12.0.x86_64.xml | 5 +
.../qemu_2.6.0-virt.aarch64.xml | 5 +
.../qemu_2.6.0.aarch64.xml | 5 +
.../domaincapsschemadata/qemu_2.6.0.ppc64.xml | 5 +
.../qemu_2.6.0.x86_64.xml | 5 +
.../domaincapsschemadata/qemu_2.7.0.s390x.xml | 5 +
.../qemu_2.8.0-tcg.x86_64.xml | 5 +
.../domaincapsschemadata/qemu_2.8.0.s390x.xml | 5 +
.../qemu_2.8.0.x86_64.xml | 5 +
.../qemu_2.9.0-q35.x86_64.xml | 5 +
.../qemu_2.9.0-tcg.x86_64.xml | 5 +
.../qemu_2.9.0.x86_64.xml | 5 +
.../domaincapsschemadata/qemu_3.0.0.s390x.xml | 5 +
.../qemu_4.0.0.x86_64.xml | 153 +++++++++++++++
tests/domaincapstest.c | 4 +
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
.../virtio-non-transitional.x86_64-3.1.0.args | 65 +++++++
...virtio-non-transitional.x86_64-latest.args | 62 ++++++
.../virtio-non-transitional.xml | 39 ++++
.../virtio-transitional.x86_64-3.1.0.args | 56 ++++++
.../virtio-transitional.x86_64-latest.args | 52 +++++
.../qemuxml2argvdata/virtio-transitional.xml | 39 ++++
tests/qemuxml2argvtest.c | 6 +
.../virtio-non-transitional.xml | 121 ++++++++++++
.../virtio-transitional.xml | 80 ++++++++
tests/qemuxml2xmltest.c | 17 ++
53 files changed, 1470 insertions(+), 50 deletions(-)
create mode 100644 tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-3.1.0.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-non-transitional.xml
create mode 100644 tests/qemuxml2xmloutdata/virtio-transitional.xml
--
2.20.1
5 years, 10 months
[libvirt] [PATCH 0/2] udev: Remove udev handle from main loop when udev thread stops
by Marc Hartmayer
Changelog:
+ RFC -> v1:
- Remove the event handle in the error path of nodeStateInitializeEnumerate
- Added patch 2: wake up udev thread in case of an error
Marc Hartmayer (2):
udev: nodeStateInitializeEnumerate: remove watch handle in case of an
error
udev: wake up the udev thread for stopping it
src/node_device/node_device_udev.c | 3 +++
1 file changed, 3 insertions(+)
--
2.17.0
5 years, 10 months