[libvirt] [PATCH] maint: update to latest gnulib
by Eric Blake
* .gnulib: Update to latest.
---
I'm not sure if any of these are essential for libvirt, but it's
probably nicer to pick up these fixes before the release than to
find out after the release that we wish we had them.
* .gnulib a6b16b6...da1717b (63):
> Doc about crypt functions.
> gc: Fix copyright header.
> pthread: Determine $(LIB_PTHREAD) correctly on OSF/1 5.1.
> openat: Work around compilation error with OSF/1 5.1 DTK cc.
> Revert last commit.
> openat: Work around compilation error with OSF/1 5.1 DTK cc.
> parse-datetime: document the newly accepted format
> autoupdate
> acl: Fix a test failure on newer Solaris 10 with ZFS.
> acl: Update for AIX >= 5.3 with NFS.
> acl: Fix a test failure on AIX >= 5.3 with NFS.
> acl: Fix a test failure on IRIX 6.5 with NFS.
> openat: port to AIX 7.1 with large files
> acl: Avoid errors on NonStop Kernel.
> acl: Clean up Solaris code.
> acl: Fix a bug with NFSv4 ACLs on Solaris 10 (newer version).
> acl: Improve support of NFSv4 ACLs on Solaris 10 (newer version).
> copy-file: Try unit tests on more file systems.
> acl: Try unit tests on more file systems.
> acl: Remove unused code in last commit.
> acl: Improve support of NFSv4 ACLs on Solaris 10 (newer version).
> openat: test for fstatat (..., 0) bug
> openat: test for fstatat (AT_FDCWD, ..., 0) bug
> avoid literal : in index entries
> Allow the user to override the choice of AR, ARFLAGS, RANLIB.
> Find 'ar' program that fits with --host argument.
> tests: init.sh: Support any non-GNU diff.
> tests: init.sh: work also with any non-GNU diff that supports -u
> strtoimax, strtoumax: Document problem on HP-UX 11.
> strtoumax: Avoid link error on OSF/1 with DTK cc.
> strtoimax: Avoid link error on OSF/1 with DTK cc.
> imaxdiv: Avoid link error on OSF/1 with DTK cc.
> imaxabs: Avoid link error on OSF/1 with DTK cc.
> Tests for module 'strtoumax'.
> Tests for module 'strtoimax'.
> Tests for module 'imaxdiv'.
> Tests for module 'imaxabs'.
> pthread: Determine $(LIB_PTHREAD) correctly on IRIX 6.5.
> * lib/fstatat.c: Include <sys/types.h> before <sys/stat.h>.
> openat: work around AIX 7.1 fstatat issue
> sys_select: Avoid a syntax error regarding timespec_t on IRIX 6.5.
> tests: avoid spurious assertion failure in test-float.c on ppc64
> maint: indent with spaces, not TABs
> test-parse-datetime.c: accommodate a relatively strict gcc warning
> parse-datetime: accept ISO 8601 date and time rep with "T" separator
> freopen: Documentation.
> freopen: Don't crash if the filename argument is NULL.
> openat: work around AIX 7.1 fstatat bug
> Avoid endless recursions if config.h includes some header files.
> autoupdate ylwrap
> autoupdate ylwrap
> autoupdate
> tmpdir: Use a good default directory on native Windows.
> autoupdate
> doc: fix typo in README-release
> fts: do not exhaust memory when processing million-entry directories
> maint: fts: move decl of `dp' down into while loop; split a long line
> fts: add/use new struct member, fts_dirp
> maint: fts: give __opendir2 a new parameter and rename
> maint: fts.c: remove __opendir2's now-unused parameter, oflag
> maint: fts.c: correct off-by-one indentation
> maint: fts.c: move __opendir2 #define "up" out of function body
> maint: fts.c: remove #if-0'd FTS_WHITEOUT code
.gnulib | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/.gnulib b/.gnulib
index a6b16b6..da1717b 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit a6b16b69fe1cad695b270dd5bf3deb2850fc4dd1
+Subproject commit da1717b7f93b77469f980ea5e13178e4e9e7ae09
--
1.7.4.4
13 years, 2 months
[libvirt] [PATCH 0/2] snapshot: add getName API
by Eric Blake
I know I've missed the 0.9.5 RC1 freeze, but think that this
new API is worth adding, if only because I noticed that
'virsh snapshot-create dom --no-metadata' currently creates
a snapshot with a generated name but then fails in attempting
to express that name to the user.
Eric Blake (2):
snapshot: new APIs for inspecting snapshot object
snapshot: use new API for less work
include/libvirt/libvirt.h.in | 4 ++
src/libvirt.c | 73 ++++++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 5 ++-
tools/virsh.c | 41 +++++------------------
4 files changed, 90 insertions(+), 33 deletions(-)
--
1.7.4.4
13 years, 2 months
[libvirt] [PATCH] Don't treat pci_system_init failure as fatal if no PCI bus is present
by Soren Hansen
Xen PV domU's have no PCI bus. node_device_udev.c calls pci_system_init
which looks for /sys/bus/pci. If it does not find /sys/bus/pci (which it
won't in a Xen PV domU) it returns unsuccesfully (ENOENT), which libvirt
considers fatal. This makes libvirt unusable in this environment, even
though there are plenty of valid virtualisation options that work
there (LXC, UML, and QEmu spring to mind)
https://bugzilla.redhat.com/show_bug.cgi?id=709471
Signed-off-by: Soren Hansen <soren(a)linux2go.dk>
---
src/node_device/node_device_udev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index badf241..08ef856 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1620,7 +1620,7 @@ static int udevDeviceMonitorStartup(int privileged)
/* Ignore failure as non-root; udev is not as helpful in that
* situation, but a non-privileged user won't benefit much
* from udev in the first place. */
- if (privileged || errno != EACCES) {
+ if (errno != ENOENT && (privileged || errno != EACCES)) {
char ebuf[256];
VIR_ERROR(_("Failed to initialize libpciaccess: %s"),
virStrerror(pciret, ebuf, sizeof ebuf));
--
1.7.5.4
13 years, 2 months
[libvirt] [PATCH rfc] xml: Change virtual file names of xml documents parsed in memory
by Peter Krempa
While parsing XML strings from memory, the previous convention in
libvirt was to set the virtual file name to "domain.xml" or something
similar. This could potentialy trick the user into looking for a file
named domain.xml on the disk in an attempt to fix the error.
This patch changes these filenames to something that can't be as easily
confused for a valid filename.
---
For the request for comments:
Shoud we use translation macros around these filename strings? It might be possible
to translate these messages in something meaningful in other languages.
Thanks for your comments.
Peter
src/conf/domain_conf.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
tools/virsh.c | 27 ++++++++++++++-------------
3 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 74f8d6a..bc04732 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -7461,7 +7461,7 @@ virDomainDefParse(const char *xmlStr,
xmlDocPtr xml;
virDomainDefPtr def = NULL;
- if ((xml = virXMLParse(filename, xmlStr, "domain.xml"))) {
+ if ((xml = virXMLParse(filename, xmlStr, "DOMAIN_DEFINITION_XML"))) {
def = virDomainDefParseNode(caps, xml, xmlDocGetRootElement(xml),
expectedVirtTypes, flags);
xmlFreeDoc(xml);
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index bb577d3..e460845 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -641,7 +641,7 @@ caps_mockup(vahControl * ctl, const char *xmlStr)
xmlDocPtr xml = NULL;
xmlXPathContextPtr ctxt = NULL;
- if (!(xml = virXMLParseStringCtxt(xmlStr, "domain.xml", &ctxt))) {
+ if (!(xml = virXMLParseStringCtxt(xmlStr, "DOMAIN_DEFINITION_XML", &ctxt))) {
goto cleanup;
}
diff --git a/tools/virsh.c b/tools/virsh.c
index 629233f..2da83d0 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1309,7 +1309,7 @@ cmdDomIfSetLink (vshControl *ctl, const vshCmd *cmd)
flags = VIR_DOMAIN_AFFECT_CONFIG;
/* extract current network device description */
- xml = virXMLParseStringCtxt(desc, "domain configuration", &ctxt);
+ xml = virXMLParseStringCtxt(desc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(desc);
if (!xml) {
vshError(ctl, _("Failed to parse domain description xml"));
@@ -1457,7 +1457,7 @@ cmdDomIfGetLink (vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- xml = virXMLParseStringCtxt(desc, "domain configuration", &ctxt);
+ xml = virXMLParseStringCtxt(desc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(desc);
if (!xml) {
vshError(ctl, _("Failed to parse domain description xml"));
@@ -1666,7 +1666,7 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
if (!xml)
goto cleanup;
- xmldoc = virXMLParseStringCtxt(xml, "domain.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, "DOMAIN_DEFINITION_XML", &ctxt);
if (!xmldoc)
goto cleanup;
@@ -3496,7 +3496,7 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- xml = virXMLParseStringCtxt(cap_xml, "node.xml", &ctxt);
+ xml = virXMLParseStringCtxt(cap_xml, "CAPABILITIES_XML", &ctxt);
if (!xml) {
vshError(ctl, "%s", _("unable to get node capabilities"));
goto cleanup;
@@ -9036,7 +9036,8 @@ cleanup:
}
static xmlChar *
-makeCloneXML(const char *origxml, const char *newname) {
+makeCloneXML(const char *origxml, const char *newname)
+{
xmlDocPtr doc = NULL;
xmlXPathContextPtr ctxt = NULL;
@@ -9044,7 +9045,7 @@ makeCloneXML(const char *origxml, const char *newname) {
xmlChar *newxml = NULL;
int size;
- doc = virXMLParseStringCtxt(origxml, "domain.xml", &ctxt);
+ doc = virXMLParseStringCtxt(origxml, "VOLUME_DEFINITION_XML", &ctxt);
if (!doc)
goto cleanup;
@@ -10835,7 +10836,7 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(doc);
if (!xml)
goto cleanup;
@@ -10903,7 +10904,7 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(doc);
if (!xml)
goto cleanup;
@@ -11290,7 +11291,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(doc);
if (!xml) {
vshError(ctl, "%s", _("Failed to get interface information"));
@@ -11757,7 +11758,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
if (!doc)
goto cleanup;
- xml = virXMLParseStringCtxt(doc, "domain.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, "DOMAIN_DEFINITION_XML", &ctxt);
VIR_FREE(doc);
if (!xml) {
vshError(ctl, "%s", _("Failed to get disk information"));
@@ -12908,7 +12909,7 @@ cmdSnapshotCurrent(vshControl *ctl, const vshCmd *cmd)
xmlDocPtr xmldoc = NULL;
xmlXPathContextPtr ctxt = NULL;
- xmldoc = virXMLParseStringCtxt(xml, "domainsnapshot.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, "DOMAIN_SNAPSHOT_XML", &ctxt);
if (!xmldoc)
goto cleanup;
@@ -13050,7 +13051,7 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
if (!doc)
continue;
- xml = virXMLParseStringCtxt(doc, "domainsnapshot.xml", &ctxt);
+ xml = virXMLParseStringCtxt(doc, "DOMAIN_SNAPSHOT_XML", &ctxt);
if (!xml)
continue;
@@ -13211,7 +13212,7 @@ cmdSnapshotParent(vshControl *ctl, const vshCmd *cmd)
if (!xml)
goto cleanup;
- xmldoc = virXMLParseStringCtxt(xml, "domainsnapshot.xml", &ctxt);
+ xmldoc = virXMLParseStringCtxt(xml, "DOMAIN_SNAPSHOT_XML", &ctxt);
if (!xmldoc)
goto cleanup;
--
1.7.3.4
13 years, 2 months
[libvirt] [PATCH] doc: fix incorrect option in send-key
by ajia@redhat.com
From: Alex Jia <ajia(a)redhat.com>
* tools/virsh.pod: fix a option typo of send-key section.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
tools/virsh.pod | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index d826997..e82567d 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -356,7 +356,7 @@ The numeric values are those defined by the OS-X keyboard input
subsystem. The symbolic names match the corresponding OS-X key
constant macro names
-=item B<xtkbd>
+=item B<xt_kbd>
The numeric values are those defined by the Linux KBD device.
These are a variant on the original XT codeset, but often with
--
1.7.1
13 years, 2 months
[libvirt] [PATCH] virsh: fix typo in opts_send_key
by ajia@redhat.com
From: Alex Jia <ajia(a)redhat.com>
* tools/virsh.c: millseconds should be milliseconds in opts_send_key.
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
tools/virsh.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 0f00463..cf3e816 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -4301,7 +4301,7 @@ static const vshCmdOptDef opts_send_key[] = {
{"codeset", VSH_OT_STRING, VSH_OFLAG_REQ_OPT,
N_("the codeset of keycodes, default:linux")},
{"holdtime", VSH_OT_INT, VSH_OFLAG_REQ_OPT,
- N_("the time (in millseconds) how long the keys will be held")},
+ N_("the time (in milliseconds) how long the keys will be held")},
{"keycode", VSH_OT_ARGV, VSH_OFLAG_REQ, N_("the key code")},
{NULL, 0, 0, NULL}
};
--
1.7.1
13 years, 2 months
[libvirt] [PATCH 1/2] tests: avoid memory leak on testTLSSessionInit
by ajia@redhat.com
* tests/virnettlscontexttest: fix memory leak on virnettlscontext test case.
* Detected in valgrind run:
==25667==
==25667== 86,651 (34,680 direct, 51,971 indirect) bytes in 10 blocks are
definitely lost in loss record 350 of 351
==25667== at 0x4005447: calloc (vg_replace_malloc.c:467)
==25667== by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
==25667== by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
==25667== by 0x804DD24: testTLSSessionInit (virnettlscontexttest.c:624)
==25667== by 0x804F14D: virtTestRun (testutils.c:140)
==25667==
==25667== 100,578 (38,148 direct, 62,430 indirect) bytes in 11 blocks are
definitely lost in loss record 351 of 351
==25667== at 0x4005447: calloc (vg_replace_malloc.c:467)
==25667== by 0x4F1F515D: gnutls_init (gnutls_state.c:270)
==25667== by 0x8053432: virNetTLSSessionNew (virnettlscontext.c:1181)
==25667== by 0x804DD3C: testTLSSessionInit (virnettlscontexttest.c:625)
==25667== by 0x804F14D: virtTestRun (testutils.c:140)
* How to reproduce?
% cd libvirt && ./configure && make && make -C tests valgrind
or
% valgrind -v --leak-check=full ./tests/virnettlscontexttest
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
tests/virnettlscontexttest.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index ee7b6b4..ece611a 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -712,6 +712,8 @@ static int testTLSSessionInit(const void *opaque)
cleanup:
virNetTLSContextFree(serverCtxt);
virNetTLSContextFree(clientCtxt);
+ virNetTLSSessionFree(serverSess);
+ virNetTLSSessionFree(clientSess);
gnutls_x509_crt_deinit(data->careq.crt);
if (data->othercareq.filename)
gnutls_x509_crt_deinit(data->othercareq.crt);
--
1.7.5.1
13 years, 2 months
[libvirt] [PATCH] libxl: avoid a dereference of a null pointer
by ajia@redhat.com
Variable 'l_disk' initialized to a null pointer value, control jumps to 'case
VIR_DOMAIN_DISK_DEVICE_DISK and then taking false branch, Within the expansion
of the macro 'libxlError': Field access results in a dereference of a null
pointer (loaded from variable 'l_disk').
* src/libxl/libxl_driver.c: Field access results in a dereference of a null
pointer (loaded from variable 'l_disk')
Signed-off-by: Alex Jia <ajia(a)redhat.com>
---
src/libxl/libxl_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 91da438..bbc3059 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3016,7 +3016,7 @@ libxlDomainDetachDeviceDiskLive(libxlDomainObjPrivatePtr priv,
} else {
libxlError(VIR_ERR_CONFIG_UNSUPPORTED,
_("disk bus '%s' cannot be hot unplugged."),
- virDomainDiskBusTypeToString(l_disk->bus));
+ virDomainDiskBusTypeToString(dev->data.disk->bus));
}
break;
default:
--
1.7.5.1
13 years, 2 months
[libvirt] [PATCH] qemu: Search for disk in qemuDomainGetBlockInfo
by Michal Privoznik
The commit 89b6284fd94ce5b13ee6b002f9167f5d9074aa7a caused regression.
Although we now allow users to input e.g. 'hda' instead of whole path,
we still need to search for appropriate disk in VM definition.
---
src/qemu/qemu_driver.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1925ba5..fec4eeb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7755,6 +7755,7 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
virStorageFileMetadata *meta = NULL;
virDomainDiskDefPtr disk = NULL;
struct stat sb;
+ int i;
int format;
const char *actual;
@@ -7785,6 +7786,21 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
}
path = actual;
+ /* Check the path belongs to this domain. */
+ for (i = 0 ; i < vm->def->ndisks ; i++) {
+ if (vm->def->disks[i]->src != NULL &&
+ STREQ (vm->def->disks[i]->src, path)) {
+ disk = vm->def->disks[i];
+ break;
+ }
+ }
+
+ if (!disk) {
+ qemuReportError(VIR_ERR_INVALID_ARG,
+ _("invalid path %s not assigned to domain"), path);
+ goto cleanup;
+ }
+
/* The path is correct, now try to open it and get its size. */
fd = open(path, O_RDONLY);
if (fd == -1) {
--
1.7.3.4
13 years, 2 months
[libvirt] [PATCH] esx: Fix managed object lookup with optional occurrence
by Matthias Bolte
Exit early if managed object is not found, instead of dereferencing
a NULL pointer and triggering a segfault.
---
src/esx/esx_vi.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 5c8d79e..f4033eb 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -3964,7 +3964,7 @@ esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersio
#define ESX_VI__TEMPLATE__LOOKUP(_type, _complete_properties, \
- _cast_from_anytype) \
+ _cast_from_anytype) \
int \
esxVI_Lookup##_type(esxVI_Context *ctx, const char* name /* optional */, \
esxVI_ManagedObjectReference *root, \
@@ -3999,6 +3999,12 @@ esxVI_ProductVersionToDefaultVirtualHWVersion(esxVI_ProductVersion productVersio
goto cleanup; \
} \
\
+ if (objectContent == NULL) { \
+ /* not found, exit early */ \
+ result = 0; \
+ goto cleanup; \
+ } \
+ \
if (esxVI_##_type##_Alloc(ptrptr) < 0) { \
goto cleanup; \
} \
--
1.7.4.1
13 years, 2 months