On 08/26/14 13:21, Eric Blake wrote: > I'm about to extend the capabilities of blockcopy. Hiding a few > common lines of implementation gets in the way of the new required > logic, and putting the new logic in the common implementation won't > benefit any of the other blockjob operations. Therefore, it is > simpler to just do the work inline. > > * tools/virsh-domain.c (blockJobImpl): Drop unused variable. Move > block copy guts... > (cmdBlockCopy): ...into their lone caller. > > Signed-off-by: Eric Blake <eblake@xxxxxxxxxx> > --- > tools/virsh-domain.c | 45 +++++++++++++++++++++++++++------------------ > 1 file changed, 27 insertions(+), 18 deletions(-) > > diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c > index 2562326..fb9c009 100644 > --- a/tools/virsh-domain.c > +++ b/tools/virsh-domain.c > @@ -1443,8 +1443,7 @@ typedef enum { > VSH_CMD_BLOCK_JOB_INFO = 1, > VSH_CMD_BLOCK_JOB_SPEED = 2, > VSH_CMD_BLOCK_JOB_PULL = 3, > - VSH_CMD_BLOCK_JOB_COPY = 4, > - VSH_CMD_BLOCK_JOB_COMMIT = 5, > + VSH_CMD_BLOCK_JOB_COMMIT = 4, > } vshCmdBlockJobMode; > > static int > @@ -1453,14 +1452,14 @@ blockJobImpl(vshControl *ctl, const vshCmd *cmd, > virDomainPtr *pdom) > { > virDomainPtr dom = NULL; > - const char *name, *path; > + const char *path; This ... > unsigned long bandwidth = 0; > int ret = -1; > const char *base = NULL; > const char *top = NULL; > unsigned int flags = 0; > > - if (!(dom = vshCommandOptDomain(ctl, cmd, &name))) > + if (!(dom = vshCommandOptDomain(ctl, cmd, NULL))) .. and this are unrelated changes. > goto cleanup; > > if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0) ACK although I'd rather see the two changes separate. Peter
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list