[libvirt] [PATCH 02/24] qemu: Refactor the code to build -incoming command line
Peter Krempa
pkrempa at redhat.com
Fri Nov 13 09:37:36 UTC 2015
On Fri, Nov 13, 2015 at 10:28:08 +0100, Jiri Denemark wrote:
> On Fri, Nov 13, 2015 at 10:06:08 +0100, Peter Krempa wrote:
> > On Thu, Nov 12, 2015 at 19:37:04 +0100, Jiri Denemark wrote:
> > > Move the code from qemuBuildCommandLine into dedicated functions.
> > >
> > > Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> > > ---
> > >
> > > Notes:
> > > Both functions will later be moved to qemu_migration.c
> > >
> > > src/qemu/qemu_command.c | 75 +++++++++++++++++++++++++++++++++----------------
> > > 1 file changed, 51 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> > > index 792ada3..723609d 100644
> > > --- a/src/qemu/qemu_command.c
> > > +++ b/src/qemu/qemu_command.c
> > > @@ -11006,32 +11045,20 @@ qemuBuildCommandLine(virConnectPtr conn,
> > > }
> > >
> > > if (migrateFrom) {
> > > - virCommandAddArg(cmd, "-incoming");
> > > - if (STRPREFIX(migrateFrom, "tcp")) {
> > > - virCommandAddArg(cmd, migrateFrom);
> > > - } else if (STRPREFIX(migrateFrom, "rdma")) {
> > > - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATE_RDMA)) {
> > > - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> > > - _("incoming RDMA migration is not supported "
> > > - "with this QEMU binary"));
> > > - goto error;
> > > - }
> > > - virCommandAddArg(cmd, migrateFrom);
> > > - } else if (STREQ(migrateFrom, "stdio")) {
> > > - virCommandAddArgFormat(cmd, "fd:%d", migrateFd);
> > > - virCommandPassFD(cmd, migrateFd, 0);
> > > - } else if (STRPREFIX(migrateFrom, "exec")) {
> > > - virCommandAddArg(cmd, migrateFrom);
> > > - } else if (STRPREFIX(migrateFrom, "fd")) {
> > > - virCommandAddArg(cmd, migrateFrom);
> > > + char *migrateURI;
> > > +
> > > + if (qemuBuildIncomingCheckProtocol(qemuCaps, migrateFrom) < 0)
> > > + goto error;
> > > +
> > > + if (STREQ(migrateFrom, "stdio") &&
> > > + STRPREFIX(migrateFrom, "fd"))
> >
> > I doubt that this will ever be true.
>
> Oops, looks like a wrong rebase after Daniel's removal of old migration
> features. The following patch removes this completely, which is why I
> didn't catch it during testing :-)
I'm now going through that patch and indeed it's being removed and the
condition sanitized. ACK to this one if you change && to ||.
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151113/042e34cf/attachment-0001.sig>
More information about the libvir-list
mailing list