[libvirt] [PATCH] Ensure parted doesn't prompt if labeling disk

Trying to 'build' a disk pool uses 'parted mklabel' which can prompt for confirmation. Patch adds the '--script' option to remove the chance of this happening. Thanks, Cole

Cole Robinson <crobinso@redhat.com> wrote:
Trying to 'build' a disk pool uses 'parted mklabel' which can prompt for confirmation. Patch adds the '--script' option to remove the chance of this happening.
diff --git a/src/storage_backend_disk.c b/src/storage_backend_disk.c index d6548eb..39b857c 100644 --- a/src/storage_backend_disk.c +++ b/src/storage_backend_disk.c @@ -406,6 +406,7 @@ virStorageBackendDiskBuildPool(virConnectPtr conn, PARTED, pool->def->source.devices[0].path, "mklabel", + "--script", virStorageBackendDiskPoolFormatToString(conn, pool->def->source.format), NULL, };
Good change. ACK.

On Sun, Aug 10, 2008 at 10:40:30PM -0400, Cole Robinson wrote:
Trying to 'build' a disk pool uses 'parted mklabel' which can prompt for confirmation. Patch adds the '--script' option to remove the chance of this happening.
Can you double-check this works on RHEL-5 - IIRC, the --script arg is a fairly recent addition to parted.
diff --git a/src/storage_backend_disk.c b/src/storage_backend_disk.c index d6548eb..39b857c 100644 --- a/src/storage_backend_disk.c +++ b/src/storage_backend_disk.c @@ -406,6 +406,7 @@ virStorageBackendDiskBuildPool(virConnectPtr conn, PARTED, pool->def->source.devices[0].path, "mklabel", + "--script", virStorageBackendDiskPoolFormatToString(conn, pool->def->source.format), NULL, };
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Sun, Aug 10, 2008 at 10:40:30PM -0400, Cole Robinson wrote:
Trying to 'build' a disk pool uses 'parted mklabel' which can prompt for confirmation. Patch adds the '--script' option to remove the chance of this happening.
Can you double-check this works on RHEL-5 - IIRC, the --script arg is a fairly recent addition to parted.
My 5.2 box has it. The --script option is also used elsewhere in the disk code, so I assume it's safe. Thanks, Cole

On Mon, Aug 11, 2008 at 09:53:48AM -0400, Cole Robinson wrote:
Daniel P. Berrange wrote:
On Sun, Aug 10, 2008 at 10:40:30PM -0400, Cole Robinson wrote:
Trying to 'build' a disk pool uses 'parted mklabel' which can prompt for confirmation. Patch adds the '--script' option to remove the chance of this happening.
Can you double-check this works on RHEL-5 - IIRC, the --script arg is a fairly recent addition to parted.
My 5.2 box has it. The --script option is also used elsewhere in the disk code, so I assume it's safe.
makes sense and safe, applied and commited, thanks again :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (4)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard
-
Jim Meyering