[libvirt] [PATCH 0/6] Add support for storage pool state XML
by Erik Skultety
Patches add necessary changes to add support for storage pool state XMLs
and thus resolve https://bugzilla.redhat.com/show_bug.cgi?id=1177733
Erik Skultety (6):
conf: Introduce virStoragePoolDefFormatBuf
conf: Introduce virStoragePoolSaveXML
conf: Introduce virStoragePoolSaveState
storage: Add support for storage pool state XML
conf: Introduce virStoragePoolLoadAllState && virStoragePoolLoadState
storage: Introduce storagePoolUpdateAllState function
src/conf/storage_conf.c | 233 ++++++++++++++++++++++++++++++++++++-------
src/conf/storage_conf.h | 12 ++-
src/libvirt_private.syms | 2 +
src/storage/storage_driver.c | 188 +++++++++++++++++++++++++++-------
4 files changed, 358 insertions(+), 77 deletions(-)
--
1.9.3
9 years, 7 months
[libvirt] [PATCH] hostdev: Report the domain name for used hostdevs during nodedev-detach
by Shivaprasad G Bhat
The nodedev-detach can report the name of the domain using the device
just the way nodedev-reattach does it.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/util/virhostdev.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 23365a3..55eb9c9 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -1519,11 +1519,18 @@ int
virHostdevPCINodeDeviceDetach(virHostdevManagerPtr hostdev_mgr,
virPCIDevicePtr pci)
{
+ virPCIDeviceAddressPtr devAddr = NULL;
int ret = -1;
virObjectLock(hostdev_mgr->activePCIHostdevs);
virObjectLock(hostdev_mgr->inactivePCIHostdevs);
+ if (!(devAddr = virPCIDeviceGetAddress(pci)))
+ goto out;
+
+ if (virHostdevIsPCINodeDeviceUsed(devAddr, hostdev_mgr))
+ goto out;
+
if (virPCIDeviceDetach(pci, hostdev_mgr->activePCIHostdevs,
hostdev_mgr->inactivePCIHostdevs) < 0) {
goto out;
9 years, 7 months
[libvirt] [PATCH 0/3] Fix couple of memleaks
by Michal Privoznik
*** BLURB HERE ***
Michal Privoznik (3):
qemuSetupCgroupForVcpu: Fix memleak
virDomainVirtioSerialAddrSetFree: Fix memleak
virQEMUDriverGetConfig: Fix memleak
src/conf/domain_addr.c | 1 +
src/qemu/qemu_cgroup.c | 8 ++++---
src/qemu/qemu_command.c | 5 ++++-
src/qemu/qemu_domain.c | 58 +++++++++++++++++++++++--------------------------
4 files changed, 37 insertions(+), 35 deletions(-)
--
2.0.5
9 years, 7 months
[libvirt] [libvirt-cmdref PATCH] Adding Documentation for cd
by Swaathi Ramesh
The documentation for command cd did not have information about the command. Added the required information.
---
source/cd.xml | 38 ++++++++++++++++++++++++++++++++++----
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/source/cd.xml b/source/cd.xml
index 78a13df..d15c74c 100644
--- a/source/cd.xml
+++ b/source/cd.xml
@@ -9,16 +9,46 @@
</text>
</description>
- <options />
+ <options>
+ <parameter requirement="optional">
+ <keyword requirement="optional">--dir</keyword>
+ <value type="string" requirement="optional">path</value>
+ <description>
+ <text>
+ directory to switch to (default: home or else root)
+ </text>
+ <text>
+ --dir itself is optional
+ </text>
+ </description>
+ </parameter>
+ </options>
<availability from="0.7.0" />
<notes />
- <examples type="usage" />
+ <examples type="usage" >
+ <example>
+ <terminal>
+virsh # <bold> cd </bold> <value>/tmp</value> </terminal>
+ <text>
+ Changes the current working directory to <value> /tmp </value>
+ </text>
+ </example>
+ </examples>
<examples type="fullcontext" />
- <reference type="seealso" />
-
+ <reference type="seealso" >
+ <item>
+ <link type="internal" href="pwd"/>
+ <name>
+ pwd
+ </name>
+ <description>
+ Displays the current directory
+ </description>
+ </item>
+ </reference>
</command>
--
1.9.1
9 years, 7 months
[libvirt] [PATCH] virsh: Improve change-media success message
by Cole Robinson
$ sudo virsh change-media f19 hdc /mnt/data/devel/media/Fedora-16-x86_64-Live-KDE.iso
succeeded to complete action update on media
Change the message to:
Successfully {inserted,ejected,changed} media.
https://bugzilla.redhat.com/show_bug.cgi?id=967946
---
tools/virsh-domain.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 020a308..928360c 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -12295,6 +12295,7 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
bool ret = false;
vshUpdateDiskXMLType update_type;
const char *action = NULL;
+ const char *success_msg = NULL;
bool config = vshCommandOptBool(cmd, "config");
bool live = vshCommandOptBool(cmd, "live");
bool current = vshCommandOptBool(cmd, "current");
@@ -12314,16 +12315,19 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
if (eject) {
update_type = VSH_UPDATE_DISK_XML_EJECT;
action = "eject";
+ success_msg = _("Successfully ejected media.");
}
if (insert) {
update_type = VSH_UPDATE_DISK_XML_INSERT;
action = "insert";
+ success_msg = _("Successfully inserted media.");
}
if (update || (!eject && !insert)) {
update_type = VSH_UPDATE_DISK_XML_UPDATE;
action = "update";
+ success_msg = _("Successfully updated media.");
}
VSH_EXCLUSIVE_OPTIONS_VAR(current, live);
@@ -12367,7 +12371,7 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- vshPrint(ctl, _("succeeded to complete action %s on media\n"), action);
+ vshPrint(ctl, "%s", success_msg);
}
ret = true;
--
2.3.4
9 years, 7 months
[libvirt] RFC: whether or not to support multiple IDE controllers (and any IDE at all on Q35)
by Laine Stump
Due to a bug report by someone trying to add two cd drives to a Q35
domain in virt-manager (which assumes all CD drives are IDE), I've
learned that libvirt doesn't support adding a "piix3-ide" controller
when there is no ide controller for the domain (or when there are more
than 4 disk devices that need to be connected to an IDE controller). It
does dutifully add:
<controller type='ide' index='n'/>
as many times as necessary, it's just that there is no code behind that
to add the device to the qemu commandline.
I first thought I should add support for this, but then had second
thoughts after following this reasoning:
1) I'm not sure exactly where the piix3-ide controller was added to
qemu, but it was apparently sometime after qemu-1.2.0 (at least
according to tests/qemuhelpdata/qemu-1.2.0-device).
2) At some point (again not sure, but it was there at least in qemu 1.0)
support for a SATA controller was added (named ich9-achi by qemu), and
it can also accept CD devices. So there is no version of qemu that has
piix3-ide and no ich9-ahci.
3) "ide old, ahci new"
4) I'm doubtful there is any OS old enough to require an IDE disk
controller rather than SATA that anyone would also want to put > 4 disk
devices on.
That leads me to think that maybe it is a better idea to just log an
error if someone tries to add a disk with bus='ide' on a Q35 domain, or
add more than 4 of them on an i440fx domain.
Does anyone have an opinion, or (better yet) a smoking gun (e.g.
problems with piix3-ide, or alternately problems with ahci or a
situation where IDE would be required) that will force action in one
direction or the other?
(One possible example - although ahci was added on or before qemu 1.0,
up until the most recent upstream it wasn't possible to migrate or save
a domain with an ahci controller. Do we need to worry about people with
qemu < 2.3.0 that want > 4 IDE devices? Or should we figure that if none
have come up before now, likely none will come up in the future either?)
9 years, 7 months
[libvirt] [PATCH] libvirt: virsh: Kill all uses of __FUNCTION__ in error messages
by Noella Ashu
The error output of snapshot-revert should be more friendly. There is no
need to show up virDomainRevertToSnapshot to user. virError already includes
__FUNCTION__ information in a separate member of the struct, so repeating
it in the message is redundant and leads to situations where higher level
code ends up reporting the lower level name We correctly converted the
error output making it more succinct and user-friendly.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1086726
---
src/libvirt-domain-snapshot.c | 30 +++----
src/libvirt-domain.c | 201 ++++++++++++++++++------------------------
2 files changed, 96 insertions(+), 135 deletions(-)
diff --git a/src/libvirt-domain-snapshot.c b/src/libvirt-domain-snapshot.c
index 9feb669..ac858ba 100644
--- a/src/libvirt-domain-snapshot.c
+++ b/src/libvirt-domain-snapshot.c
@@ -222,26 +222,20 @@ virDomainSnapshotCreateXML(virDomainPtr domain,
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT) &&
!(flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE)) {
- virReportInvalidArg(flags,
- _("use of 'current' flag in %s requires "
- "'redefine' flag"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("use of 'current' flag in requires 'redefine' flag"));
goto error;
}
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) &&
(flags & VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA)) {
- virReportInvalidArg(flags,
- _("'redefine' and 'no metadata' flags in %s are "
- "mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("'redefine' and 'no metadata' flags in are mutually exclusive"));
goto error;
}
if ((flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE) &&
(flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT)) {
- virReportInvalidArg(flags,
- _("'redefine' and 'halt' flags in %s are mutually "
- "exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("'redefine' and 'halt' flags are mutually exclusive"));
goto error;
}
@@ -1084,10 +1078,8 @@ virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
if ((flags & VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING) &&
(flags & VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED)) {
- virReportInvalidArg(flags,
- _("running and paused flags in %s are mutually "
- "exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("running and paused flags are mutually exclusive"));
goto error;
}
@@ -1146,10 +1138,8 @@ virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
if ((flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN) &&
(flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)) {
- virReportInvalidArg(flags,
- _("children and children_only flags in %s are "
- "mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("children and children_only flags are mutually exclusive"));
goto error;
}
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 8b5f91e..e0be331 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -385,9 +385,7 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
virCheckNonNullArgGoto(uuidstr, error);
if (virUUIDParse(uuidstr, uuid) < 0) {
- virReportInvalidArg(uuidstr,
- _("uuidstr in %s must be a valid UUID"),
- __FUNCTION__);
+ virReportInvalidArg(uuidstr, "%s", _("Invalid UUID"));
goto error;
}
@@ -1440,9 +1438,9 @@ virDomainScreenshot(virDomainPtr domain,
virCheckReadOnlyGoto(domain->conn->flags, error);
if (domain->conn != stream->conn) {
- virReportInvalidArg(stream,
- _("stream in %s must match connection of domain '%s'"),
- __FUNCTION__, domain->name);
+ virReportInvalidArg(stream, "%s",
+ _("stream must match connection of domain '%s'"),
+ domain->name);
goto error;
}
@@ -2179,10 +2177,8 @@ virDomainGetMemoryParameters(virDomainPtr domain,
/* At most one of these two flags should be set. */
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' are mutually exclusive"));
goto error;
}
conn = domain->conn;
@@ -2423,10 +2419,8 @@ virDomainGetBlkioParameters(virDomainPtr domain,
/* At most one of these two flags should be set. */
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' are mutually exclusive"));
goto error;
}
conn = domain->conn;
@@ -3343,9 +3337,8 @@ virDomainMigratePeer2PeerFull(virDomainPtr domain,
if (!(tempuri = virURIParse(dconnuri)))
return -1;
if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
- virReportInvalidArg(dconnuri,
- _("unable to parse server from dconnuri in %s"),
- __FUNCTION__);
+ virReportInvalidArg(dconnuri, "%s",
+ _("unable to parse server from dconnuri"));
virURIFree(tempuri);
return -1;
}
@@ -3580,10 +3573,9 @@ virDomainMigrate(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
- _("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'shared disk' and 'shared incremental'"
+ " are mutually exclusive"));
goto error;
}
@@ -3809,10 +3801,9 @@ virDomainMigrate2(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
+ virReportInvalidArg(flags, "%s",
_("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ "are mutually exclusive"));
goto error;
}
@@ -3989,10 +3980,9 @@ virDomainMigrate3(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
+ virReportInvalidArg(flags, "%s",
_("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ "are mutually exclusive"));
goto error;
}
if (flags & VIR_MIGRATE_PEER2PEER) {
@@ -4212,10 +4202,9 @@ virDomainMigrateToURI(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
+ virReportInvalidArg(flags, "%s",
_("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ "are mutually exclusive"));
goto error;
}
@@ -4372,10 +4361,9 @@ virDomainMigrateToURI2(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
+ virReportInvalidArg(flags, "%s",
_("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ "are mutually exclusive"));
goto error;
}
@@ -4481,10 +4469,9 @@ virDomainMigrateToURI3(virDomainPtr domain,
if (flags & VIR_MIGRATE_NON_SHARED_DISK &&
flags & VIR_MIGRATE_NON_SHARED_INC) {
- virReportInvalidArg(flags,
+ virReportInvalidArg(flags, "%s",
_("flags 'shared disk' and 'shared incremental' "
- "in %s are mutually exclusive"),
- __FUNCTION__);
+ "are mutually exclusive"));
goto error;
}
@@ -4791,9 +4778,8 @@ virDomainMigratePrepareTunnel(virConnectPtr conn,
virCheckReadOnlyGoto(conn->flags, error);
if (conn != st->conn) {
- virReportInvalidArg(conn,
- _("conn in %s must match stream connection"),
- __FUNCTION__);
+ virReportInvalidArg(conn, "%s",
+ _("conn must match stream connection"));
goto error;
}
@@ -4937,9 +4923,8 @@ virDomainMigratePrepareTunnel3(virConnectPtr conn,
virCheckReadOnlyGoto(conn->flags, error);
if (conn != st->conn) {
- virReportInvalidArg(conn,
- _("conn in %s must match stream connection"),
- __FUNCTION__);
+ virReportInvalidArg(conn, "%s",
+ _("conn must match stream connection"));
goto error;
}
@@ -5221,8 +5206,7 @@ virDomainMigratePrepareTunnel3Params(virConnectPtr conn,
if (conn != st->conn) {
virReportInvalidArg(conn,
- _("conn in %s must match stream connection"),
- __FUNCTION__);
+ _("conn must match stream connection"));
goto error;
}
@@ -5529,10 +5513,9 @@ virDomainGetSchedulerParametersFlags(virDomainPtr domain,
/* At most one of these two flags should be set. */
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' in "
+ "are mutually exclusive"));
goto error;
}
conn = domain->conn;
@@ -5709,9 +5692,9 @@ virDomainBlockStats(virDomainPtr dom, const char *disk,
virCheckNonNullArgGoto(disk, error);
virCheckNonNullArgGoto(stats, error);
if (size > sizeof(stats2)) {
- virReportInvalidArg(size,
- _("size in %s must not exceed %zu"),
- __FUNCTION__, sizeof(stats2));
+ virReportInvalidArg(size, "%s",
+ _("size must not exceed %zu"),
+ sizeof(stats2));
goto error;
}
conn = dom->conn;
@@ -5850,9 +5833,9 @@ virDomainInterfaceStats(virDomainPtr dom, const char *path,
virCheckNonNullArgGoto(path, error);
virCheckNonNullArgGoto(stats, error);
if (size > sizeof(stats2)) {
- virReportInvalidArg(size,
- _("size in %s must not exceed %zu"),
- __FUNCTION__, sizeof(stats2));
+ virReportInvalidArg(size, "%s",
+ _("size must not exceed %zu"),
+ sizeof(stats2));
goto error;
}
@@ -6297,10 +6280,9 @@ virDomainMemoryPeek(virDomainPtr dom,
/* Exactly one of these two flags must be set. */
if (!(flags & VIR_MEMORY_VIRTUAL) == !(flags & VIR_MEMORY_PHYSICAL)) {
- virReportInvalidArg(flags,
- _("flags in %s must include VIR_MEMORY_VIRTUAL or "
- "VIR_MEMORY_PHYSICAL"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags must include VIR_MEMORY_VIRTUAL or "
+ "VIR_MEMORY_PHYSICAL"));
goto error;
}
@@ -7144,9 +7126,9 @@ virDomainSendKey(virDomainPtr domain,
virCheckPositiveArgGoto(nkeycodes, error);
if (nkeycodes > VIR_DOMAIN_SEND_KEY_MAX_KEYS) {
- virReportInvalidArg(nkeycodes,
- _("nkeycodes in %s must be <= %d"),
- __FUNCTION__, VIR_DOMAIN_SEND_KEY_MAX_KEYS);
+ virReportInvalidArg(nkeycodes, "%s",
+ _("nkeycodes must be <= %d"),
+ VIR_DOMAIN_SEND_KEY_MAX_KEYS);
goto error;
}
@@ -7344,8 +7326,8 @@ virDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
flags & VIR_DOMAIN_VCPU_MAXIMUM) {
virReportInvalidArg(flags,
_("flags 'VIR_DOMAIN_VCPU_MAXIMUM' and "
- "'VIR_DOMAIN_VCPU_GUEST' in '%s' are mutually "
- "exclusive"), __FUNCTION__);
+ "'VIR_DOMAIN_VCPU_GUEST' in are mutually "
+ "exclusive"));
goto error;
}
@@ -7419,10 +7401,9 @@ virDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
/* At most one of these two flags should be set. */
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
@@ -7626,9 +7607,8 @@ virDomainGetVcpuPinInfo(virDomainPtr domain, int ncpumaps,
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
@@ -7756,9 +7736,8 @@ virDomainGetEmulatorPinInfo(virDomainPtr domain, unsigned char *cpumap,
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
conn = domain->conn;
@@ -7925,10 +7904,9 @@ virDomainGetIOThreadInfo(virDomainPtr dom,
/* At most one of these two flags should be set. */
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
@@ -8181,10 +8159,9 @@ virDomainSetMetadata(virDomainPtr domain,
switch (type) {
case VIR_DOMAIN_METADATA_TITLE:
if (metadata && strchr(metadata, '\n')) {
- virReportInvalidArg(metadata,
- _("metadata title in %s can't contain "
- "newlines"),
- __FUNCTION__);
+ virReportInvalidArg(metadata, "%s",
+ _("metadata title can't contain "
+ "newlines"));
goto error;
}
/* fallthrough */
@@ -8259,10 +8236,9 @@ virDomainGetMetadata(virDomainPtr domain,
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
- virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
@@ -9199,18 +9175,18 @@ virConnectDomainEventRegisterAny(virConnectPtr conn,
if (dom) {
virCheckDomainGoto(dom, error);
if (dom->conn != conn) {
- virReportInvalidArg(dom,
- _("domain '%s' in %s must match connection"),
- dom->name, __FUNCTION__);
+ virReportInvalidArg(dom, "%s",
+ _("domain '%s' must match connection"),
+ dom->name);
goto error;
}
}
virCheckNonNullArgGoto(cb, error);
virCheckNonNegativeArgGoto(eventID, error);
if (eventID >= VIR_DOMAIN_EVENT_ID_LAST) {
- virReportInvalidArg(eventID,
- _("eventID in %s must be less than %d"),
- __FUNCTION__, VIR_DOMAIN_EVENT_ID_LAST);
+ virReportInvalidArg(eventID, "%s",
+ _("eventID must be less than %d"),
+ VIR_DOMAIN_EVENT_ID_LAST);
goto error;
}
@@ -9311,9 +9287,8 @@ virDomainManagedSave(virDomainPtr dom, unsigned int flags)
if ((flags & VIR_DOMAIN_SAVE_RUNNING) && (flags & VIR_DOMAIN_SAVE_PAUSED)) {
virReportInvalidArg(flags,
- _("running and paused flags in %s are mutually "
- "exclusive"),
- __FUNCTION__);
+ _("running and paused flags are mutually "
+ "exclusive"));
goto error;
}
@@ -9466,9 +9441,9 @@ virDomainOpenConsole(virDomainPtr dom,
virCheckReadOnlyGoto(conn->flags, error);
if (conn != st->conn) {
- virReportInvalidArg(st,
- _("stream in %s must match connection of domain '%s'"),
- __FUNCTION__, dom->name);
+ virReportInvalidArg(st, "%s",
+ _("stream must match connection of domain '%s'"),
+ dom->name);
goto error;
}
@@ -9531,8 +9506,8 @@ virDomainOpenChannel(virDomainPtr dom,
if (conn != st->conn) {
virReportInvalidArg(st,
- _("stream in %s must match connection of domain '%s'"),
- __FUNCTION__, dom->name);
+ _("stream must match connection of domain '%s'"),
+ dom->name);
goto error;
}
@@ -9955,9 +9930,8 @@ virDomainBlockRebase(virDomainPtr dom, const char *disk,
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT |
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW |
VIR_DOMAIN_BLOCK_REBASE_COPY_DEV)) {
- virReportInvalidArg(flags,
- _("use of flags in %s requires a copy job"),
- __FUNCTION__);
+ virReportInvalidArg(flags, "%s",
+ _("use of flags requires a copy job"));
goto error;
}
@@ -10276,9 +10250,9 @@ virDomainOpenGraphics(virDomainPtr dom,
}
if (!S_ISSOCK(sb.st_mode)) {
- virReportInvalidArg(fd,
- _("fd %d in %s must be a socket"),
- fd, __FUNCTION__);
+ virReportInvalidArg(fd, "%s",
+ _("fd %d must be a socket"),
+ fd);
goto error;
}
@@ -10490,9 +10464,8 @@ virDomainGetBlockIoTune(virDomainPtr dom,
if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
(flags & VIR_DOMAIN_AFFECT_CONFIG)) {
virReportInvalidArg(flags,
- _("flags 'affect live' and 'affect config' in %s "
- "are mutually exclusive"),
- __FUNCTION__);
+ _("flags 'affect live' and 'affect config' "
+ "are mutually exclusive"));
goto error;
}
conn = dom->conn;
@@ -10615,8 +10588,7 @@ virDomainGetCPUStats(virDomainPtr domain,
if (start_cpu == -1) {
if (ncpus != 1) {
virReportInvalidArg(start_cpu,
- _("ncpus in %s must be 1 when start_cpu is -1"),
- __FUNCTION__);
+ _("ncpus must be 1 when start_cpu is -1"));
goto error;
}
} else {
@@ -11284,9 +11256,8 @@ virDomainListGetStats(virDomainPtr *doms,
virCheckNonNullArgGoto(retStats, cleanup);
if (!*doms) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("doms array must contain at least one domain in %s"),
- __FUNCTION__);
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("doms array must contain at least one domain"));
goto cleanup;
}
@@ -11304,9 +11275,9 @@ virDomainListGetStats(virDomainPtr *doms,
virCheckDomainGoto(dom, cleanup);
if (dom->conn != conn) {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("domains in 'doms' array must belong to a "
- "single connection in %s"), __FUNCTION__);
+ "single connection"));
goto cleanup;
}
--
2.1.0
9 years, 7 months
[libvirt] [PATCH V2 0/3] libxl: domain destroy fixes
by Jim Fehlig
V2 of a small series to fix issues wrt domain destroy
https://www.redhat.com/archives/libvir-list/2015-March/msg01337.html
Comments from Konrad and Martin are addressed in this version.
Jim Fehlig (3):
libxl: Move job acquisition in libxlDomainStart to callers
libxl: acquire a job when destroying a domain
libxl: drop virDomainObj lock when destroying a domain
src/libxl/libxl_domain.c | 81 ++++++++++++++++++------------------------------
src/libxl/libxl_domain.h | 4 ---
src/libxl/libxl_driver.c | 80 +++++++++++++++++++++++++++++++++++------------
3 files changed, 91 insertions(+), 74 deletions(-)
--
1.8.4.5
9 years, 7 months
[libvirt] [PATCH] virsh.pod: Remove redundant --config from attach-interface
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as trivial.
tools/virsh.pod | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 79d50f9..d642a69 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2458,7 +2458,7 @@ Likewise, I<--shareable> is an alias for I<--mode shareable>.
=item B<attach-interface> I<domain> I<type> I<source>
[[[I<--live>] [I<--config>] | [I<--current>]] | [I<--persistent>]]
[I<--target target>] [I<--mac mac>] [I<--script script>] [I<--model model>]
-[I<--config>] [I<--inbound average,peak,burst>] [I<--outbound average,peak,burst>]
+[I<--inbound average,peak,burst>] [I<--outbound average,peak,burst>]
Attach a new network interface to the domain. I<type> can be
I<network> to indicate connection via a libvirt virtual network, or
--
2.3.5
9 years, 7 months
[libvirt] [PATCH] Fix xlconfigtest with older libxl
by Ján Tomko
Commit cd5dc30 added this test, but it fails if
LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is not defined:
6) Xen XM-2-XML Format fullvirt-multiusb
... libvirt: error : unsupported configuration: multiple USB
devices not supported
FAILED
---
tests/xlconfigtest.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 6d4aa6d..c992548 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -215,7 +215,10 @@ mymain(void)
DO_TEST("new-disk", 3);
DO_TEST("spice", 3);
+
+#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
DO_TEST("fullvirt-multiusb", 3);
+#endif
virObjectUnref(caps);
virObjectUnref(xmlopt);
--
2.0.5
9 years, 7 months