[Pkg-libvirt-commits] [libguestfs] 06/63: p2v: Change p2v.output -> p2v.o etc and add p2v.oc
Hilko Bengen
bengen at moszumanska.debian.org
Fri Oct 3 14:43:23 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag debian/1%1.27.39-1
in repository libguestfs.
commit 81d3aee0713faddc320cd1db5ac125891d07a0f0
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Tue Sep 2 08:58:46 2014 +0100
p2v: Change p2v.output -> p2v.o etc and add p2v.oc
Name these the same as the virt-v2v options, so for example
'-oa' -> 'p2v.oa'.
Also add the missing p2v.oc (-oc) option.
This updates commit c516d2d07dd0d1e4429ec84d2e9ebe02a951c5b5.
---
p2v/config.c | 3 +++
p2v/kernel.c | 24 ++++++++++++++++--------
p2v/p2v.h | 1 +
p2v/test-virt-p2v.sh | 2 +-
p2v/virt-p2v.pod | 16 +++++++++++-----
5 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/p2v/config.c b/p2v/config.c
index e3ac2a6..f0e9d9c 100644
--- a/p2v/config.c
+++ b/p2v/config.c
@@ -75,6 +75,8 @@ copy_config (struct config *old)
c->interfaces = guestfs___copy_string_list (c->interfaces);
if (c->output)
c->output = strdup (c->output);
+ if (c->output_connection)
+ c->output_connection = strdup (c->output_connection);
if (c->output_format)
c->output_format = strdup (c->output_format);
if (c->output_storage)
@@ -94,6 +96,7 @@ free_config (struct config *c)
guestfs___free_string_list (c->removable);
guestfs___free_string_list (c->interfaces);
free (c->output);
+ free (c->output_connection);
free (c->output_format);
free (c->output_storage);
free (c);
diff --git a/p2v/kernel.c b/p2v/kernel.c
index 64432fd..9317bb5 100644
--- a/p2v/kernel.c
+++ b/p2v/kernel.c
@@ -161,33 +161,41 @@ kernel_configuration (struct config *config, const char *cmdline)
config->interfaces = guestfs___split_string (',', t);
}
- r = strstr (cmdline, "p2v.output=");
+ r = strstr (cmdline, "p2v.o=");
if (r) {
- r += 5+6;
+ r += 5+1;
len = strcspn (r, " ");
free (config->output);
config->output = strndup (r, len);
}
- r = strstr (cmdline, "p2v.output_allocation=sparse");
+ r = strstr (cmdline, "p2v.oa=sparse");
if (r)
config->output_allocation = OUTPUT_ALLOCATION_SPARSE;
- r = strstr (cmdline, "p2v.output_allocation=preallocated");
+ r = strstr (cmdline, "p2v.oa=preallocated");
if (r)
config->output_allocation = OUTPUT_ALLOCATION_PREALLOCATED;
- r = strstr (cmdline, "p2v.output_format=");
+ r = strstr (cmdline, "p2v.oc=");
+ if (r) {
+ r += 5+2;
+ len = strcspn (r, " ");
+ free (config->output_connection);
+ config->output_connection = strndup (r, len);
+ }
+
+ r = strstr (cmdline, "p2v.of=");
if (r) {
- r += 5+13;
+ r += 5+2;
len = strcspn (r, " ");
free (config->output_format);
config->output_format = strndup (r, len);
}
- r = strstr (cmdline, "p2v.output_storage=");
+ r = strstr (cmdline, "p2v.os=");
if (r) {
- r += 5+14;
+ r += 5+2;
len = strcspn (r, " ");
free (config->output_storage);
config->output_storage = strndup (r, len);
diff --git a/p2v/p2v.h b/p2v/p2v.h
index 4251d0b..2622adb 100644
--- a/p2v/p2v.h
+++ b/p2v/p2v.h
@@ -67,6 +67,7 @@ struct config {
char **interfaces;
char *output;
int output_allocation;
+ char *output_connection;
char *output_format;
char *output_storage;
};
diff --git a/p2v/test-virt-p2v.sh b/p2v/test-virt-p2v.sh
index a062525..34a5823 100755
--- a/p2v/test-virt-p2v.sh
+++ b/p2v/test-virt-p2v.sh
@@ -59,7 +59,7 @@ export PATH=$d:$PATH
# under test (because of the ./run script).
# The Linux kernel command line.
-cmdline="p2v.server=localhost p2v.name=windows p2v.debug p2v.disks=$f p2v.output=local p2v.output_storage=$d"
+cmdline="p2v.server=localhost p2v.name=windows p2v.debug p2v.disks=$f p2v.o=local p2v.os=$d"
./virt-p2v --cmdline="$cmdline"
diff --git a/p2v/virt-p2v.pod b/p2v/virt-p2v.pod
index 0ac68c3..d8e96b9 100644
--- a/p2v/virt-p2v.pod
+++ b/p2v/virt-p2v.pod
@@ -77,7 +77,7 @@ in the C<pxelinux.cfg> file. For example:
PROMPT 0
LABEL p2v
KERNEL virt-p2v-vmlinuz
- APPEND initrd=virt-p2v-initrd p2v.server=conv.example.com p2v.password=secret p2v.output=libvirt
+ APPEND initrd=virt-p2v-initrd p2v.server=conv.example.com p2v.password=secret p2v.o=libvirt
You have to set some or all of the following command line arguments:
@@ -161,7 +161,7 @@ Note that the content of removable media is never copied over.
A list of network interfaces to convert. The default is to create
virtual network interfaces for every physical network interface found.
-=item B<p2v.output=[libvirt|local|...]>
+=item B<p2v.o=[libvirt|local|...]>
Set the output mode. This is the same as the virt-v2v I<-o> option.
See L<virt-v2v(1)/OPTIONS>.
@@ -169,17 +169,23 @@ See L<virt-v2v(1)/OPTIONS>.
If not specified, the default is C<local>, and the converted guest is
written to C</var/tmp>.
-=item B<p2v.output_allocation=sparse|preallocated>
+=item B<p2v.oa=sparse|preallocated>
Set the output allocation mode. This is the same as the virt-v2v
I<-oa> option. See L<virt-v2v(1)/OPTIONS>.
-=item B<p2v.output_format=raw|sparse|...>
+=item B<p2v.oc=...>
+
+Set the output connection libvirt URI. This is the same as the
+virt-v2v I<-oc> option. See L<virt-v2v(1)/OPTIONS> and
+L<http://libvirt.org/uri.html>
+
+=item B<p2v.of=raw|sparse|...>
Set the output format. This is the same as the virt-v2v I<-oa>
option. See L<virt-v2v(1)/OPTIONS>.
-=item B<p2v.output_storage=...>
+=item B<p2v.os=...>
Set the output storage. This is the same as the virt-v2v I<-os>
option. See L<virt-v2v(1)/OPTIONS>.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list