[libvirt] [PATCH] virsh: fix doc typos
by Eric Blake
Reported in https://bugzilla.redhat.com/show_bug.cgi?id=1022872
* tools/virsh.pod: s/COMMMANDS/COMMANDS/
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing as trivial.
tools/virsh.pod | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 7af5503..68e6e86 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2823,7 +2823,7 @@ B<blockresize> for live resizing.
=back
-=head1 SECRET COMMMANDS
+=head1 SECRET COMMANDS
The following commands manipulate "secrets" (e.g. passwords, passphrases and
encryption keys). Libvirt can store secrets independently from their use, and
@@ -2870,7 +2870,7 @@ I<--no-private> to list the non-private ones.
=back
-=head1 SNAPSHOT COMMMANDS
+=head1 SNAPSHOT COMMANDS
The following commands manipulate domain snapshots. Snapshots take the
disk, memory, and device state of a domain at a point-of-time, and save it
@@ -3170,7 +3170,7 @@ the data contents from that point in time.
=back
-=head1 NWFILTER COMMMANDS
+=head1 NWFILTER COMMANDS
The following commands manipulate network filters. Network filters allow
filtering of the network traffic coming from and going to virtual machines.
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH] virsh domxml-from-native to treat SCSI as the bus type for pseries by default
by Shivaprasad G Bhat
From: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
The bus type IDE being enum Zero, the bus type on pseries system appears as IDE for all the disk types. Pseries platform needs this to appear as SCSI instead of IDE.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_command.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index abb62e9..728409f 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9995,6 +9995,7 @@ error:
static virDomainDiskDefPtr
qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
const char *val,
+ virDomainDefPtr dom,
int nvirtiodisk,
bool old_style_ceph_args)
{
@@ -10018,7 +10019,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
if (VIR_ALLOC(def) < 0)
goto cleanup;
- def->bus = VIR_DOMAIN_DISK_BUS_IDE;
+ if (((dom->os.arch == VIR_ARCH_PPC64) &&
+ dom->os.machine && STREQ(dom->os.machine, "pseries")))
+ def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
+ else
+ def->bus = VIR_DOMAIN_DISK_BUS_IDE;
def->device = VIR_DOMAIN_DISK_DEVICE_DISK;
def->type = VIR_DOMAIN_DISK_TYPE_FILE;
@@ -11332,8 +11337,13 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
disk->type = VIR_DOMAIN_DISK_TYPE_FILE;
if (STREQ(arg, "-cdrom")) {
disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM;
- if (VIR_STRDUP(disk->dst, "hdc") < 0)
- goto error;
+ if (((def->os.arch == VIR_ARCH_PPC64) &&
+ def->os.machine && STREQ(def->os.machine, "pseries"))) {
+ disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
+ if (VIR_STRDUP(disk->dst, "sdc") < 0)
+ goto error;
+ } else if (VIR_STRDUP(disk->dst, "hdc") < 0)
+ goto error;
disk->readonly = true;
} else {
if (STRPREFIX(arg, "-fd")) {
@@ -11345,6 +11355,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
disk->bus = VIR_DOMAIN_DISK_BUS_IDE;
else
disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
+ if (((def->os.arch == VIR_ARCH_PPC64) &&
+ def->os.machine && STREQ(def->os.machine, "pseries")))
+ disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
}
if (VIR_STRDUP(disk->dst, arg + 1) < 0)
goto error;
@@ -11636,7 +11649,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
}
} else if (STREQ(arg, "-drive")) {
WANT_VALUE();
- if (!(disk = qemuParseCommandLineDisk(xmlopt, val,
+ if (!(disk = qemuParseCommandLineDisk(xmlopt, val, def,
nvirtiodisk,
ceph_args != NULL)))
goto error;
11 years, 2 months
[libvirt] [PATCH] Ignore GNU Global tag files
by Martin Kletzander
... the same way we ignore other TAGS
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index db5abcd..e372876 100644
--- a/.gitignore
+++ b/.gitignore
@@ -233,6 +233,9 @@
/tools/virt-*-validate
/tools/virt-sanlock-cleanup
/update.log
+GPATH
+GRTAGS
+GTAGS
Makefile
Makefile.in
TAGS
--
1.8.4
11 years, 2 months
[libvirt] build: fix linking virt-login-shell
by Jim Fehlig
After commit 3e2f27e1, I've noticed build failures of virt-login-shell
when libapparmor-devel is installed on the build host
CCLD virt-login-shell
../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o):
In function `virExec':
/home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined
reference to `aa_change_profile'
collect2: error: ld returned 1 exit status
I was about to commit an easy fix under the build-breaker rule
(build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS
to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it
makes sense (build-fix-2.patch).
Should I just stick with the simple fix, or is something along the lines
of patch 2 preferred?
Regards,
Jim
11 years, 2 months
[libvirt] [PATCH] build: Fix prohibit_int_ijk (and iijjkk) on RHEL 5
by Martin Kletzander
On RHEL 5, make syntax-check was failing because even strings like
'int isTempChain' matched the 'int i' rule. To be honest, I haven't
found the root cause, but the change added makes it work as expected
and keeps the proper behavior on newer systems as well.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
I'm not pushing this one as a build breaker since I haven't found the
root cause, so feel free to object and fix it differently.
cfg.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 56821e2..e9da282 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -555,12 +555,12 @@ sc_avoid_attribute_unused_in_header:
$(_sc_search_regexp)
sc_prohibit_int_ijk:
- @prohibit='\<(int|unsigned) ([^(]* )*(i|j|k)(\s|,|;)' \
+ @prohibit='\<(int|unsigned) ([^(]* )*(i|j|k)\>(\s|,|;)' \
halt='use size_t, not int/unsigned int for loop vars i, j, k' \
$(_sc_search_regexp)
sc_prohibit_loop_iijjkk:
- @prohibit='\<(int|unsigned) ([^=]+ )*(ii|jj|kk)(\s|,|;)' \
+ @prohibit='\<(int|unsigned) ([^=]+ )*(ii|jj|kk)\>(\s|,|;)' \
halt='use i, j, k for loop iterators, not ii, jj, kk' \
$(_sc_search_regexp)
--
1.8.4
11 years, 2 months
[libvirt] [PATCH 0/5]virsh: solutions for hiding '--shareable' option
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
As Daniel mentioned, '--shareable' should be hidden from users.
But we had to take care of backwards compatibility.
These patches give solutions to solve these issues.
Chen Hanxiao (5):
[libvirt]virsh: disable config readonly and shareable in virsh command
[libvirt]virsh: introduce flags VSH_OFLAG_IGNORE
[libvirt]virsh: if VSH_OFLAG_IGNORE set, don't show it in '--help'
[libvirt]virsh: If VSH_OFLAG_IGNORE set, don't auto complete in virsh
[libvirt]virsh: mark '--shareable' as VSH_OFLAG_IGNORE
tools/virsh-domain.c | 3 ++-
tools/virsh.c | 9 +++++++++
tools/virsh.h | 1 +
tools/virsh.pod | 3 +--
4 files changed, 13 insertions(+), 3 deletions(-)
--
1.8.2.1
11 years, 2 months
Re: [libvirt] [RESEND][PATCHv5 1/4] add hostdev passthrough common library
by Daniel P. Berrange
On Wed, Oct 23, 2013 at 04:15:57PM +0800, Chunyan Liu wrote:
> 2013/10/15 Daniel P. Berrange <berrange(a)redhat.com>
>
> > On Fri, Sep 13, 2013 at 11:34:34AM +0800, Chunyan Liu wrote:
> > > Add hostdev passthrough common library so that it could be shared by all
> > drivers
> > > and maintain a global hostdev state.
> > >
> > > Signed-off-by: Chunyan Liu <cyliu(a)suse.com>
> > > ---
> > > docs/schemas/domaincommon.rng | 1 +
> > > src/conf/domain_conf.c | 3 +-
> > > src/conf/domain_conf.h | 1 +
> >
> > I'd prefer to see these changes to the XML parser be done in a separate
> > patch - either before or after this patch.
> >
> > > diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> > > index 0abf80b..4d6d07b 100644
> > > --- a/src/libxl/libxl_domain.c
> > > +++ b/src/libxl/libxl_domain.c
> > > @@ -393,6 +393,15 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr
> > dev,
> > > STRNEQ(def->os.type, "hvm"))
> > > dev->data.chr->targetType =
> > VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
> > >
> > > + if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) {
> > > + virDomainHostdevDefPtr hostdev = dev->data.hostdev;
> > > +
> > > + if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
> > > + hostdev->source.subsys.type ==
> > VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
> > > + hostdev->source.subsys.u.pci.backend ==
> > VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT)
> > > + hostdev->source.subsys.u.pci.backend =
> > VIR_DOMAIN_HOSTDEV_PCI_BACKEND_XEN;
> > > + }
> > > +
> > > return 0;
> > > }
> > >
> >
> > This should be separate too.
> >
> > > diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
> > > new file mode 100644
> > > index 0000000..d131160
> > > --- /dev/null
> > > +++ b/src/util/virhostdev.c
> > > @@ -0,0 +1,1335 @@
> > > +/* virhostdev.c: hostdev management
> > > + *
> > > + * Copyright (C) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
> > > + * Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
> > > + * Copyright (C) 2006 Daniel P. Berrange
> > > + *
> > > + * This library is free software; you can redistribute it and/or
> > > + * modify it under the terms of the GNU Lesser General Public
> > > + * License as published by the Free Software Foundation; either
> > > + * version 2.1 of the License, or (at your option) any later version.
> > > + *
> > > + * This library is distributed in the hope that it will be useful,
> > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> > > + * Lesser General Public License for more details.
> > > + *
> > > + * You should have received a copy of the GNU Lesser General Public
> > > + * License along with this library. If not, see
> > > + * <http://www.gnu.org/licenses/>.
> > > + *
> > > + * Author: Chunyan Liu <cyliu(a)suse.com>
> > > + * Author: Daniel P. Berrange <berrange(a)redhat.com>
> > > + */
> > > +
> > > +#include <config.h>
> > > +
> > > +#include "virhostdev.h"
> > > +
> > > +#include <sys/types.h>
> > > +#include <sys/stat.h>
> > > +#include <unistd.h>
> > > +#include <stdlib.h>
> > > +#include <stdio.h>
> > > +
> > > +#include "viralloc.h"
> > > +#include "virstring.h"
> > > +#include "virfile.h"
> > > +#include "virerror.h"
> > > +#include "virlog.h"
> > > +#include "virpci.h"
> > > +#include "virusb.h"
> > > +#include "virscsi.h"
> > > +#include "virnetdev.h"
> > > +#include "virutil.h"
> > > +#include "configmake.h"
> > > +
> > > +#define VIR_FROM_THIS VIR_FROM_NONE
> > > +
> > > +#define HOSTDEV_STATE_DIR LOCALSTATEDIR "/run/libvirt/hostdevmgr"
> > > +
> > > +struct _virHostdevManager{
> > > + char *stateDir;
> > > +
> > > + virPCIDeviceListPtr activePciHostdevs;
> > > + virPCIDeviceListPtr inactivePciHostdevs;
> > > + virUSBDeviceListPtr activeUsbHostdevs;
> > > + virSCSIDeviceListPtr activeScsiHostdevs;
> > > +};
> > > +
> > > +static virHostdevManagerPtr hostdevMgr;
> > > +
> > > +static void
> > > +virHostdevManagerCleanup(void)
> > > +{
> > > + if (!hostdevMgr)
> > > + return;
> > > +
> > > + virObjectUnref(hostdevMgr->activePciHostdevs);
> > > + virObjectUnref(hostdevMgr->inactivePciHostdevs);
> > > + virObjectUnref(hostdevMgr->activeUsbHostdevs);
> > > + VIR_FREE(hostdevMgr->stateDir);
> > > +
> > > + VIR_FREE(hostdevMgr);
> > > +}
> > > +
> > > +static int
> > > +virHostdevOnceInit(void)
> > > +{
> > > + if (VIR_ALLOC(hostdevMgr) < 0)
> > > + goto error;
> > > +
> > > + if ((hostdevMgr->activePciHostdevs = virPCIDeviceListNew()) == NULL)
> > > + goto error;
> > > +
> > > + if ((hostdevMgr->activeUsbHostdevs = virUSBDeviceListNew()) == NULL)
> > > + goto error;
> > > +
> > > + if ((hostdevMgr->inactivePciHostdevs = virPCIDeviceListNew()) ==
> > NULL)
> > > + goto error;
> > > +
> > > + if ((hostdevMgr->activeScsiHostdevs = virSCSIDeviceListNew()) ==
> > NULL)
> > > + goto error;
> > > +
> > > + if (VIR_STRDUP(hostdevMgr->stateDir, HOSTDEV_STATE_DIR) < 0)
> > > + goto error;
> >
> > Hmm, this is going to lead to some upgrade problems when libvirt is
> > restarted with existing VMs present. I think we'll need some code
> > in this initialization which looks for the old QEMU-specific path
> > and if found, tries to move the data into the new location.
> >
> >
> I'll do that. But IMO, finding and moving data in the initialization
> function is a little bit painful.
> The hostdevMgr->stateDir is only used to save/store net config of a SR-IOV
> device, the file name could be pflinkdev_
> vfindex or pflinkdev (e.g, eth0, eth0_vf0, p1p2, p1p2_vf0, etc.), hard to
> match through some fix rule.
> Now that it's a upgrade requirement, and I think it only affects when an
> existing VM has a hostdev that stores net config in the old stateDir, we
> can also handle it the restore net config part. (To check whether filename
> is in hostdevMgr->stateDir, if not and hypervisor is qemu, try to find in
> old stateDir /var/run/libvirt/qemu/.)
> How do you think? If that's OK. I'll posting revised version.
Yeah, should be ok. Just want to minimise the amount of code to deal with
back compat, whichever approach you choose.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
11 years, 2 months
Re: [libvirt] Support QEMU Live Upgrade in Libvirt
by Eric Blake
On 10/23/2013 03:58 AM, Zhou Zheng Sheng wrote:
> Thanks! I am now starting to investigate if we can re-use parts of
> migration code after some refactoring, and how much code should be
> written from scratch. I am not very clear about how the new flow looks
> like. I think the migration protocol v3 is quite reasonable for dealing
> with various cases and errors in the migration. After all, QEMU live
> upgrade is implemented as migration under the hood, so I think common
> migration management logic would be applied to it too. For example, if
> QEMU live upgrade migration fails, target domain should be destroyed and
> source domain should be resumed. Maybe I can re-use some of the parts in
> the migration protocol v3 flow.
Is it even possible to resume the original process if you have already
page-flipped the memory to the destination process? I'm worried that
there may be some catastrophic paths that are non-recoverable, but hope
that's not the case.
>
> By the way. It seems my mail sent to libvir-list(a)redhat.com is not
> appearing in the list. I'm already a member in the list. I see in the
> subscribing web page saying first time posts need moderator approval. I
> thought I've posted before. Maybe it's too long since my last activity.
> I also tried to join the list again and the system sent me a mail saying
> I was already a member. I sent a mail to libvir-list-owner(a)redhat.com
> asking for help but no response yet. Am I blocked? Or is it just because
> I didn't add a [libvirt] tag in the title? I thought the tag is added
> automatically when I was posting in other lists. Would you have a look
> at my subscription status? Thank you!
>
No idea what's going on there - I checked and didn't see anything stuck
in the mod queue or any indication of blacklisting on your email
address. Sometimes things just get stuck in queues somewhere, and
eventually show up later.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
11 years, 2 months
[libvirt] [PATCH] network: Add a missing check in bridge_driver.c
by Hongwei Bi
Signed-off-by: Hongwei Bi <hwbi2008(a)gmail.com>
---
src/network/bridge_driver.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 8787bdb..73375f0 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -1107,7 +1107,8 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr driver,
if (dctx == NULL)
goto cleanup;
- dnsmasqCapsRefresh(&driver->dnsmasqCaps, false);
+ if (dnsmasqCapsRefresh(&driver->dnsmasqCaps, false) < 0)
+ goto cleanup;
ret = networkBuildDhcpDaemonCommandLine(network, &cmd, pidfile,
dctx, driver->dnsmasqCaps);
--
1.8.1.2
11 years, 2 months
[libvirt] libvirt python is not correctly passing file descriptors to underlying virDomainCreateWithFiles
by Marian Neagul
Dear All,
While working on a component handling container management I stumbled on a bug in the libvirt python bindings: basically the python bindings fail in properly translating the python file descriptor list to a native C array.
The primary symptom was that inside the container the file descriptors are created but mapped to '/dev/null' instead of the original file descriptors
This problem was discovered in libvirt 1.1.2 but the problem exists also in the current git head.
I'm attaching a simple patch fixing the bug, and re-establishing the expected behaviour.
I've also opened a bugzilla issue at https://bugzilla.redhat.com/show_bug.cgi?id=1021434
I hope this fix is acceptable and that it can be incorporated in the code base. :)
Marian
~~~~~~~~~~~~~~~
Marian Neagul
Universitatea de Vest din Timisoara
Facultatea de Matematică și Informatică
Centrul de Cercetare in Informatica
marian(a)info.uvt.ro
marian(a)hpc.uvt.ro
11 years, 2 months